Datasets:
Add files using upload-large-folder tool
Browse files- md/train/5qsptDcsdEj/5qsptDcsdEj.md +356 -0
- md/train/7Yhok3vJpU/7Yhok3vJpU.md +350 -0
- md/train/B1lDoJSYDH/B1lDoJSYDH.md +361 -0
- md/train/BJg73xHtvr/BJg73xHtvr.md +0 -0
- md/train/BkCV_W-AZ/BkCV_W-AZ.md +384 -0
- md/train/BkVsWbbAW/BkVsWbbAW.md +321 -0
- md/train/ByOvsIqeg/ByOvsIqeg.md +233 -0
- md/train/CLCVcl1rSPP/CLCVcl1rSPP.md +320 -0
- md/train/CzVPfeqPOBu/CzVPfeqPOBu.md +269 -0
- md/train/H1g0Z3A9Fm/H1g0Z3A9Fm.md +0 -0
- md/train/H1g2NhC5KQ/H1g2NhC5KQ.md +322 -0
- md/train/H1lmyRNFvr/H1lmyRNFvr.md +257 -0
- md/train/H1uP7ebAW/H1uP7ebAW.md +283 -0
- md/train/H1zriGeCZ/H1zriGeCZ.md +461 -0
- md/train/HJSA_e1AW/HJSA_e1AW.md +378 -0
- md/train/HJgSwyBKvr/HJgSwyBKvr.md +693 -0
- md/train/HklRKpEKDr/HklRKpEKDr.md +310 -0
- md/train/Kb26p7chwhf/Kb26p7chwhf.md +294 -0
- md/train/S1e2agrFvS/S1e2agrFvS.md +292 -0
- md/train/S1exA2NtDB/S1exA2NtDB.md +462 -0
- md/train/S1gOpsCctm/S1gOpsCctm.md +239 -0
- md/train/S1q_Cz-Cb/S1q_Cz-Cb.md +508 -0
- md/train/SJlHwkBYDH/SJlHwkBYDH.md +347 -0
- md/train/Sk2u1g-0-/Sk2u1g-0-.md +554 -0
- md/train/Skeh1krtvH/Skeh1krtvH.md +250 -0
- md/train/Sks9_ajex/Sks9_ajex.md +271 -0
- md/train/SkxpDT4YvS/SkxpDT4YvS.md +0 -0
- md/train/SyzKd1bCW/SyzKd1bCW.md +499 -0
- md/train/Tsp2PL7-GQ/Tsp2PL7-GQ.md +231 -0
- md/train/Y4RJQO2jivm/Y4RJQO2jivm.md +417 -0
- md/train/Yx1OzVU_SRi/Yx1OzVU_SRi.md +421 -0
- md/train/ZIyj0E58vzlo/ZIyj0E58vzlo.md +362 -0
- md/train/_WnGcwXLYOE/_WnGcwXLYOE.md +255 -0
- md/train/c5QbJ1zob73/c5QbJ1zob73.md +0 -0
- md/train/gjBz22V93a/gjBz22V93a.md +288 -0
- md/train/jDdzh5ul-d/jDdzh5ul-d.md +0 -0
- md/train/k-0oq5eNjh/k-0oq5eNjh.md +234 -0
- md/train/piLPYqxtWuA/piLPYqxtWuA.md +327 -0
- md/train/r1e8WTEYPB/r1e8WTEYPB.md +359 -0
- md/train/r1rhWnZkg/r1rhWnZkg.md +424 -0
- md/train/rJevYoA9Fm/rJevYoA9Fm.md +356 -0
- md/train/rJg4YGWRb/rJg4YGWRb.md +344 -0
- md/train/rJg76kStwH/rJg76kStwH.md +484 -0
- md/train/rJgzzJHtDB/rJgzzJHtDB.md +352 -0
- md/train/rJljdh4KDH/rJljdh4KDH.md +325 -0
- md/train/rJxGLlBtwH/rJxGLlBtwH.md +273 -0
- md/train/rdT5GV-LnZU/rdT5GV-LnZU.md +529 -0
- md/train/rkgNKkHtvB/rkgNKkHtvB.md +274 -0
- md/train/vQzcqQWIS0q/vQzcqQWIS0q.md +387 -0
- md/train/wS0UFjsNYjn/wS0UFjsNYjn.md +336 -0
md/train/5qsptDcsdEj/5qsptDcsdEj.md
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Continual World: A Robotic Benchmark For Continual Reinforcement Learning
|
| 2 |
+
|
| 3 |
+
Maciej Wołczyk⇤ Jagiellonian University Kraków, Poland maciej.wolczyk@doctoral.uj.edu.pl
|
| 4 |
+
|
| 5 |
+
Michał Zaj ˛ac⇤
|
| 6 |
+
Jagiellonian University
|
| 7 |
+
Kraków, Poland
|
| 8 |
+
emzajac@gmail.com
|
| 9 |
+
Razvan Pascanu
|
| 10 |
+
DeepMind
|
| 11 |
+
London, UK
|
| 12 |
+
razp@google.com
|
| 13 |
+
|
| 14 |
+
Łukasz Kucinski ´ Polish Academy of Sciences Warsaw, Poland lkucinski@impan.pl
|
| 15 |
+
|
| 16 |
+
# Piotr Miłos´
|
| 17 |
+
|
| 18 |
+
Polish Academy of Sciences,
|
| 19 |
+
University of Oxford,
|
| 20 |
+
deepsense.ai
|
| 21 |
+
Warsaw, Poland
|
| 22 |
+
pmilos@impan.pl
|
| 23 |
+
|
| 24 |
+
# Abstract
|
| 25 |
+
|
| 26 |
+
Continual learning (CL) — the ability to continuously learn, building on previously acquired knowledge — is a natural requirement for long-lived autonomous reinforcement learning (RL) agents. While building such agents, one needs to balance opposing desiderata, such as constraints on capacity and compute, the ability to not catastrophically forget, and to exhibit positive transfer on new tasks. Understanding the right trade-off is conceptually and computationally challenging, which we argue has led the community to overly focus on catastrophic forgetting. In response to these issues, we advocate for the need to prioritize forward transfer and propose Continual World, a benchmark consisting of realistic and meaningfully diverse robotic tasks built on top of Meta-World $\bar { \mathbb { B } } \bar { \underline { { 4 } } } \mathbb { I }$ as a testbed. Following an in-depth empirical evaluation of existing CL methods, we pinpoint their limitations and highlight unique algorithmic challenges in the RL setting. Our benchmark aims to provide a meaningful and computationally inexpensive challenge for the community and thus help better understand the performance of existing and future solutions. Information about the benchmark, including the open-source code, is available at https://sites.google.com/view/continualworld.
|
| 27 |
+
|
| 28 |
+
# 1 Introduction
|
| 29 |
+
|
| 30 |
+
Change is ubiquitous. Unsurprisingly, due to evolutionary pressure, humans can quickly adapt and creatively reuse their previous experiences. In contrast, although biologically inspired, deep learning (DL) models excel mostly in static domains that satisfy the i.i.d. assumption, as for example in image processing [28, 49, 10, 40], language modelling $| { \bar { \sqrt { 5 2 } } } , { \overline { { \mathbb { 1 1 } } } } | |$ or biological applications [47]. As the systems are scaled up and deployed in open-ended settings, such assumptions are increasingly questionable; imagine, for example, a robot that needs to adapt to the changing environment and the wear-and-tear of its hardware. Continual learning (CL), an area that explicitly focuses on such problems, has been gaining more attention recently. The progress in this area could offer enormous advantages for deep neural networks $\mathbb { \lVert 1 9 \rVert }$ and move the community closer to the long-term goal of building intelligent machines $\mathbb { \ m }$ .
|
| 31 |
+
|
| 32 |
+
Evaluation of CL methods is challenging. Due to the sequential nature of the problem that disallows parallel computation, evaluation tends to be expensive, which has biased the community to focus on toy tasks. These are mostly in the domain of supervised learning, often relying on MNIST. In this work, we expand on previous discussions on the topic [45, 16, 30, 46] and introduce a new benchmark, Continual World. The benchmark is built on realistic robotic manipulation tasks from Meta-World $\pmb { \Vert 5 4 \Vert }$ , benefiting from its diversity but also being computationally cheap. Moreover, we provide shorter auxiliary sequences, all of which enable a quick research cycle. On the conceptual level, a fundamental difficulty of evaluating CL algorithms comes from the different desiderata for a CL solution. These objectives are often opposing each other, forcing practitioners to explicitly or implicitly make trade-offs in their algorithmic design that are data-dependent. Continual World provides more meaningful relationships between tasks, answering recent calls $\mathbb { \lVert 1 9 \rVert }$ to increase attention on forward transfer.
|
| 33 |
+
|
| 34 |
+
Additionally, we provide an extensive evaluation of a spectrum of commonly used CL methods. It highlights that many approaches can deal relatively well with catastrophic forgetting at the expense of other desiderata, in particular forward transfer. This emphasizes our call for focusing on forward transfer and the need for more benchmarks that allow for common structure among the tasks.
|
| 35 |
+
|
| 36 |
+
The main contribution of this work is a CL benchmark that poses optimizing forward transfer as the central goal and shows that existing methods struggle to outperform simple baselines in terms of the forward transfer capability. We release the code2 both for the benchmark and 7 CL methods, which aims to provide the community helpful tools to better understand the performance of existing and future solutions. We encourage to visit the website3 of the project and participate in the Continual World Challenge.
|
| 37 |
+
|
| 38 |
+
# 2 Related work
|
| 39 |
+
|
| 40 |
+
The field of continual learning has grown considerably in the past years, with numerous works forming new subfields $\mathbb { \left[ \left. 2 3 \right] \right. }$ and finding novel applications $\lVert \overline { { 4 8 } } \rVert$ . For brevity, we focus only on the papers proposing RL-based benchmarks and point to selected surveys of the entire field. $\pmb { \mathbb { D } }$ provide a high-level overview of CL and argue that learning in a non-stationary setting is a fundamental problem for the development of AI, highlighting the frequent connections to neuroscience. On the other hand, $\mathbb { B } 3 \mathbb { B }$ focus on describing, evaluating, and relating CL methods to each other, providing a taxonomy of CL solutions that we use in this work.
|
| 41 |
+
|
| 42 |
+
The possibility of applying CL methods in reinforcement learning scenarios has been explored for a long time, see $[ [ 2 5 ] ]$ for a recent review. However, no benchmark has been widely accepted by the community so far, which is the aim of this work. Below we discuss various benchmarks and environments considered in the literature.
|
| 43 |
+
|
| 44 |
+
Supervised settings MNIST has been widely used to benchmark CL algorithms in two forms $ { \mathbb { \left[ \left[ 2 7 \right] \right] } }$ . In the permuted MNIST, the pixels of images are randomly permuted to form new tasks. In the split MNIST, tasks are defined by classifying non-overlapping subsets of classes, e.g. 0 vs. 1 followed by 2 vs. 3. A similar procedure has been applied to various image classification tasks like CIFAR-10, CIFAR-100, Omniglot or mini-ImageNet [2, 46, 5]. Another benchmark is CORe50 [31], a dataset for continuous object recognition. Recent work $\mathbb { \left. 2 9 \right. }$ proposes a benchmark based on language modeling. We find that many of these benchmarks are challenging and allow to measure forgetting. However, we argue they are not geared towards measuring forward transfer or for highlighting important RL-specific characteristics of the CL problem.
|
| 45 |
+
|
| 46 |
+
Atari The Atari 2600 suite $\textcircled { 8 }$ is a widely accepted RL benchmark. Sequences of different Atari games have been used for evaluating continual learning approaches [43, 27]. Using Atari can be computationally expensive, e.g., training a sequence of ten games typically requires 100M steps or more. More importantly, as $\mathbb { \lVert \boldsymbol { 4 3 } \rVert }$ notes, these games lack a meaningful overlap, limiting their relevance for studying transfers. Continuous control [32, 24] use continuous control tasks such as Humanoid or Walker2D. However, the considered sequences are short, and the range of experiments is limited. [34] use Meta-World tasks, similarly to us, for evaluations of their continual learning method, but the work is not aimed at building a benchmark. As such, it uses the Meta-World’s MT10 preset and does not provide an in-depth analysis of the tasks or other CL methods. Maze navigation A set of 3D maze environments is used in [43]. The map structure and objects that the agent needs to collect change between tasks. It is not clear, though, if the tasks provide enough diversity. [30] propose CRLMaze, 3D navigation scenarios for continual learning, which solely concentrate on changes of the visual aspects. StarCraft $\lVert \rVert \dot { \boldsymbol { \mathrm { ~ ‰ ~ } } }$ present a StarCraft campaign (11 tasks) to evaluate a high-level transfer of skills. The main drawback of this benchmark is excessive computational demand (often more than 1B frames). Minecraft $\mathbb { \left[ \left. 5 0 \right| \right. }$ propose simple scenarios within the Minecraft domain along with a hierarchical learning method. The authors phrase the problem as lifelong learning and do not use typical CL methods. Lifelong Hanabi $\lVert \rVert$ consider a multi-agent reinforcement learning setting based on Hanabi, a cooperative game requiring significant coordination between agents. On the other hand, we focus on the single agent setting with changing environment, which allows us to bypass the computational complexity needed to model interactions between agents and highlight issues connected to learning in a changing world. Causal World $\pmb { \mathbb { B } } \|$ propose an environment for robotic manipulation tasks which share causal structure. Although they investigate issues deeply connected to learning in a changing world, such as generalization to new tasks and curricula, they do not directly consider continual learning. Jelly Bean World $\mathbb { B } 9 \mathbb { I }$ provide interesting procedurally generated grid world environments. The suite is configurable and can host a non-stationary setting. It is unclear, however, if such environments reflect the characteristics of real-world challenges.
|
| 47 |
+
|
| 48 |
+
# 3 Continual learning background
|
| 49 |
+
|
| 50 |
+
Continual learning (CL) is an area of research which focuses on building algorithms capable of handling non-stationarity. They should be able to sequentially acquire new skills and solve novel tasks without forgetting the previous ones. Such systems are desired to accommodate over extended periods swiftly, which is often compared to human capabilities and alternatively dubbed as lifelong learning. CL is intimately related to multi-task learning, curriculum learning, meta-learning, with some key differences. Multi-task assumes constant access to all tasks, thus ignoring non-stationarity. Curriculum learning focuses on controlling the task ordering and often the learning time-span. Metalearning, a large field of its own, sets the objective to develop procedures that allow fast adaptation within a task distribution and usually ignores the issue of non-stationarity.
|
| 51 |
+
|
| 52 |
+
The CL objective is operationalized by the training and evaluation protocols. The former typically consists of a sequence of tasks (their boundaries might be implicit and smooth). The latter usually involves measuring catastrophic forgetting, forward transfer, and backward transfer. The learning system might also have constrained resources: computations, memory, size of neural networks, and the volume of data samples. A fundamental observation is that the above aspects and desiderata are conflicting. For example, given unlimited resources, one might mitigate forgetting simply by storing everything in memory and paying a high computational cost of rehearsing all samples from the past.
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 1: Left graph shows task PEG-UNPLUG-SIDEV1 and the right graph presents forward transfer from SHELF-PLACE-V1 to PEG-UNPLUG-SIDE-V1. In this case $F T = 0 . 1 0$ .
|
| 56 |
+
|
| 57 |
+
Another pair of objectives that are problematic for current methods are forgetting and forward transfer. For neural networks, existing methods propose to limit network plasticity. These alleviate the problem of forgetting, however, at the cost of choking the further learning process. We advocate for more nuanced approaches. Importantly, to make the transfer possible, our benchmark is composed of related tasks. We also put modest bounds on resources. This requirement is in line with realistic scenarios, demanding computationally efficient adaptation and inference. In a broader sense, we hope to address a data efficiency challenge, one of the most signif
|
| 58 |
+
|
| 59 |
+
icant limitations of the current deep (reinforcement) learning methods. We conjecture that forward transfer might greatly improve the situation and possibly one day enable us to create systems with human-level cognition capabilities, in line with similar thoughts expressed in [19].
|
| 60 |
+
|
| 61 |
+
# 4 Continual World benchmark
|
| 62 |
+
|
| 63 |
+
Continual World is a new benchmark designed to be a testbed for evaluating RL agents on the challenges advocated by the CL paradigm, described in Section $^ { 3 , }$ as well as highlighting the RLspecific algorithmic challenges for CL (see Section $\boxed { 6 . 1 }$ . As such it is aimed at being valuable to both the CL and RL communities. Continual World consists of realistic robotic manipulation tasks, aligned in a sequence to enable the study of forward transfer. It is designed to be challenging while computationally accessible.4 The benchmark is based on Meta-World, a suite of robotic tasks already established in the community. This enables easy comparisons with the related fields of multi-task and meta-learning reinforcement learning, potentially highlighting one benefit of CL framing, namely that of dealing with different reward scales as we discuss more in detail in Appendix $\mathrm { H } .$ Continual World comes with open-source code that allows for easy development and testing of new algorithms and provides implementations of 7 existing algorithms. Finally, it allows highlighting RL-specific challenges for the CL setting. We believe that our work is a step in the right direction towards reliable benchmarks of CL. We realize, however, that it will need to evolve as the field progresses. We leave a discussion on future directions and limitations to Section 4.4.
|
| 64 |
+
|
| 65 |
+
# 4.1 Metrics
|
| 66 |
+
|
| 67 |
+
To facilitate further discussion, we start with defining metrics. These are rather standard in the CL setting $\mathbb { H } 2 \mathbb { I }$ . Assume $p _ { i } ( t ) \in [ 0 , 1 ]$ to be the performance (success rate) of task $i$ at time $t$ . As a measure of performance, we take the average success rate of achieving a goal specified by a given task when using randomized initial conditions and stochastic policies (see also Section $4 . { \overset { - } { 3 } } ) . { \overset { 5 } { . } } { \overset { . } { } }$ Each task is trained for $\Delta = 1 M$ steps. The main sequence has $N = 2 0$ tasks and the total sample budget is $T = N \cdot \Delta = 2 0 M$ . The $i$ -th task is trained during the interval $t \in [ ( i - 1 ) \cdot \Delta , i \cdot \Delta ]$ . We report the following metrics:
|
| 68 |
+
|
| 69 |
+
Average performance. The average performance at time $t$ is (see Figure 3)
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\mathsf { P } ( t ) : = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } p _ { i } ( t ) .
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
Its final value, $\mathrm { P } ( { \cal T } )$ , is a traditional metric used in the CL research. This is the objective we use for tuning hyperparameters. We have $\mathbf { P } ( t ) \in [ 0 , 1 ]$ for each $t$ .
|
| 76 |
+
|
| 77 |
+
Forward transfer. We measure the forward transfer of a method as the normalized area between its training curve and the training curve of the reference, single-task, experiment, see Figure $1 .$ Let $p _ { i } ^ { b } \in [ 0 , 1 ]$ be the reference performance6 then the forward transfer for the task $i$ , denoted by $\bar { \mathsf { F T } } _ { i }$ , is
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathsf { F T } _ { i } : = \frac { \mathsf { A U C } _ { i } - \mathsf { A U C } _ { i } ^ { b } } { 1 - \mathsf { A U C } _ { i } ^ { b } } , \quad \mathsf { A U C } _ { i } : = \frac { 1 } { \Delta } \int _ { ( i - 1 ) \cdot \Delta } ^ { i \cdot \Delta } p _ { i } ( t ) \mathrm { d } t , \quad \mathsf { A U C } _ { i } ^ { b } : = \frac { 1 } { \Delta } \int _ { 0 } ^ { \Delta } p _ { i } ^ { b } ( t ) \mathrm { d } t ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
The average forward transfer for all tasks, FT, is defined as
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mathrm { F T } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathrm { F T } _ { i } .
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
We note that $\mathrm { F T } _ { i } \leq 1$ and they might be negative. In our experiments, we also measure backward transfer. As it is negligible, see Appendix E.1.
|
| 90 |
+
|
| 91 |
+
Forgetting. For task $i$ , we measure the decrease of performance after ending its training, i.e.
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
F _ { i } = p _ { i } ( i \cdot \Delta \bar { \Delta } ) - p _ { i } ( T ) .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
Similarly to FT e report $\begin{array} { r } { F = { \frac { 1 } { N } } \sum _ { i = 1 } ^ { N } F _ { i } } \end{array}$ . We have $F _ { i } \leq 1$ for any $i$ and consequently $\mathrm { F T } \leq 1$ . It $F _ { i }$ are negative, which would indicate backward transfer. We do not observe this in practice, see Appendix E.1.
|
| 98 |
+
|
| 99 |
+
# 4.2 Continual World tasks
|
| 100 |
+
|
| 101 |
+
This section describes the composition of Continual World benchmark and the rationale behind its design. We decided to base on Meta-World [54], a fairly new but already established robotic benchmark for multi-task and meta reinforcement learning. From a practical standpoint, Meta-World utilizes the open-source MuJoCo physics engine [51], prized for speed and accuracy. Meta-World provides 50 distinct manipulation tasks with everyday objects using a simulated robotic Sawyer arm. Although the tasks vary significantly, the structure and semantics of observation and action spaces remain the same, allowing for transfer between tasks. Each observation is a 12-dimensional vector containing $( x , y , z )$ coordinates of the robot’s gripper and objects of interest in the scene. The 4-dimensional action space describes the direction of the arm’s movement in the next step and the gripper actuator delta. Reward functions are shaped to make each task solvable. In evaluations, we use a binary success metric based on the distance of the task-relevant object to its goal position. This metric is interpretable and enables comparisons between tasks. For more details about the rewards and evaluation metrics, see [54, Section 4.2, Section 4.3].
|
| 102 |
+
|
| 103 |
+
CW20, CW10, triplets sequences The core of our benchmark is CW20 sequence. Out of 50 tasks defined in Meta-World, we picked those that are not too easy or too hard in the assumed sample budget $\Delta = 1 M$ . Aiming to strike a balance between the difficulty of the benchmark and computational requirements, we selected 10 tasks. The tasks and their ordering were based on the transfer matrix (see the next paragraph), so that there is a high variation of forward transfers (both in the whole list and locally). We refer to these ordered tasks as CW10, and CW20 is CW10 repeated twice. We recommend using CW20 for final evaluation; however, CW10 is already very informative in most cases. Due to brevity constraints, we present an ablation with an alternative ordering of the tasks and a longer sequence of 30 tasks in Appendix $\mathbf { G } ,$ however, these experiments do not alter our findings. Additionally, to facilitate a fast development cycle, we propose a set of triplets, sequences of three tasks which exhibit interesting learning dynamics.
|
| 104 |
+
|
| 105 |
+
The CW10 sequence is: HAMMER-V1, PUSH-WALL-V1, FAUCET-CLOSE-V1, PUSH-BACK-V1, STICK-PULLV1, HANDLE-PRESS-SIDE-V1, PUSH-V1, SHELF-PLACE-V1, WINDOW-CLOSE-V1, PEG-UNPLUG-SIDE-V1.
|
| 106 |
+
|
| 107 |
+
Transfer matrix Generally, the relationship between tasks and its impact on learning dynamics of neural networks is hard to quantify, where semantic similarity does not typically lead to transfer $\textcircled { 1 1 4 } \textcircled { 1 }$ . To this end, we consider a minimal setting, in which we finetune on task $t _ { 2 }$ a model pretrained on $t _ { 1 }$ , using the same protocol as the benchmark (e.g., different output heads, see Section $\boxed { 4 . 3 }$ . This provides neural network-centric insight into the relationship between tasks summarized in Figure $\bar { \bigtriangledown } ,$ and allows us to measure low-level transfer between tasks, i.e., the ability of the model to reuse previously acquired features. See Appendix D for more results and extended discussion.
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 2: Transfer matrix, see Section $4 . 2 \cdot$ Each cell represents the forward transfer from the first task to the second one. We shaded the cells for which 0 belongs to their $9 0 \%$ confidence interval.
|
| 111 |
+
|
| 112 |
+
Notice that there are only a few negative forward transfer cases, and those are of a rather small magnitude (perhaps unsurprisingly, as the tasks are related). There are also visible patterns in the matrix. For instance, some tasks such as PEGUNPLUG-SIDE-V1 or PUSH-BACK-V1 benefit from a relatively large forward transfer, (almost) irrespective of the first task. Furthermore, the average forward transfer given the second task (columns) is more variable than the corresponding quantity for the first task (rows).
|
| 113 |
+
|
| 114 |
+
Note that some transfers on the diagonal (i.e., between the same tasks) are relatively small. We made a detailed analysis of possible reasons, which revealed that the biggest negative impact is due to the replay buffer resets, which seems, however, unavoidable for off-diagonal cases, see Section $6 . 1$ for details.
|
| 115 |
+
|
| 116 |
+
Importantly, we use this matrix to estimate what level of forward transfer a good CL method
|
| 117 |
+
|
| 118 |
+
should be able to achieve. We expect that a model which is able to remember all meaningful aspects of previously seen tasks would transfer at least as well as if one were just fine-tuning after learning the best choice between the previous tasks. For a sequence $t _ { 1 } , \ldots , t _ { N }$ we set the reference forward transfer, RT, to be
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\mathrm { R T } : = \frac { 1 } { N } \sum _ { i = 2 } ^ { N } \operatorname* { m a x } _ { j < i } \mathrm { F T } ( t _ { j } , t _ { i } ) ,
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
where $\mathrm { F T } ( t _ { j } , t _ { i } )$ is the transfer matrix value for $t _ { j } , t _ { i }$ . For the CW20 sequence, the value is $\mathrm { R T } = 0 . 4 6$ Note that a model can do better that this by composing knowledge from multiple previous tasks.
|
| 125 |
+
|
| 126 |
+
# 4.3 Training and evaluation details
|
| 127 |
+
|
| 128 |
+
We adapt the standard Meta-World setting to CL needs. First, we use separate policy heads for each task, instead of the original one-hot task ID inputs (we provide ablation experiments for this choice in Appendix $\mathbf { G } )$ . Second, in each episode, we randomize the positions of objects in the scene to encourage learning more robust policies. We use an MLP network with 4 layers of 256 neurons.
|
| 129 |
+
|
| 130 |
+
For training, we use soft actor-critic (SAC) [17], a popular and efficient RL method for continuous domains. SAC is an off-policy algorithm using replay buffer, which is an important aspect for CL, particularly for methods relying on rehearsing old trajectories. SAC is based on the so-called maximum entropy principle; this results in policies which explore better and are more robust to changes in the environment dynamics. Both of these qualities might be beneficial in CL.
|
| 131 |
+
|
| 132 |
+
We note that the size of the neural network and optimization details of the SAC algorithm (like batch size) put constraints on "the amount of compute". Intentionally, these are rather modest, which is in line with CL desiderata, see Section $3 .$ Similarly, we limit the number of timesteps to $1 M$ , which is a humble amount for modern-day deep reinforcement learning. We picked tasks to be challenging but not impossible within this budget. We note that training in the RL setting tends to be less stable than in the supervised one. We recommend using multiple seeds, in our experiments, we typically used 20 and calculate confidence intervals; we used the bootstrap method. We choose hyperparameters that maximize average performance $\mathbb { \underline { { \left( 1 \right) } } }$ . In our experiments, we tune common parameters for SAC and the method-specific hyperparameters separately. All details of the training and evaluation setup are presented in Appendix A.
|
| 133 |
+
|
| 134 |
+
# 4.4 Limitations of Continual World
|
| 135 |
+
|
| 136 |
+
As any benchmark, we are fully aware that ours will not cover the entire spectrum of problems that one might be interested in. Here we summarize a few limitations that we hope to overcome in a future instantiation of this benchmark:
|
| 137 |
+
|
| 138 |
+
Input space We use a small 12 dimensional observation space. This is key to achieve modest computational demand. However, richer inputs could allow for potentially more interesting forms of transfer (e.g., based on visual similarity of objects) and would allow inferring the task from the observation, which is currently impossible.
|
| 139 |
+
|
| 140 |
+
Reliance on SAC We use the SAC algorithm $\textcircled { 1 1 7 }$ , which is considered a standard choice for continuous robotic tasks. However, there is a potential risk of overfitting to the particularities of this algorithm and exploring alternative RL algorithms is important.
|
| 141 |
+
|
| 142 |
+
Task boundaries We rely on task boundaries. One can rely on task inference mechanisms (e.g. [35, 41]) to resolve this limitation, though we acknowledge the importance to extend the benchmark towards allowing and testing for task inference capabilities. Also, testing for algorithms dealing with continuous distributional drift is not possible in the current format.
|
| 143 |
+
|
| 144 |
+
Output heads We rely on using a separate head for each new task, similar to many works on continual learning. We opt for this variant based on its simplicity and better performance than using one-hot encoding to indicate a task. We believe that the lack of semantics of the one-hot encoding would further impede transfer, as the relationship between tasks can not be inferred. We carry ablation studies with using one-hot encoding as an input and a single head architecture, a setting that is already compatible with our benchmark. We regard this aspect as an important future work, and in particular, we are exploring alternative encoding of input to make this choice more natural. A coherent domain, like Continual World, provides a unique opportunity to exploit a consistent output layer as its semantics does not change between tasks.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 3: Training curves for selected CL methods and multi-task. The upper left panel shows the performance on the first task for a subset of methods throughout the whole training. Note that due to the use of different output heads, we do not see a second bump when revisiting this task at time $1 0 M$ . The upper right panel shows the performance on the current task being trained for EWC compared to a reference (a model learning only that task from scratch). The bottom plot shows the average performance. Solid lines show the performance of the model training on the first 10 tasks (where 1 means being able to solve all of them). Dashed lines show the performance of learning the same tasks in the second half of the benchmark. Note that dashed lower are below solid ones, indicating lower performance on the second pass, even if the agent has already previously learned the tasks and has access to relevant features.
|
| 148 |
+
|
| 149 |
+
The difficulty and number of tasks The number of tasks is relatively small. CW20, the main sequence we use, consists of only 10 different tasks, which are then repeated. We believe the repetition of tasks is important for a CL benchmark, leading to interesting observations. We check also that results are quantitatively similar on a sequence of 30 tasks, see Appendix G. However, longer sequences, potentially unbounded, are needed to understand the various limitations of existing algorithms. For example, the importance of graceful forgetting or dealing with systems that run out of capacity, a scenario where there is no multi-task solution for the sequence of observed tasks. This is particularly of interest for methods such as PackNet $\pmb { \mathbb { B 3 } }$ . Additionally, we provide the number of tasks in advance. Dealing with an unknown number of tasks might raise further interesting questions. Finally, in future iterations of the benchmark, it is important to consider more complex tasks or more complex relationships between tasks to remain a challenge to existing methods. Our goal was to provide a benchmark that is approachable by existing methods, as not to stifle progress.
|
| 150 |
+
|
| 151 |
+
Low-level transfer We focus on low-level transfers via neural network features and weights. As such, we do not explicitly explore the ability of the learning process to exploit the compositionality of behavior or to rely on a more interesting semantic level. While we believe such research is crucial, we argue that solving low-level transfer is equally important and might be a prerequisite. So, for now, it is beyond the scope of this work, though future iterations of the benchmark could contain such scenarios.
|
| 152 |
+
|
| 153 |
+
# 5 Methods
|
| 154 |
+
|
| 155 |
+
We now sketch 7 CL methods evaluated on our benchmark. Some of them were developed for RL, while others were meant for the supervised learning context and required non-trivial adaptation. We aimed to cover different families of methods; following $\mathbb { \lVert \rVert 3 \rVert }$ , we consider three classes: regularizationbased, parameter isolation and replay methods. An extended description and discussion of these methods are provided in Appendix B.
|
| 156 |
+
|
| 157 |
+
Regularization-based Methods This family builds on the observation that one can reduce forgetting by protecting parameters that are important for the previous tasks. The most basic approach often dubbed L2 $ { \mathbb { \left[ \left[ 2 7 \right] \right] } }$ simply adds a $L _ { 2 }$ penalty, which regularizes the network not to stray away from the previously learned weights. In this approach, each parameter is equally important. Elastic Weight Consolidation (EWC) $\overline { { \mathbb { R } \mathbb { Z } \mathbb { I } } }$ uses the Fisher information matrix to approximate the importance of each weight. Memory-Aware Synapses (MAS) [4] also utilizes a weighted penalty, but the importance is obtained by approximating the impact each parameter has on the output of the network. Variational Continual Learning (VCL), follows a similar path but uses variational inference to minimize the Kullback-Leibler divergence between the current distribution of parameters (posterior) and the distribution for the previous tasks (prior).
|
| 158 |
+
|
| 159 |
+
Parameter Isolation Methods This family (also called modularity-based) forbids any changes to parameters that are important for the previous tasks. It may be considered as a “hard” equivalent of regularization-based methods. PackNet [33] “packs” multiple tasks into a single network by iteratively pruning, freezing, and retraining parts of the network at task change. PackNet is closely related to progressive neural networks [43], developed in the RL context.
|
| 160 |
+
|
| 161 |
+
Replay Methods Methods of this family keep some samples from the previous tasks and use them for training or as constraints to reduce forgetting. We use a Perfect Memory baseline, a modification of our setting which remembers all the samples from the past (i.e., without resetting the buffer at the task change). We also implemented Averaged Gradient Episodic Memory (A-GEM) [12], which projects gradients from new samples as to not interfere with previous tasks. We find that A-GEM does not perform well on our benchmark.
|
| 162 |
+
|
| 163 |
+
Multi-task learning In multi-task learning, a field closely related to CL, tasks are trained simultaneously. By its design, it does not suffer from forgetting, however, it is considered to be hard as multiple tasks “compete for the attention of a single learning system”, see [21, 44]. We find that using reward normalization as in PopArt $\left[ \left[ 2 1 \right] \right]$ is essential to achieve good performance. See Appendix H.
|
| 164 |
+
|
| 165 |
+
# 6 Experiments
|
| 166 |
+
|
| 167 |
+
Now we present empirical results; these are evaluations of a set of 7 representative CL methods (as described in Section $\textcircled{5}$ on our Continual World benchmark. We focus on forgetting and transfers while keeping fixed constraints on computation, memory, number of samples, and neural network architecture. Our main empirical contributions are experiments on the long CW20 sequence and following high-level conclusions. For a summary see Table 1, Figure 3 and for an extensive discussion, we refer to Appendix $\boxed { \mathrm { E } }$ (including results for the shorter sequence, CW10). In Appendix G we provide various ablations and detailed analysis of sensitivity to the CL-specific hyperparameters.
|
| 168 |
+
|
| 169 |
+
Performance The performance (success rate) averaged over tasks (eq. $\mathbb { \underline { { ( 1 ) } } }$ ) is a typical metric for the CL setting. PackNet seems to outperform other methods, approaching 0.8 from the maximum of 1.0, outperforming multi-task solutions which might struggle with different reward scales, a problem elegantly avoided in the CL framing. Other methods perform considerably worse. A-GEM and Perfect Memory struggle. We further discuss possible reasons in Sectio n 6.1.
|
| 170 |
+
|
| 171 |
+
Table 1: Results on CW20, for CL methods and multi-task training. Metrics are defined in Section 4.1, RT is eq. $( 4 )$ . We used 20 seeds and provide $90 \%$ confidence intervals.
|
| 172 |
+
|
| 173 |
+
<table><tr><td>method</td><td>performance</td><td>forgetting</td><td>f. transfer</td></tr><tr><td>Fine-tuning</td><td>0.05 [0.05,0.06]</td><td>0.73 [0.72, 0.75]</td><td>0.20 [0.17, 0.23]</td></tr><tr><td>L2</td><td>0.43 [0.39, 0.47]</td><td>0.02 [0.00, 0.03]</td><td>-0.71 [-0.87, -0.57]</td></tr><tr><td>EWC</td><td>0.60 [0.57, 0.64]</td><td>0.02 [-0.00, 0.05]</td><td>-0.17 [-0.24, -0.11]</td></tr><tr><td>MAS</td><td>0.51 [0.49, 0.53]</td><td>0.00 [-0.01,0.02]</td><td>-0.52 [-0.59,-0.47]</td></tr><tr><td>VCL</td><td>0.48 [0.46,0.50]</td><td>0.01 [-0.01, 0.02]</td><td>-0.49 [-0.57,-0.42]</td></tr><tr><td>PackNet</td><td>0.80 [0.79, 0.82]</td><td>0.00 [-0.01,0.01]</td><td>0.19 [0.15, 0.23]</td></tr><tr><td>Perfect Memory</td><td>0.12 [0.09, 0.15]</td><td>0.07 [0.05,0.10]</td><td>-1.34 [-1.42, -1.27]</td></tr><tr><td>A-GEM</td><td>0.07 [0.06,0.08]</td><td>0.71 [0.70,0.73]</td><td>0.13 [0.10,0.16]</td></tr><tr><td>MT</td><td>0.51 [0.48, 0.53]</td><td></td><td></td></tr><tr><td>MT (PopArt)</td><td>0.65 [0.63, 0.67]</td><td></td><td></td></tr><tr><td>RT</td><td></td><td></td><td>0.46</td></tr></table>
|
| 174 |
+
|
| 175 |
+
Forgetting We observe that
|
| 176 |
+
|
| 177 |
+
most CL methods are usually efficient in mitigating forgetting. However, we did not notice any boost when revisiting a task (see Figure $3 )$ . Even if a different output head was employed, relearning the internal representation should have had an impact unless it changed considerably when revisiting the task. Additionally, we found A-GEM difficult to tune; consequently, with the best hyperparameter settings, it is relatively similar to the baseline fine-tuning method (see details in Appendix $\bigtriangledown$
|
| 178 |
+
|
| 179 |
+
Transfers For all methods, forward transfer for the second ten tasks (and the same tasks are revisited) drops compared to the first ten tasks. This is in stark contrast to forgetting, which seems to be well under control. Among all methods, only fine-tuning and PackNet are able to achieve positive forward transfer (0.20 and 0.19, resp.) as well as on the first (0.32 and 0.21, resp.) and the second (0.08 and 0.17, resp.) half of tasks. However, these are considerably smaller than $\mathrm { R T } = 0 . 4 6$ , which in principle can even be exceeded, and which should be reached by a model that remembers all meaningful aspects of previously seen tasks, see $\textcircled{4}$ . These results paint a fairly grim picture: we would expect improvement, rather than deterioration in performance, when revisiting previously seen tasks. There could be multiple reasons for this state of affairs. It could be attributed to the loss of plasticity, similar to the effect observed in $\textcircled { 6 }$ . Another reason could be related to the interference between CL mechanisms or setting and RL, for instance, hindering exploration. We did not observe any substantial cases of backward transfer, even though the benchmark is well suited to study this question due to the revisiting of tasks. See Appendix E.1.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 4: How forgetting impacts the forward transfer. Two different triplets of tasks learnt in sequence. An ideal agent learning on a sequence $A B C$ should have at least as good performance on task $C$ as an agent which just learns $A C$ . In reality, an interfering task $B$ reduces this transfer, even when continual learning approaches are used.
|
| 183 |
+
|
| 184 |
+
Triplets experiments We illustrate how forgetting and forward transfer interact with each other in a simpler setting of three task sequences, see Figure $\boxed { \ 4 }$ and Appendix $\boxed { \mathrm { F } }$ We focus on sequences of tasks $A $ $B C$ , where $A \ \ C$ has significant positive forward transfer and $B C$ has a smaller or even negative transfer. An efficient CL agent should be able to use information from $A$ to get good performance on $C$ . However, interference introduced by $B$ reduces the fi
|
| 185 |
+
|
| 186 |
+
nal forward transfer (see Figure $^ { 4 ) }$ . The drive for reducing forgetting in CL agents has been primarily to perform well on previous tasks when we revisit them. With this example, we argue that an equally important reason to improve the memory of CL agents is to efficiently use past experiences to learn faster on new tasks. Currently, the tested CL methods often are not able to outperform the forgetful fine-tuning baseline. Observe that even the modularity-based PackNet approach struggles with this task. This possibly indicates that using the activation mask from task $B$ is enough to deteriorate the performance.
|
| 187 |
+
|
| 188 |
+
PackNet PackNet stands out in our evaluations. We conjecture that developing related methods might be a promising research direction. Besides further increasing performance, one could mitigate the limitations of PackNet. PackNet relies on knowing task identity during evaluation. While this assumption is met in our benchmark, it is an interesting topic for future research to develop methods that cope without task identity. Another nuisance is that PackNet assigns some fixed fraction of parameters to a task. This necessitates knowledge of the length of the sequence in advance. Additionally, when the second ten tasks of CW20 start, PackNet performance degrades, showing its potentially inefficient use of capacity and past knowledge, given that the second ten tasks are identical with the first ten and hence no additional capacity is needed. In a broader context, we speculate that parameter isolation methods might be a promising direction towards better CL methods.
|
| 189 |
+
|
| 190 |
+
Resources usage In practical applications it is important to consider resources usage. All tested methods have relatively small overheads. For example, PackNet needs only $1 5 \%$ more time than the baseline fine-tuning and it requires $5 0 \%$ more neural network parameters (which is negligible when small networks like ours). See Appendix $\underline { { \mathbf { B . 4 } } }$ for details concerning other methods.
|
| 191 |
+
|
| 192 |
+
Other observations In stark contrast with the supervised learning setting, we found that replay based methods (Perfect Memory and A-GEM) suffer from poor performance. This is even though we allow for a generous replay, which could store the whole experience. Explaining and amending this situation is, in our view, an important research question. We conjecture that this happens due to the regularization of the critic network (which was unavoidable for these methods). We found multi-task learning attaining lower scores than PackNet, the best CL method and comparable to the second one, EWC. We think this suggests interesting research directions for multi-task learning.
|
| 193 |
+
|
| 194 |
+
# 6.1 RL-Related Challenges
|
| 195 |
+
|
| 196 |
+
Reinforcement learning brings a set of issues not present in the supervised learning setting, e.g., exploration, varying reward scales, and stochasticity of environments. We argue that it is imperative to have a reliable benchmark to assess the efficiency of CL algorithms with respect to these problems. We find that some current methods are not well adjusted to the RL setting and require non-trivial conceptual considerations and careful tuning of hyperparameters, see details in Appendix C.
|
| 197 |
+
|
| 198 |
+
An important design choice is whether or not to regularize the critic in the actor-critic framework (e.g. in SAC). We find it beneficial to focus on reducing forgetting in the actor while allowing the critic to freely adapt to the current task (note that critic is used only in training of the current task), similar to $\dot { \lVert \ 4 6 \rVert }$ . On the other hand, a forgetful critic is controversial. This can be sharply seen when the same task is repeated and the critic needs to learn from scratch. Additionally, not all methods can be trivially adapted to the ’actor-only regularization’ setting, as for example replay based methods. In Appendix $\mathrm { \Delta C }$ we examine these issues empirically, by showing experiments with critic regularization for EWC.
|
| 199 |
+
|
| 200 |
+
Another aspect is the exploration and its non-trivial impact on transfers. As it was observed, transfers from a given task to the same one are sometimes poor. We show in Appendix $\textstyle \boxed { \mathrm { D . 1 } }$ that this results from the fact that at the task change the replay buffer is emptied and SAC collects new samples from scratch, usually by using the uniform policy. Learning on these random samples reduces performance on the current task and thus the forward transfer. Experimentally, we find that not resetting the buffer or using the current policy for exploration improves the transfer on the diagonal.
|
| 201 |
+
|
| 202 |
+
# 7 Conclusions and Future Work
|
| 203 |
+
|
| 204 |
+
In this work, we present Continual World, a continual reinforcement learning benchmark, and an in-depth analysis of how existing methods perform on it. The benchmark is aimed at facilitating and standardizing the CL system evaluation, and as such, is released with code, including implementation of 7 representative CL algorithms. We argue for more attention to forward transfer and the interaction between forgetting and transfer, as many existing methods seem to sacrifice transfer to alleviate forgetting. In our opinion, this should not be the aim of CL, and we need to strike a different balance between these objectives.
|
| 205 |
+
|
| 206 |
+
We made several observations, both conceptual and empirical, which open future research directions. In particular, we conjecture that parameter isolation methods are a promising direction. Further, we identified a set of critical issues at the intersection of RL and CL. Resolving critic regularization and efficient use of multi-task replays seem to be the most pressing ones. Our benchmark highlights some challenges, which in our view are relevant and tangible now. In the long horizon, achieving high-level transfers, removing task boundaries, and scaling up are among significant goals for future editions of Continual World. Our work is foundational research and does not lead to any direct negative applications.
|
| 207 |
+
|
| 208 |
+
# Acknowledgments and Disclosure of Funding
|
| 209 |
+
|
| 210 |
+
We would like to thank Stanisław Jastrz˛ebski for stimulating talks and help while preparing the manuscript. The work of PM was supported by the Polish National Science Center grant UMO2017/26/E/ST6/00622. The work of MW was funded by Foundation for Polish Science (grant no POIR.04.04.00-00-14DE/18-00 carried out within the Team-Net program co-financed by the European Union under the European Regional Development Fund. This research was supported by the PL-Grid Infrastructure. Our experiments were managed using https://neptune.ai. We would like to thank the Neptune team for providing us access to the team version and technical support.
|
| 211 |
+
|
| 212 |
+
# References
|
| 213 |
+
|
| 214 |
+
[1] Joshua Achiam. Spinning Up in Deep Reinforcement Learning. 2018.
|
| 215 |
+
|
| 216 |
+
[2] Tameem Adel, Han Zhao, and Richard E. Turner. Continual learning with adaptive weights (CLAW). In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 217 |
+
|
| 218 |
+
[3] Ossama Ahmed, Frederik Träuble, Anirudh Goyal, Alexander Neitz, Manuel Wuthrich, Yoshua Bengio, Bernhard Schölkopf, and Stefan Bauer. Causalworld: A robotic manipulation benchmark for causal structure and transfer learning. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021.
|
| 219 |
+
|
| 220 |
+
[4] Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss, editors, Computer Vision - ECCV 2018 - 15th European Conference, Munich, Germany, September 8-14, 2018, Proceedings, Part III, volume 11207 of Lecture Notes in Computer Science, pages 144–161. Springer, 2018.
|
| 221 |
+
|
| 222 |
+
[5] Rahaf Aljundi, Eugene Belilovsky, Tinne Tuytelaars, Laurent Charlin, Massimo Caccia, Min Lin, and Lucas Page-Caccia. Online continual learning with maximal interfered retrieval. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d’Alché-Buc, Emily B. Fox, and Roman Garnett, editors, Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 11849–11860, 2019.
|
| 223 |
+
|
| 224 |
+
[6] Jordan T. Ash and Ryan P. Adams. On warm-starting neural network training. In Hugo Larochelle, Marc’Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 225 |
+
|
| 226 |
+
[7] Lei Jimmy Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. CoRR, abs/1607.06450, 2016.
|
| 227 |
+
|
| 228 |
+
[8] M. G. Bellemare, Y. Naddaf, J. Veness, and M. Bowling. The arcade learning environment: An evaluation platform for general agents. Journal of Artificial Intelligence Research, 47:253–279, jun 2013.
|
| 229 |
+
|
| 230 |
+
[9] Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural network. In Francis R. Bach and David M. Blei, editors, Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, volume 37 of JMLR Workshop and Conference Proceedings, pages 1613–1622. JMLR.org, 2015.
|
| 231 |
+
|
| 232 |
+
[10] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019.
|
| 233 |
+
|
| 234 |
+
[11] Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In Hugo Larochelle, Marc’Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 235 |
+
|
| 236 |
+
[12] Arslan Chaudhry, Marc’Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with A-GEM. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019.
|
| 237 |
+
|
| 238 |
+
[13] Matthias De Lange, Rahaf Aljundi, Marc Masana, Sarah Parisot, Xu Jia, Ales Leonardis, Gregory Slabaugh, and Tinne Tuytelaars. A continual learning survey: Defying forgetting in classification tasks. arXiv preprint arXiv:1909.08383, 2019.
|
| 239 |
+
|
| 240 |
+
[14] Yunshu Du, Wojciech M. Czarnecki, Siddhant M. Jayakumar, Razvan Pascanu, and Balaji Lakshminarayanan. Adapting auxiliary losses using gradient similarity. CoRR, abs/1812.02224, 2018.
|
| 241 |
+
|
| 242 |
+
[15] Bradley Efron and Robert J Tibshirani. An introduction to the bootstrap. CRC press, 1994.
|
| 243 |
+
|
| 244 |
+
[16] Sebastian Farquhar and Yarin Gal. Towards robust evaluations of continual learning. CoRR, abs/1805.09733, 2018.
|
| 245 |
+
|
| 246 |
+
[17] 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 G. Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmässan, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, pages 1856–1865. PMLR, 2018.
|
| 247 |
+
|
| 248 |
+
[18] Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine. Soft actor-critic algorithms and applications. CoRR, abs/1812.05905, 2018.
|
| 249 |
+
|
| 250 |
+
[19] Raia Hadsell, Dushyant Rao, Andrei A. Rusu, and Razvan Pascanu. Embracing change: Continual learning in deep neural networks. Trends in Cognitive Sciences, 24(12):1028 – 1040, 2020.
|
| 251 |
+
|
| 252 |
+
[20] Demis Hassabis, Dharshan Kumaran, Christopher Summerfield, and Matthew Botvinick. Neuroscience-inspired artificial intelligence. Neuron, 95(2):245 – 258, 2017.
|
| 253 |
+
|
| 254 |
+
[21] Matteo Hessel, Hubert Soyer, Lasse Espeholt, Wojciech Czarnecki, Simon Schmitt, and Hado van Hasselt. Multi-task deep reinforcement learning with popart. In The Thirty-Third AAAI Conference on Artificial Intelligence, AAAI 2019, The Thirty-First Innovative Applications of Artificial Intelligence Conference, IAAI 2019, The Ninth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2019, Honolulu, Hawaii, USA, January 27 - February 1, 2019, pages 3796–3803. AAAI Press, 2019.
|
| 255 |
+
|
| 256 |
+
[22] Ferenc Huszár. Note on the quadratic penalties in elastic weight consolidation. Proceedings of the National Academy of Sciences, page 201717042, 2018.
|
| 257 |
+
|
| 258 |
+
[23] Khurram Javed and Martha White. Meta-learning representations for continual learning. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d’Alché-Buc, Emily B. Fox, and Roman Garnett, editors, Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 1818–1828, 2019.
|
| 259 |
+
|
| 260 |
+
[24] Christos Kaplanis, Murray Shanahan, and Claudia Clopath. Policy consolidation for continual reinforcement learning. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 3242–3251. PMLR, 09–15 Jun 2019.
|
| 261 |
+
|
| 262 |
+
[25] Khimya Khetarpal, Matthew Riemer, Irina Rish, and Doina Precup. Towards continual reinforcement learning: A review and perspectives, 2020.
|
| 263 |
+
|
| 264 |
+
[26] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun, editors, 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015.
|
| 265 |
+
|
| 266 |
+
[27] James Kirkpatrick, Razvan Pascanu, Neil C. Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A. Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, Demis Hassabis, Claudia Clopath, Dharshan Kumaran, and Raia Hadsell. Overcoming catastrophic forgetting in neural networks. CoRR, abs/1612.00796, 2016.
|
| 267 |
+
|
| 268 |
+
[28] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In Peter L. Bartlett, Fernando C. N. Pereira, Christopher J. C. Burges, Léon Bottou, and Kilian Q. Weinberger, editors, Advances in Neural Information Processing Systems 25: 26th Annual Conference on Neural Information Processing Systems 2012. Proceedings of a meeting held December 3-6, 2012, Lake Tahoe, Nevada, United States, pages 1106–1114, 2012.
|
| 269 |
+
|
| 270 |
+
[29] Germán Kruszewski, Ionut-Teodor Sorodoc, and Tomas Mikolov. Evaluating online continual learning with calm, 2021.
|
| 271 |
+
|
| 272 |
+
[30] Vincenzo Lomonaco, Karan Desai, Eugenio Culurciello, and Davide Maltoni. Continual reinforcement learning in 3d non-stationary environments. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR Workshops 2020, Seattle, WA, USA, June 14-19, 2020, pages 999–1008. IEEE, 2020.
|
| 273 |
+
|
| 274 |
+
[31] Vincenzo Lomonaco and Davide Maltoni. Core50: a new dataset and benchmark for continuous object recognition. In 1st Annual Conference on Robot Learning, CoRL 2017, Mountain View, California, USA, November 13-15, 2017, Proceedings, volume 78 of Proceedings of Machine Learning Research, pages 17–26. PMLR, 2017.
|
| 275 |
+
|
| 276 |
+
[32] Kevin Lu, Igor Mordatch, and Pieter Abbeel. Adaptive online planning for continual lifelong learning. CoRR, abs/1912.01188, 2019.
|
| 277 |
+
|
| 278 |
+
[33] Arun Mallya and Svetlana Lazebnik. Packnet: Adding multiple tasks to a single network by iterative pruning. In 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pages 7765–7773. IEEE Computer Society, 2018.
|
| 279 |
+
|
| 280 |
+
[34] Jorge A. Mendez, Boyu Wang, and Eric Eaton. Lifelong policy gradient learning of factored policies for faster training without forgetting. In Hugo Larochelle, Marc’Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 281 |
+
|
| 282 |
+
[35] Kieran Milan, Joel Veness, James Kirkpatrick, Michael H. Bowling, Anna Koop, and Demis Hassabis. The forget-me-not process. In Daniel D. Lee, Masashi Sugiyama, Ulrike von Luxburg, Isabelle Guyon, and Roman Garnett, editors, Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pages 3702–3710, 2016.
|
| 283 |
+
|
| 284 |
+
[36] Hadi Nekoei, Akilesh Badrinaaraayanan, Aaron C. Courville, and Sarath Chandar. Continuous coordination as a realistic scenario for lifelong learning. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pages 8016–8024. PMLR, 2021.
|
| 285 |
+
|
| 286 |
+
[37] Cuong V. Nguyen, Yingzhen Li, Thang D. Bui, and Richard E. Turner. Variational continual learning. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018.
|
| 287 |
+
|
| 288 |
+
[38] German Ignacio Parisi, Ronald Kemker, Jose L. Part, Christopher Kanan, and Stefan Wermter. Continual lifelong learning with neural networks: A review. Neural Networks, 113:54–71, 2019.
|
| 289 |
+
|
| 290 |
+
[39] Emmanouil Antonios Platanios, Abulhair Saparov, and Tom M. Mitchell. Jelly bean world: A testbed for never-ending learning. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 291 |
+
|
| 292 |
+
[40] Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. CoRR, abs/2102.12092, 2021.
|
| 293 |
+
|
| 294 |
+
[41] Dushyant Rao, Francesco Visin, Andrei A. Rusu, Razvan Pascanu, Yee Whye Teh, and Raia Hadsell. Continual unsupervised representation learning. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d’Alché-Buc, Emily B. Fox, and Roman Garnett, editors, Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 7645–7655, 2019.
|
| 295 |
+
|
| 296 |
+
[42] Natalia Díaz Rodríguez, Vincenzo Lomonaco, David Filliat, and Davide Maltoni. Don’t forget, there is more than forgetting: new metrics for continual learning. CoRR, abs/1810.13166, 2018.
|
| 297 |
+
|
| 298 |
+
[43] Andrei A. Rusu, Neil C. Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. CoRR, abs/1606.04671, 2016.
|
| 299 |
+
|
| 300 |
+
[44] Tom Schaul, Diana Borsa, Joseph Modayil, and Razvan Pascanu. Ray interference: a source of plateaus in deep reinforcement learning. CoRR, abs/1904.11455, 2019.
|
| 301 |
+
|
| 302 |
+
[45] Jonathan Schwarz, Daniel Altman, Andrew Dudzik, Oriol Vinyals, Yee Whye Teh, and Razvan Pascanu. Towards a natural benchmark for continual learning. In Continual learning Workshop, Neurips 2018, 2018.
|
| 303 |
+
|
| 304 |
+
[46] Jonathan Schwarz, Wojciech Czarnecki, Jelena Luketina, Agnieszka Grabska-Barwinska, Yee Whye Teh, Razvan Pascanu, and Raia Hadsell. Progress & compress: A scalable framework for continual learning. In Jennifer G. Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmässan, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, pages 4535–4544. PMLR, 2018.
|
| 305 |
+
|
| 306 |
+
[47] Andrew W. Senior, Richard Evans, John Jumper, James Kirkpatrick, Laurent Sifre, Tim Green, Chongli Qin, Augustin Zídek, Alexander W. R. Nelson, Alex Bridgland, Hugo Penedones, Stig Petersen, Karen Simonyan, Steve Crossan, Pushmeet Kohli, David T. Jones, David Silver, Koray Kavukcuoglu, and Demis Hassabis. Improved protein structure prediction using potentials from deep learning. Nat., 577(7792):706–710, 2020.
|
| 307 |
+
|
| 308 |
+
[48] Fan-Keng Sun, Cheng-Hao Ho, and Hung-Yi Lee. LAMOL: language modeling for lifelong language learning. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 309 |
+
|
| 310 |
+
[49] Mingxing Tan and Quoc V. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pages 6105–6114. PMLR, 2019.
|
| 311 |
+
|
| 312 |
+
[50] Chen Tessler, Shahar Givony, Tom Zahavy, Daniel J. Mankowitz, and Shie Mannor. A deep hierarchical approach to lifelong learning in minecraft. In Satinder P. Singh and Shaul Markovitch, editors, Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA, pages 1553–1561. AAAI Press, 2017.
|
| 313 |
+
|
| 314 |
+
[51] Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, IROS 2012, Vilamoura, Algarve, Portugal, October 7-12, 2012, pages 5026–5033. IEEE, 2012.
|
| 315 |
+
|
| 316 |
+
[52] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett, editors, Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 5998–6008, 2017.
|
| 317 |
+
|
| 318 |
+
[53] Jeffrey Scott Vitter. Random sampling with a reservoir. ACM Trans. Math. Softw., 11(1):37–57, 1985.
|
| 319 |
+
|
| 320 |
+
[54] Tianhe Yu, Deirdre Quillen, Zhanpeng He, Ryan Julian, Karol Hausman, Chelsea Finn, and Sergey Levine. Meta-world: A benchmark and evaluation for multi-task and meta reinforcement learning. In Leslie Pack Kaelbling, Danica Kragic, and Komei Sugiura, editors, 3rd Annual
|
| 321 |
+
|
| 322 |
+
Conference on Robot Learning, CoRL 2019, Osaka, Japan, October 30 - November 1, 2019, Proceedings, volume 100 of Proceedings of Machine Learning Research, pages 1094–1100. PMLR, 2019.
|
| 323 |
+
|
| 324 |
+
# Checklist
|
| 325 |
+
|
| 326 |
+
1. For all authors...
|
| 327 |
+
|
| 328 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 329 |
+
(b) Did you describe the limitations of your work? [Yes] see Section 4.4.
|
| 330 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 7
|
| 331 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 332 |
+
|
| 333 |
+
2. If you are including theoretical results...
|
| 334 |
+
|
| 335 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 336 |
+
|
| 337 |
+
3. If you ran experiments...
|
| 338 |
+
|
| 339 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] The codes is included in the supplemental material.
|
| 340 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] see details in Appendix A.
|
| 341 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] we used 20 random seeds, see also details in Appendix A.6.
|
| 342 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] see Appendix A.7.
|
| 343 |
+
|
| 344 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 345 |
+
|
| 346 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] We base on the MetaWorld benchmark [54], which we clearly indicate a few times, including the abstract.
|
| 347 |
+
(b) Did you mention the license of the assets? [Yes] We use MIT licence; see Appendix A.1
|
| 348 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes]
|
| 349 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 350 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 351 |
+
|
| 352 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 353 |
+
|
| 354 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 355 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 356 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/7Yhok3vJpU/7Yhok3vJpU.md
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HIGH-LIKELIHOOD AREA MATTERS — REWARDING CORRECT, RARE CLASS PREDICTIONS UNDER IMBALANCED DISTRIBUTIONS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Learning from natural datasets poses significant challenges for traditional classification methods based on the cross-entropy objective due to imbalanced class distributions. It is intuitive to assume that the examples from rare classes are harder to learn so that the classifier is uncertain of the prediction, which establishes the low-likelihood area. Based on this, existing approaches drive the classifier actively to correctly predict those incorrect, rare examples. However, this assumption is one-sided and could be misleading. We find in practice that the high-likelihood area contains correct predictions for rare class examples and it plays a vital role in learning imbalanced class distributions. In light of this finding, we propose the Eureka Loss, which rewards the classifier when examples belong to rare classes in the high-likelihood area are correctly predicted. Experiments on the large-scale long-tailed iNaturalist 2018 classification dataset and the ImageNet-LT benchmark both validate the proposed approach. We further analyze the influence of the Eureka Loss in detail on diverse data distributions.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Existing classification methods usually struggle in real-world applications, where the class distributions are inherently imbalanced and long-tailed (Van Horn & Perona, 2017; Buda et al., 2018; Liu et al., 2019; Gupta et al., 2019), in which a few head classes occupy a large probability mass while most tail (or rare) classes only possess a few examples. The language generation task is a vivid example of the long-tailed classification. In this case, word types are considered as the classes and the model predicts probabilities over the vocabulary. Common words such as the, of, and and are the head classes, while tailed classes are rare words like Gobbledygook, Scrumptious, and Agastopia. Conventional classifiers based on deep neural networks require a large number of training examples to generalize and have been found to under-perform on rare classes with a few training examples in downstream applications (Van Horn & Perona, 2017; Buda et al., 2018; Cao et al., 2019).
|
| 12 |
+
|
| 13 |
+
It is proposed that the traditional cross-entropy objective is unsuitable for learning imbalanced distributions since it treats each instance and each class equivalently (Lin et al., 2017; Tan et al., 2020). In contrast, the instances from tail classes should be paid more attention, indicated by two main approaches that have been recently investigated for class-imbalanced classification: the frequencybased methods and the likelihood-based methods. The former (Cui et al., 2019; Cao et al., 2019) directly adjust the weights of the instances in terms of their class frequencies, so that the instances from the tail classes are learned with a higher priority no matter whether they are correctly predicted or not. The latter (Lin et al., 2017; Zhu et al., 2018) instead penalize the inaccurate predictions more heavily, assuming that the well-classified instances, i.e., the instances in the high-likelihood area, factor inconsequentially in learning imbalanced distributions.
|
| 14 |
+
|
| 15 |
+
However, neither of these two approaches realistically depicts the likelihood landscape. In particular, the high-likelihood area, where the classifier makes the correct predictions for both common class examples and rare class ones, contributes significantly to generalization. However, this area is not well-shaped, as illustrated in Figure 1. Specifically, the frequency-based methods imply an impaired learning of common class examples that are the principle part of the natural data, while the likelihoodbased methods ignore the correctly-predicted rare class examples that can provide crucial insights into the underlying mechanism for predicting such examples.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Conceptual illustration of approaches to learning unbalanced class distributions. For an instance in the training data, the frequency-based methods either sharpen or soften the loss for all likelihoods according to its class frequency, while the likelihood-based methods adjust the loss in the low- or high-likelihood area, respectively. The high-likelihood area is relatively deprioritized in both cases. The proposed Eureka Loss progressively rewards the systems with higher bonus for higher-likelihood.
|
| 19 |
+
|
| 20 |
+
In this paper, we first demonstrate that existing practice of neglecting predictions in the high-likelihood area is harmful to learning imbalanced class distributions. Furthermore, we find that simply mixing the cross-entropy loss and the Focal Loss (Lin et al., 2017) can induce substantially superior performance, which validates our motivation. In turn, we propose to elevate the importance of high-likelihood predictions even further and design a novel objective called Eureka Loss. It progressively rewards the classifiers according to both the likelihood and the class frequency of an example such that the system is encouraged to be more confident in the correct prediction of examples from rare classes. Experimental results on the image classification and the language generation tasks demonstrate that the Eureka Loss outperforms strong baselines in learning imbalanced class distributions.
|
| 21 |
+
|
| 22 |
+
Our contributions are twofold:
|
| 23 |
+
|
| 24 |
+
• We challenge the common belief that learning for examples in low-likelihood area is more important for learning tail classes and reveal that the correctly-predicted rare class examples make important contribution to learning long-tailed class distributions. • We explore a new direction for learning imbalanced classification that focuses on rewarding correct predictions for tail classes examples, rather than penalizing incorrect ones. The proposed Eureka Loss rewards the classifier for its high-likelihood predictions progressively to the rarity of their class and achieves substantial improvements on various problems with long-tailed distributions.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Frequency-based Data and Loss Re-balancing Previous literature on learning with long-tailed distribution mainly focusing on re-balancing the data distribution and re-weighting the loss function.
|
| 29 |
+
|
| 30 |
+
The former is based on a straightforward idea to manually create a pseudo-balanced data distribution to ease the learning problem, including up-sampling for rare class examples (Chawla et al., 2002), down-sampling for head class examples (Drummond & Holte, 2003) and a more concrete sampling strategy based on class frequency (Shen et al., 2016).
|
| 31 |
+
|
| 32 |
+
As for the latter, recent studies propose to assign different weights to different classes, and the weights can be calculated according to the class distribution. For example, Khan et al. (2018) design a cost-sensitive loss for major and minor class examples. An intuitive method is to down-weight the loss of frequent classes, while up-weight the contribution of rare class examples. However, frequency is not suitable to be directly treated as the the weight since there exists overlap among samples. An advancing alternative loss CB (Cui et al., 2019) proposes to calculate the effective number to substitute the frequency for loss re-weighting. However, since it assigns lower weight to head classes in the maximum likelihood training (Cross Entropy objective), it seriously impairs the learning of head classes. Moreover, CB requires a delicate hyper-parameter tuning for every imbalanced distribution, leading to a lot of manul efforts. From the perspective of max-margin, a recent study LDAM (Cao et al., 2019) proposes to up-weight the loss of tail classes by a class-distribution based margin. Compared to the above methods, we choose to decrease the loss of tail classes by rewarding correct predictions rather than increasing the loss of tail classes through aggravated penalization.
|
| 33 |
+
|
| 34 |
+
Deferring the Frequency-based Class-balanced Training Recent studies find that deferring the class-balanced training helps learn high-quality representations (Liu et al., 2019), and propose deferred Class-balanced training (deferred CB) (Cao et al., 2019), which chooses to adopt Cross Entropy objective at the beginning of training. Similarly, the Decoupling method (Kang et al., 2020) shows that the re-balancing strategies impair the quality of learned feature representations and demonstrate an improved performance learned with original data distribution, by training the model with Cross Entropy in the first phase and adopting class-balanced training in the second phase. This decoupling strategy can also be found in BBN (Zhou et al., 2019), which includes both class imbalanced and balanced training, and the transition from the former to the latter is achieved through a curriculum learning schedule. These methods achieve state-of-the-art performance in long-tailed classification. To be comparable with these methods and to analyse whether Eureka Loss is complementary to this technique, we propose deferred Eureka Loss, in which rewarding for rare class prediction is introduced to encourage the model to learn rare patterns when learning is stalled.
|
| 35 |
+
|
| 36 |
+
Likelihood-based Loss Another dominant method for imbalanced classification is the likelihoodbased method Focal Loss (FL) (Lin et al., 2017), which proposes to down-weight the contribution of examples in the high-likelihood area. However, we argue that it is harmful for learning tail classes and choose an opposite direction by highlighting the high-likelihood area with a steeper loss.
|
| 37 |
+
|
| 38 |
+
Transferring Representations Techniques for transferring information from sufficient head classes examples to under-represented rare classes examples belong to a parallel successful direction in this field. They include MBJ (Liu et al., 2020), which utilizes external semantic feature memory and FSA (Chu et al., 2020), which decomposes feature in to class-specific and class-generic components. These latest transfer learning based studies are less related to our paper but they also obtain good improvements in long-tailed classification, so we add them into comparison in the experiments.
|
| 39 |
+
|
| 40 |
+
# 3 ROLE OF THE HIGH-LIKELIHOOD AREA
|
| 41 |
+
|
| 42 |
+
The existing approaches to the long-tailed classification independently consider the class frequency and the example likelihood. However, we show that this one-sided reflection is problematic when dealing with the tail class examples that can be confidently classified. The tail class examples can be easily classified by the classifier, and the head class examples can also be hard for the classifier to recognize. The difficulty of classification depends on the inherent characteristic of the classes, rather than the sample size of the class. For example, in species classification, the Portuguese man o’war may be a rare class but can be easily classified due to its distinct features, compared to various kinds of moths which are common classes yet are hard to distinguish. However, the frequency-based methods continuously drive the classifier to fit the rare class examples, especially when they are difficult to predict, which may lead to overfitting. On the other hand, the likelihood-based methods relax the concentration in the high-likelihood area, which contains the tail class examples that are not hard to predict and provide insights to generalization.
|
| 43 |
+
|
| 44 |
+
To verify our point of view, we analyze the problem by dissecting the influence of the high-likelihood area with respect to the class frequency and demonstrate that properly encouraging the learning of well-classified tail class examples induce substantial improvements, before which we first give a brief introduction of classification with long-tailed class distributions.
|
| 45 |
+
|
| 46 |
+
# 3.1 PREPARATION: CLASSIFICATION WITH LONG-TAILED CLASS DISTRIBUTIONS
|
| 47 |
+
|
| 48 |
+
Let’s consider the multi-class classification problem with the long-tailed class distribution. Given a class set $\mathbb { C }$ , $n$ denotes the number of different classes in $\mathbb { C }$ and $m _ { i }$ is the number of examples of the class $C _ { i }$ . For simplicity, we sort the class set $\mathbb { C }$ according to cardinal $m _ { i }$ for $C _ { i }$ such that $C _ { 0 }$ is the class with the most examples and $C _ { n - 1 }$ is the rarest class. Let $\pmb { p }$ be a $n$ -dim probability vector predicted by a classifier model $f ( \pmb { x } ; \pmb { \theta } )$ based on the input $_ { \textbf { \em x } }$ , where each element $p _ { i }$ denotes the probability of the class $C _ { i }$ and $\textbf { { y } }$ is a $n$ -dim one-hot label vector with $y$ being the ground-truth class.
|
| 49 |
+
|
| 50 |
+
The probability vector can be calculated as
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\begin{array} { r } { \pmb { p } = \sigma ( f ( \pmb { x } ; \pmb { \theta } ) ) , } \end{array}
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $\sigma$ is the normalizing function, e.g., softmax for multi-class classification. Typically, the parameters are estimated using maximum likelihood estimation (MLE), which is equivalent to using the Cross-Entropy Loss (CE) function, where the scalar $y \cdot \log p$ can be regarded as the (log)-likelihood:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\mathcal { L } = - \mathbb { E } _ { ( \pmb { x } , \pmb { y } ) \in \mathcal { D } } \log p _ { \mathrm { m o d e l } } ( \pmb { y } | \pmb { x } ) = - \frac { 1 } { | \mathcal { D } | } \sum _ { ( \pmb { x } , \pmb { y } ) \in \mathcal { D } } \pmb { y } \cdot \log p .
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
For deep neural network–based classifiers, due to the non-linearity of the loss function, the problem is typically solved by stochastic gradient descent, which requires the calculation of the gradient with respect to the parameters using the chain-rule, the process of which is called back-propagation:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\frac { \partial \mathcal { L } } { \partial \pmb { \theta } } = \frac { \partial \mathcal { L } } { \partial \pmb { p } } \frac { \partial \pmb { p } } { \partial \pmb { \theta } } = \frac { \partial \mathcal { L } } { \partial \pmb { p } } \frac { \partial \sigma ( f ( \pmb { x } ; \pmb { \theta } ) ) } { \partial \pmb { \theta } } .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
We introduce the term likelihood gradient to denote $\partial \mathcal { L } / \partial \mathbf { \boldsymbol { p } }$ , which modulates how the probability mass should be shifted and is a characteristic of the loss function instead of the classifier. For learning imbalanced class distributions, the common methods aim to shape the likelihood gradient so the rare classes are learned with priority, i.e., embodying a sharper loss and a larger likelihood gradient.
|
| 69 |
+
|
| 70 |
+
Frequency-Based Methods Frequency-based methods alter the likelihood gradient according to the class frequencies, which are irrelevant to how well individual examples are classified. A simple form is using a $n$ -dim weight vector $\textbf { \em w }$ composed of the class weights based on their frequencies in the dataset to determine the importance of examples from each class:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\mathcal { L } = - w _ { y } \cdot ( { \pmb y } \cdot \log { \pmb p } ) .
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
Note that when ${ \pmb w } = { \bf 1 }$ , it is identical to the cross-entropy objective. The weight vector is typically calculated as $w _ { i } = \bar { m } / m _ { i }$ , where $\bar { m }$ is the average of $m _ { i }$ . As we can see, the standard weight is taken as the average of the class size, so that the classes with more examples are down-weighted and the classes with fewer examples are up-weighted. For a natural long-tailed distribution, the average is larger than the median, which suggests more classes are up-weighted. Advanced frequency-based methods try to obtain a more meaningful measurement of the class size, e.g., the Class-Balanced Loss (CB) proposed by Cui et al. (2019) utilizes an effective number $\left. 1 - \beta ^ { m _ { i } } \right/ 1 - \beta$ for each class, where $\beta \in [ 0 . 9 , 1 )$ is a tunable class-balanced term.
|
| 77 |
+
|
| 78 |
+
Likelihood-Based Methods Different from the frequency-based methods, likelihood-based methods adjust the likelihood gradient based on the instance-level difficulty as predicted by the classifier such that the examples in the low-likelihood area are more focused in training. For example, the well-known Focal Loss (FL) with a balanced factor $\alpha$ proposed by Lin et al. (2017) takes the following form:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\mathcal { L } = - \alpha ( 1 - p _ { y } ) ^ { \gamma _ { f } } \cdot ( { \pmb y } \cdot \log { \pmb p } ) ,
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where $\gamma _ { f } > 0$ , which controls the convexness of the loss and higher $\gamma _ { f }$ indicates adjustment that are more significant. Note that when $\alpha = 1$ and $\gamma _ { f } = 0$ , it is identical to the cross-entropy objective. Following previous works (Cao et al., 2019; Liu et al., 2019; Cui et al., 2019), the $\alpha$ is set to 1 in multi-class classification, and Class-Balanced Focal Loss $\mathrm { ( F L + C B ) }$ can be viewed Focal Loss with uneven alpha for each class in the multi-class setting. The key idea is to pay less attention to the well-classified examples and pay more attention to the badly-classified examples, because it is natural to assume the tail class examples are harder to learn and thus cannot be well-classified. However, such methods neglect the correctly-predicted tail class examples, the practice of which we show is not constructive to the learning of long-tailed class distributions.
|
| 85 |
+
|
| 86 |
+
# 3.2 UNDERSTANDING THE INFLUENCE OF THE HIGH-LIKELIHOOD AREA
|
| 87 |
+
|
| 88 |
+
To understand the influence of the high-likelihood area, we first prepare a variant of the Focal Loss, the Halted Focal Loss (HFL), such that the high-likelihood area is not deprioritized. The Halted Focal Loss reverts the Focal Loss to the Cross-Entropy Loss when the likelihood is high enough:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathcal { L } = \left\{ \begin{array} { l l } { - \alpha ( 1 - p _ { y } ) ^ { \gamma _ { f } } \cdot ( y \cdot \log p ) , } & { \mathrm { i f } \ p _ { y } \leq \varphi } \\ { - \alpha y \cdot [ \log p + b ] , } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 2: Regaining focus on the high-likelihood area for the rare classes benefits classification. Left: Illustration of HFL which reverts FL to CE in the high-likelihood area. Right: Applying HFL only to the rare classes improves overall performance.
|
| 96 |
+
|
| 97 |
+
<table><tr><td>Method</td><td>AP</td><td>AP50</td><td>AP75</td></tr><tr><td>CE</td><td>32.8</td><td>52.3</td><td>34.7</td></tr><tr><td>FL</td><td>33.8</td><td>52.5</td><td>35.9</td></tr><tr><td>HFL</td><td>34.0</td><td>52.7</td><td>36.2</td></tr><tr><td>FL (Head) + HFL (Tail)</td><td>34.2</td><td>52.7</td><td>36.3</td></tr></table>
|
| 98 |
+
|
| 99 |
+
Table 1: Results of HFL on the COCO detection dataset, AP denotes average precision. As we can see, increasing the importance of the high-likelihood area achieves better results, and the main improvements come from the tail class examples.
|
| 100 |
+
|
| 101 |
+
where $p _ { y }$ is prediction probability of the correct label, $b = \alpha ( 1 - ( 1 - \varphi ) ^ { \gamma _ { f } } ) \log \varphi$ to ensure monotonicity and continuity, and $\varphi$ is the boundary between the low- and the high-likelihood area, which we set as 0.5, i.e., a likelihood higher than which definitely renders a correct prediction. This mixed loss is plotted in left of the Figure 2, which has the same likelihood gradient as the cross-entropy in the high-likelihood area and remains the same as the Focal Loss in the low-likelihood area.
|
| 102 |
+
|
| 103 |
+
To decouple the effect of class frequency, we further explore to gradually transition from the Focal Loss to the Halted Focal Loss according to the class frequency of an example, e.g., from adopting the Halted Focal Loss only for the rarest class and the Focal Loss to other classes to adopting the Focal Loss only for the most common class and the Halted Focal Loss for the rest. Concretely, we set a proportion $t \in [ 0 , 1 ]$ of classes to receive this loss and the remaining $1 - t$ proportion of classes adopt the original Focal Loss. The classes are ranked by inverse frequencies, such that the first class is the rarest class.
|
| 104 |
+
|
| 105 |
+
We conduct experiments on long-tailed CIFAR-10 using the aforementioned protocol to examine the effect of the high-likelihood area. The construction of the dataset is provided in Appendix C. We run each configuration 5 times with different random initialization and report the average test performance. The results are shown in the right of Figure 2.
|
| 106 |
+
|
| 107 |
+
As we can see, compared to the original Focal Loss, the proposed adaptation achieves better performance, indicating regaining focus in the high-likelihood area is beneficial. Nonetheless, the phenomenon can be also attributed to a better learning of the common classes instead of the rare classes. Our analysis based on the class frequency resolves this concern because the Halted Focal Loss brings more improvements if only tailed classes are learned this way, e.g., applying to the top-4 rare classes achieve the best overall performance, which proves that there are rare class examples that reside in the high-likelihood area and have non-negligible effect to generalization.
|
| 108 |
+
|
| 109 |
+
The importance of the high-likelihood area of the rare examples is further validated on the COCO detection dataset, where the classifier should determine whether the object appears in the image or not. The positive detection is the rare class since there are many false proposals. The experiment setting is in Appendix C. $A P _ { 5 0 }$ and $A P _ { 7 5 }$ measure the precision under different levels of overlap between predictions and ground-truth. As shown in Table 1, strengthening the high-likelihood area of the Focal Loss, especially for the rare class examples, obtains a more accurate and confident prediction.
|
| 110 |
+
|
| 111 |
+
# 4 EUREKA LOSS
|
| 112 |
+
|
| 113 |
+
We have shown that the high-likelihood area matters for long-tailed classification and in particular, the rare class examples in the area have pivotal contributions. Inspired by this finding, we propose to further enhance the importance of the high-likelihood area so that the likelihood gradient in the high-likelihood area can match or even surpass that in the low-likelihood area. Moreover, the adjustment is inline with the frequency of the class so the rarer the class, the larger the likelihood gradient. Extending the adjustment term $b$ in Eq. (6), we propose the Eureka Loss (EL):
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\mathcal { L } = - \pmb { y } \mathrm { \cdot } \log \pmb { p } - \mathrm { b o n u s } \mathrm { \cdot } \mathrm { e n c o u r a g e m e n t } ,
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where −bonus·encouragement is intended to reward the well-classified rare examples. The bonus term depends on the example likelihood and the encouragement term depends on the class frequency. Different from the existing approaches that scale the Cross-Entropy Loss, punishing the incorrect predictions selectively, the proposed Eureka Loss deals with long-tailed classification from another perspective, rewarding the correct predictions progressively with their class frequencies.
|
| 120 |
+
|
| 121 |
+
Bonus indicates how well the system executes the task and is designed to be a function of the probability of the ground-truth class to reward the model when it makes correct prediction. In particular, in light of the findings discussed in Section 3.2, we propose to increase the likelihood gradient in the high-likelihood area and adopt the form of
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
{ \mathrm { b o n u s } } = { \pmb y } \cdot \mathrm { l o g } ( 1 - { \pmb p } ) ,
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
which ensures that the monotonicity of the likelihood gradient is consistent with that of the CrossEntropy Loss, meaning that the classifier obtains more bonus when making highly-confident correct predictions. The design is against most existing studies in that the high-likelihood area is given more focus than the low-likelihood area.
|
| 128 |
+
|
| 129 |
+
Encouragement implies the system realizes unusual achievements that should be encouraged. Since the unusual achievements in long-tailed classification should be correctly predicting rare class examples, we propose to reward the system based on the frequency of the example’s class:
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
{ \mathrm { e n c o u r a g e m e n t } } = w _ { y } = { \frac { \bar { m } } { m _ { y } } } ,
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
where $m _ { y }$ denotes the measurement of the frequency of the class $y$ . The form is flexible and similar to the frequency-based methods, and thus can be further extended based on the related studies. In our experiments, we use the effective number from Cui et al. (2019) as the measurement.
|
| 136 |
+
|
| 137 |
+
Compared to the existing frequency-based and likelihood-based objective, our Eureka Loss takes the bonus term to calibrate the attention to different likelihood landscapes and the encouragement term to inform the model with the class difficulty, composing a more targeted yet comprehensive loss for learning imbalanced distributions.
|
| 138 |
+
|
| 139 |
+
# 5 EXPERIMENTS
|
| 140 |
+
|
| 141 |
+
We validate the proposed Eureka Loss on diverse long-tailed classification problems and analyze the characteristics of the Eureka Loss with insights into the learned models.
|
| 142 |
+
|
| 143 |
+
# 5.1 TASKS, DATASETS, AND TRAINING SETTINGS
|
| 144 |
+
|
| 145 |
+
Tasks and Datasets We conduct experiments on two image classification tasks and a dialogue generation task. iNaturalist 2018 is a real-world dataset which embodies a highly imbalanced class distribution of 8,142 classes. Apart from the test performance, we also report the validation performance grouped by the class frequency and categorize the examples into three groups: many (classes with more than 100 examples), medium (classes with 20 to 100 examples), and few (classes with fewer than 20 examples). ImageNet-LT (Liu et al., 2019) is an artificially constructed long-tailed classification dataset based on ILSVRC 2012 of 1000 classes. ConvAI2 is a natural conversation dataset for evaluating dialogue system, where each word type can be treated as a class, i.e., 18,848 words (classes) in total, and have extremely imbalanced training and test datasets.
|
| 146 |
+
|
| 147 |
+
Evaluation Metric For the image classification tasks, we use the accuracy on ’All’ data and subset of classes with ’Many’, ’Medium’ and ’Few’ examples , i.e., the precision of the top-1 prediction. Since the test set of those tasks are balanced in classes, we further propose to estimate the accuracy on the imbalanced class distribution that reflects natural performance in real-world scenarios. The natural accuracy is the linear interpolation of the accuracy on the balanced test set using the class frequencies from the training set. For the natural language generation task, we adopt the micro and macro F-scores from Zhang et al. (2018) between the generated and the reference sentences to check how well the systems participate in the conversation. We further adopt the 4-gram diversity to examine the rare phrases, since a well-known problem for dialogue tasks is that the model tends to generate common, dull and repetitive responses and thus cannot capture the diversity of natural language distributions. Since the test set of natural language generation task is naturally imbalanced, we do not need to estimate the natural performance.
|
| 148 |
+
|
| 149 |
+
Table 2: Results on iNaturalist 2018. ∗ denotes results from the corresponding paper and † denotes deferred learning, where the base loss is applied at the beginning of training and the improved method is adopted later. § denotes that it focuses on transferring representations and the method is less related to our work. Best results are shown in bold. The proposed Eureka Loss achieves the best results in learning both common and rare classes.
|
| 150 |
+
|
| 151 |
+
<table><tr><td>Method</td><td>All</td><td>Many</td><td>Medium</td><td>Few</td><td>All (Natural)</td></tr><tr><td>CE</td><td>64.3</td><td>74.1</td><td>65.9</td><td>59.8</td><td>71.7</td></tr><tr><td>CB</td><td>58.3</td><td>61.8</td><td>58.6</td><td>56.9</td><td>59.8</td></tr><tr><td>FL</td><td>62.9</td><td>72.9</td><td>64.1</td><td>58.8</td><td>70.7</td></tr><tr><td>FL +CB</td><td>59.6</td><td>45.5</td><td>61.8</td><td>60.5</td><td>46.7</td></tr><tr><td>Eureka Loss</td><td>68.5</td><td>70.8</td><td>69.3</td><td>66.7</td><td>70.6</td></tr><tr><td>CB†</td><td>68.1</td><td>71.0</td><td>68.3</td><td>67.1</td><td>70.4</td></tr><tr><td>FL + CB†</td><td>66.9</td><td>64.4</td><td>67.4</td><td>67.0</td><td>64.9</td></tr><tr><td>LDAM+CB† (Cao et al., 2019)</td><td>63.3</td><td>65.2</td><td>63.0</td><td>63.1</td><td>64.1</td></tr><tr><td>BBN (Zhou et al., 2019)*†</td><td>69.6</td><td>1</td><td>1</td><td>-</td><td>-</td></tr><tr><td>Decoupling-LWs (Kang et al., 2020)*†</td><td>69.5</td><td>71.0</td><td>68.8</td><td>69.5</td><td>-</td></tr><tr><td>Eureka Loss†</td><td>69.9</td><td>73.3</td><td>69.3</td><td>69.6</td><td>73.0</td></tr><tr><td>FSA (Chu et al., 2020)*$</td><td>65.9</td><td>1</td><td>-</td><td>-</td><td></td></tr><tr><td>MBJ (Liu et al., 2020)* §</td><td>68.6</td><td>68.0</td><td>69.8</td><td>68.5</td><td>-</td></tr><tr><td>Eureka Loss + CB†</td><td>70.3</td><td>69.0</td><td>70.1</td><td>70.9</td><td>69.4</td></tr></table>
|
| 152 |
+
|
| 153 |
+
For the detailed introduction to tasks, datasets, and training settings, please refer to the appendix.
|
| 154 |
+
|
| 155 |
+
# 5.2 RESULTS
|
| 156 |
+
|
| 157 |
+
iNaturalist 2018 The results are reported in Table 2. We tune the hyper-parameters for our implemented baselines and report the averaged performance among 3 runs at the best setting.
|
| 158 |
+
|
| 159 |
+
We compare Eureka Loss with frequency-based method Class-balanced Loss (CB), likelihood-based method Focal Loss (FL) and their combination $\mathrm { F L + C B }$ . As we can see from the first group in the table, neither FL nor CB achieves improvements over Cross Entropy (CE), but Eureka Loss outperforms CE by a large margin in terms of overall accuracy and accuracy for classes with few examples.
|
| 160 |
+
|
| 161 |
+
In contrary to the first group, considering only the accuracy on the balanced test set, the two-stage version of frequency class-balanced training which adopts the class-balanced training only in the latter training phase includes deferred CB(denotes $\mathrm { C B ^ { \dag } }$ in the table), LDAM $^ +$ deferred CB, BBN and Decoupling-LWS enjoy clear advantage over CE. In order to check whether Eureka Loss is additive with the deferred method and the class-balanced training, we take deferred Eureka Loss and Eureka $\mathbf { L o s s + C B ^ { \dagger } }$ into comparison.
|
| 162 |
+
|
| 163 |
+
The deferred Eureka Loss is motivated by an intuition that when training enters the bottleneck stage, Eureka Loss is introduced to reward rare classes to encourage the model to learn less common patterns, which may be helpful for learning. Compared with the original method, the deferred encouragement brings improvement on both balanced and imbalanced test distribution $( + 1 . 4$ and $+ 2 . 4$ regarding All and All(Natural), respectively). Moreover, the class-balanced training still impairs the learning for common classes even under the deferred setting, which may cast into unfavorable natural performance in real applications, e.g., the accuracy on the ’Many’ subset for $\mathrm { C B ^ { \dag } }$ and DecouplingLWS is under-performs CE by 3.1, the results is that applying $\mathrm { \dot { C } B ^ { \dagger } }$ reduces the Natural accuracy by 1.3. But deferred Eureka Loss largely outperforms CE and these methods on both balanced and imbalanced test distributions. The reason may be that we do not impair the CE learning and the additional rewarding for rare classes is less harmful. Since Eureka Loss only introduces an additive term, it is flexible and can be combined with CB, the adoption results in best All accuracy of 70.3.
|
| 164 |
+
|
| 165 |
+
Table 3: Results on ImageNet-LT. ∗ and † are defined similarly to Table 2. Eureka Loss demonstrates consistent improvements against existing methods.
|
| 166 |
+
|
| 167 |
+
<table><tr><td>Method</td><td>All</td><td>All (Natural)</td></tr><tr><td>CE</td><td>44.6</td><td>63.7</td></tr><tr><td>FL</td><td>43.6</td><td>62.4</td></tr><tr><td>CB</td><td>43.9</td><td>58.8</td></tr><tr><td>FL+CB</td><td>31.1</td><td>25.0</td></tr><tr><td>Eureka Loss</td><td>48.4</td><td>63.8</td></tr></table>
|
| 168 |
+
|
| 169 |
+
<table><tr><td>Method (Deferred)</td><td>All</td><td>All (Natural)</td></tr><tr><td>OLTR (Liu et al., 2019)*</td><td>46.5</td><td>1</td></tr><tr><td>CBt</td><td>49.2</td><td>60.5</td></tr><tr><td>Decoupling-LWs (Kang et al.,2020)*</td><td>49.9</td><td>59.8</td></tr><tr><td>Eureka Loss + CB†</td><td>50.4</td><td>62.2</td></tr></table>
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Name</td><td>F-Score (Macro)</td><td>F-Score (Micro)</td><td>Diversity (4-gram)</td></tr><tr><td>Cross Entropy</td><td>1.17</td><td>16.9</td><td>36.5</td></tr><tr><td>Focal Loss (γ = 1)</td><td>1.17</td><td>16.8</td><td>36.6</td></tr><tr><td>Focal Loss (γ = 2)</td><td>1.13</td><td>16.7</td><td>37.3</td></tr><tr><td>Eureka Loss</td><td>1.32</td><td>17.2</td><td>40.4</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Table 4: F-scores and 4-gram diversity on ConvAI2. The proposed Eureka Loss achieves better performance than baseline methods and generates responses that are more diverse.
|
| 174 |
+
|
| 175 |
+
In all, adopting the Eureka Loss achieves a balanced performance on both common and rare classes. Besides, we also outperform the latest representation transferring based methods including MBJ and FSA.
|
| 176 |
+
|
| 177 |
+
ImageNet-LT Table 3 demonstrates the results on ImageNet-LT of various methods. For this artificial dataset, we first compare with the representative frequency-based method CB and likelihoodbased method Focal Loss (FL). As we can see, the proposed method obtains a significant improvement in the balanced test set and also maintains the lead position in the virtual natural test set. For comparison with methods that defer the class-balanced training including deferred CB and DecoupingLWS, the Eureka Loss of corresponding modification also enjoys a comfortable margin and arguably excels in balancing the performance on both of the common and the rare classes.
|
| 178 |
+
|
| 179 |
+
ConvAI2 Table 4 shows that the proposal helps the prediction of rare words $+ 1 0 \%$ macro F-score) and thus improves the diversity of language generation $( + 1 0 \%$ 4-gram diversity). Since this dataset is extremely imbalanced, e.g., the imbalance ratio is over 200,000, the frequency-based methods require extensive tuning to work, which we thus omit from the comparison as we are not able to reproduce favorable results. Compared with the likelihood-based method Focal Loss, which is marginally better that the original cross-entropy loss, the Eureka Loss still obtains substantial improvements.
|
| 180 |
+
|
| 181 |
+
# 5.3 ANALYSIS
|
| 182 |
+
|
| 183 |
+
Effect on Distributions of Different Imbalance Degrees To analyze the effect on imbalanced distributions of different degrees, we construct several artificial datasets based on CIFAR-100 and control the size of the rarest class. The imbalance degree stands for the ratio of the class size of the most common class to that of the rarest class. Hence, the larger the degree, the more imbalanced the dataset. For example, if imbalance degree is 100 for CIFAR-100, the most common class has 500 examples and the rarest class has 5 examples. As shown in Table 5, the Eureka Loss is consistently better than existing methods, especially for datasets that are more imbalanced. For results on CIFAR-10, please refer to the appendix.
|
| 184 |
+
|
| 185 |
+
Table 5: Results on long-tailed CIFAR100 of different imbalance degrees (ID). † denotes deferred learning; ♣ and $\spadesuit$ denotes results taken from Zhou et al. (2019) and Cao et al. (2019), respectively.
|
| 186 |
+
|
| 187 |
+
<table><tr><td>Method</td><td>ID-100 ID-50 ID-10</td></tr><tr><td>CE+RSt+</td><td>41.61 46.48 58.11</td></tr><tr><td>CE+CB++</td><td>41.51 45.29 58.12</td></tr><tr><td>LDAM+CB† +</td><td>42.04 46.62 58.71</td></tr><tr><td>BBNt+</td><td>42.56 47.02 59.12</td></tr><tr><td>EL + CB+</td><td>43.19 48.48 59.31</td></tr></table>
|
| 188 |
+
|
| 189 |
+
Varying Strength of Bonus To illustrate the importance of the high-likelihood area in imbalanced classification within Eureka Loss, we compare a
|
| 190 |
+
|
| 191 |
+
<table><tr><td>Method</td><td>All Many</td><td>Medium</td><td>Few</td></tr><tr><td>EL (β=0.99)</td><td>45.8 67.2</td><td>38.4</td><td>11.3</td></tr><tr><td>EL (β=0.999)</td><td>47.8 66.1</td><td>42.0</td><td>16.4</td></tr><tr><td>EL (β=0.9999)</td><td>50.0 67.1</td><td>44.7</td><td>19.8</td></tr></table>
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Figure 3: Varying strength of bonus on long-tailed CIFAR-10. Higher power $\gamma _ { b }$ indicates higher strength.
|
| 195 |
+
|
| 196 |
+
Table 6: Varying strength of encouragement on the dev set of ImageNet-LT. Higher $\beta$ means higher strength.
|
| 197 |
+
|
| 198 |
+
exponential form bonus called Power Bonus (PB) to the original bonus, which takes the power form of the probability vector of by a factor $\gamma _ { b }$ :
|
| 199 |
+
|
| 200 |
+
$$
|
| 201 |
+
P B ( \pmb { p } ) = - \pmb { y } \cdot \pmb { p } ^ { \gamma _ { b } } ,
|
| 202 |
+
$$
|
| 203 |
+
|
| 204 |
+
where $\gamma _ { b }$ is a positive value to ensure the monotonicity and can be tuned for different tasks. Besides, CE achieves a $7 1 . 4 \%$ accuracy and the likelihood bonus with deferred encouragement gets a $7 6 . 1 \%$ accuracy. Figure 3 demonstrates that bigger likelihood gradient in the high-likelihood area brings more improvements, e.g., power-bonus with power of 4 is better than bonuses of small power.
|
| 205 |
+
|
| 206 |
+
Varying Strength of Encouragement The strength of encouragement is determined by both of the class frequency and the hyper-parameter $\beta$ as we use the effective number of the class. As $\beta$ controls the variance of the the effective number, e.g., when $\beta = 0$ , the variance is 0, meaning all of the classes receive equal encouragement, we control the strength of the encouragement towards tail classes by altering $\beta$ . The results on the validation set of ImageNet-LT are shown in Table 6. As we can see, higher $\beta$ (more encouragement for tail classes), is connected to higher overall accuracy and better tail class performance, which again validates our motivation for encouraging correct rare class predictions.
|
| 207 |
+
|
| 208 |
+
Effect on Example-Likelihood The Eureka Loss rewards the high-likelihood predictions especially for tail classes. It is interesting to see how the training dynamic is changed due to this preference. In order to understand the effect, we visualize the example likelihood grouped by target class frequencies after training in Figure 4 and Figure 5 (due to space limit, the complete comparison is provided in the Appendix A), which are from the validation set from iNaturalist 2018. As we can see, with the Eureka Loss, the examples in the high-likelihood area are driven to the extreme. For example, considering the medium and the low frequency group, the “hard” examples that may be inherently difficult to classify stand invariant, while for the examples that can be classified correctly, the system now treats them with more confidence. This dynamics translate into better accuracy in unseen examples in the test set, hinting the importance of rare class examples in the high-likelihood area for the generalization of learning imbalanced class distributions.
|
| 209 |
+
|
| 210 |
+

|
| 211 |
+
Figure 4: The visualization of test likelihood distribution for models trained with the Eureka Loss. The model classifies the rare class examples more decisively, compared to the existing methods.
|
| 212 |
+
|
| 213 |
+
# 6 CONCLUSIONS
|
| 214 |
+
|
| 215 |
+
In this paper, we examine the effect of the high-likelihood area on learning imbalanced class distributions. We find that the existing practice of relatively diminishing the contribution of the examples in the high-likelihood area is actually harmful to the learning. We further show that the rare class examples in the high-likelihood area have pivotal contribution to model performance and should be focused on instead of being neglected. Motivated by this, we propose the Eureka Loss, which additionally rewards the well-classified rare class examples. The results of the Eureka Loss in the image classification and natural language generation problems demonstrate the potential of reconsidering the role of the high-likelihood area. In-depth analysis also verifies the effectiveness of the investigated loss form and reveals the learning dynamics of different approaches to long-tailed classification.
|
| 216 |
+
|
| 217 |
+
# REFERENCES
|
| 218 |
+
|
| 219 |
+
Mateusz Buda, Atsuto Maki, and Maciej A Mazurowski. A systematic study of the class imbalance problem in convolutional neural networks. Neural Networks, 106:249–259, 2018.
|
| 220 |
+
|
| 221 |
+
Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Arechiga, and Tengyu Ma. Learning imbalanced datasets with label-distribution-aware margin loss. CoRR, 1906.07413, 2019.
|
| 222 |
+
|
| 223 |
+
Nitesh V. Chawla, Kevin W. Bowyer, Lawrence O. Hall, and W. Philip Kegelmeyer. SMOTE: Synthetic minority over-sampling technique. Journal of Artificial Intelligence Research, 16: 321–357, 2002.
|
| 224 |
+
|
| 225 |
+
Peng Chu, Xiao Bian, Shaopeng Liu, and Haibin Ling. Feature space augmentation for long-tailed data. CoRR, abs/2008.03673, 2020.
|
| 226 |
+
|
| 227 |
+
Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge Belongie. Class-balanced loss based on effective number of samples. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9268–9277, 2019.
|
| 228 |
+
|
| 229 |
+
Chris Drummond and Robert Holte. C4.5, class imbalance, and cost sensitivity: Why under-sampling beats oversampling. Proceedings of the ICML’03 Workshop on Learning from Imbalanced Datasets, 2003.
|
| 230 |
+
|
| 231 |
+
Priya Goyal, Piotr Dollar, Ross B. Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, ´ Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch SGD: Training ImageNet in 1 hour. CoRR, abs/1706.02677, 2017.
|
| 232 |
+
|
| 233 |
+
Agrim Gupta, Piotr Dollar, and Ross B. Girshick. LVIS: A dataset for large vocabulary instance ´ segmentation. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5351–5359, 2019.
|
| 234 |
+
|
| 235 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition, pp. 770–778, 2016.
|
| 236 |
+
|
| 237 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Computation, 9: 1735–1780, 1997.
|
| 238 |
+
|
| 239 |
+
Bingyi Kang, Saining Xie, Marcus Rohrbach, Zhicheng Yan, Albert Gordo, Jiashi Feng, and Yannis Kalantidis. Decoupling representation and classifier for long-tailed recognition. In International Conference on Learning Representations, 2020.
|
| 240 |
+
|
| 241 |
+
Salman H. Khan, Munawar Hayat, Mohammed Bennamoun, Ferdous Ahmed Sohel, and Roberto Togneri. Cost-sensitive learning of deep feature representations from imbalanced data. IEEE Trans. Neural Networks Learn. Syst., 29(8):3573–3587, 2018.
|
| 242 |
+
|
| 243 |
+
Tsung-Yi Lin, Priya Goyal, Ross B. Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense ´ object detection. In IEEE International Conference on Computer Vision, pp. 2999–3007, 2017.
|
| 244 |
+
|
| 245 |
+
Jialun Liu, Jingwei Zhang, Wenhui Li, Chi Zhang, and Yifan Sun. Memory-based jitter: Improving visual recognition on long-tailed data with diversity in memory. CoRR, abs/2008.09809, 2020.
|
| 246 |
+
|
| 247 |
+
Ziwei Liu, Zhongqi Miao, Xiaohang Zhan, Jiayun Wang, Boqing Gong, and Stella X Yu. Large-scale long-tailed recognition in an open world. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2537–2546, 2019.
|
| 248 |
+
|
| 249 |
+
Jeffrey Pennington, Richard Socher, and Christopher D. Manning. GloVe: Global vectors for word representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing, pp. 1532–1543, 2014.
|
| 250 |
+
|
| 251 |
+
Li Shen, Zhouchen Lin, and Qingming Huang. Relay backpropagation for effective learning of deep convolutional neural networks. In Proceedings of the European Conference on Computer Vision, pp. 467–482, 2016.
|
| 252 |
+
|
| 253 |
+
Jingru Tan, Changbao Wang, Buyu Li, Quanquan Li, Wanli Ouyang, Changqing Yin, and Junjie Yan. Equalization loss for long-tailed object recognition. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11659–11668, 2020.
|
| 254 |
+
|
| 255 |
+
Grant Van Horn and Pietro Perona. The devil is in the tails: Fine-grained classification in the wild. CoRR, abs/1709.01450, 2017.
|
| 256 |
+
|
| 257 |
+
Saizheng Zhang, Emily Dinan, Jack Urbanek, Arthur Szlam, Douwe Kiela, and Jason Weston. Personalizing dialogue agents: I have a dog, do you have pets too? In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 2018.
|
| 258 |
+
|
| 259 |
+
Boyan Zhou, Quan Cui, Xiu-Shen Wei, and Zhao-Min Chen. BBN: Bilateral-branch network with cumulative learning for long-tailed visual recognition. CoRR, abs/1912.02413, 2019.
|
| 260 |
+
|
| 261 |
+
Xinge Zhu, Hui Zhou, Ceyuan Yang, Jianping Shi, and Dahua Lin. Penalizing top performers: Conservative loss for semantic segmentation adaptation. In Proceedings of the European Conference on Computer Vision, pp. 568–583, 2018.
|
| 262 |
+
|
| 263 |
+
# A VISUALIZATION OF EXAMPLE LIKELIHOOD
|
| 264 |
+
|
| 265 |
+
The complete comparison between the likelihood distribution for Eureka Loss, Cross-Entropy Loss, Focal Loss, Class-balanced Loss are shown in Figure 5. We see from the figure that the model trained with Eureka Loss gives high-confidence predictions for gold labels. Compared with the Cross-Entropy Loss, the Focal Loss diminish the contribution of high-likelihood examples, and the resulted model is unsure in the prediction of unseen examples. In particular, for the examples in the Few group, it almost produces no confident correct predictions. The Class-Balanced Loss, on the other hand, improves the confidence for the tail class examples but degrade the performance for the head class examples, which may imply potential issues regrading to natural performance in real-world applications. Besides, it is worth noting that the Decoupling-LWS obtains a likelihood distribution similar to the Class-Balanced Loss.
|
| 266 |
+
|
| 267 |
+
# B FURTHER RESULTS AND ANALYSIS
|
| 268 |
+
|
| 269 |
+
# B.1 RESULTS ON INATURALIST 2018 WITH TRAINING FOR 90 EPOCHS
|
| 270 |
+
|
| 271 |
+
It is found by existing work (Kang et al., 2020) that training much longer for the iNaturalist 2018 dataset can produce better scores and reflect the performance of the models more authentically. However, most previous studies conduct training for a shorter time. To keep consistent with previous research in this field, we also train the models using Eureka Loss for 90 epochs and the results are shown in Table 7. In this setting, eureka loss achieves better accuracy than the two-stage decoupling methods (Decoupling-LWS and BBN), the advantage is more profound under the Natural accuracy, for example, compared to the Decoupling-LWS, the deferred Eureka Loss gains 3.8 Natural accuracy. Compared to the one-state methods including Class-Balanced Loss (CB), Focal Loss (FL), ClassBalanced Focal Loss $\scriptstyle \left( \mathrm { F L + C B } \right)$ , LDAM, the model trained with the Eureka Loss is much more accurate on the test distribution.
|
| 272 |
+
|
| 273 |
+
# B.2 RESULTS ON LONG-TAILED CIFAR-10
|
| 274 |
+
|
| 275 |
+
In the main text, we have reported the results of the Eureka Loss varying the class imbalance on the CIFAR-100 dataset. Here we also perform comprehensive experiments on long-tailed CIFAR-10 and report top-1 precision on the balanced test set. The results are shown in the Table 8. When combined with Class-Balanced Loss, Eureka Loss brings higher improvement in terms of accuracy than Cross-Entropy Loss and LDAM.
|
| 276 |
+
|
| 277 |
+
# B.3 HYPER-PARAMETER OF THE FOCAL LOSS
|
| 278 |
+
|
| 279 |
+
In the paper, we report results for the Focal Loss with best hyper-parameters. For COCO detection, the hyper-parameter of $\alpha = 0 . 2 5 , \gamma = 2$ is the best setting reported in Table 1.b of the origin paper (Lin et al., 2017). For the other multi-class classification tasks, we tune hyper-parameters of the Focal Loss on it. The accuracy for the Focal Loss with different hyper-parameter $\gamma$ are listed in the Table1. we set $\gamma = 1$ for Focal Loss since it is consistently optimal in long-tailed image classification. For ConvAI2, $\gamma = 0 . 5$ under-performs Cross Entropy, and neither $\gamma = 1$ nor $\gamma = 2$ outperforms each other, so we report the Focal Loss of $\gamma = 1$ and the Focal Loss of $\gamma = 2$ in the Table 4.
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure 5: Example likelihood on the validation set of iNaturalist18 categorized by class frequencies into few, medium, many, and all.
|
| 283 |
+
|
| 284 |
+
# B.4 COMPLEMENTARY EXPERIMENT TO THE MOTIVATION EXPERIMENT
|
| 285 |
+
|
| 286 |
+
In Section 3, we propose Halted Focal Loss(HFL) and compare it to Focal Loss(FL) to illustrate the potential of the high-likelihood area. However, its loss is no steeper than Cross Entropy (CE). Moreover, Focal Loss does not beat CE in the setting of multi-class classification. In order to bridge the gap between the possibly weak motivation experiment of Halted Focal Loss and the proposed method Eureka Loss. We propose simplified Eureka Loss:
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
\mathcal { L } = \left\{ \begin{array} { l l } { - y \cdot \log p , } & { \mathrm { i f ~ } p _ { y } \leq \varphi } \\ { - y \cdot \log p + y \cdot [ \log ( 1 - p ) - b ] , } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
Table 7: Results on iNaturalist 2018 after training the model for 90 epochs. ∗ denotes results from the corresponding paper and † denotes that we use the base loss at the beginning of training and then adopt the method later. The proposed Eureka Loss achieves good results in learning both common and rare classes.
|
| 293 |
+
|
| 294 |
+
<table><tr><td>Method</td><td>All</td><td>Many</td><td>Medium</td><td>Few</td><td>All (Natural)</td></tr><tr><td>CE</td><td>61.8</td><td>72.2</td><td>63.4</td><td>57.2</td><td>69.8</td></tr><tr><td>FL</td><td>60.2</td><td>70.4</td><td>61.5</td><td>56.0</td><td>68.3</td></tr><tr><td>CB</td><td>52.4</td><td>51.9</td><td>53.0</td><td>51.8</td><td>51.2</td></tr><tr><td>RS</td><td>56.7</td><td>59.0</td><td>56.9</td><td>55.9</td><td>56.5</td></tr><tr><td>FL+CB (Cui et al., 2019)*</td><td>61.1</td><td></td><td>-</td><td>-</td><td>-</td></tr><tr><td>CE+CB† (Cao et al., 2019)*</td><td>63.7</td><td>=</td><td>=</td><td></td><td>1</td></tr><tr><td>LDAM (Cao et al., 2019)*</td><td>64.6</td><td></td><td></td><td></td><td></td></tr><tr><td>LDAM+CB† (Cao et al.,2019)*</td><td>68.0</td><td></td><td></td><td></td><td></td></tr><tr><td>LDAM+CB† (Zhou et al., 2019)*</td><td>64.6</td><td>-</td><td>=</td><td>=</td><td></td></tr><tr><td>BBN (Zhou et al.,2019)*</td><td>66.3</td><td>=</td><td>=</td><td>-</td><td>=</td></tr><tr><td>Decoupling-LWs (Kang et al., 2020)*</td><td>65.9</td><td>65.0</td><td>66.3</td><td>65.5</td><td>65.7</td></tr><tr><td>Eureka Loss</td><td>66.4</td><td>67.5</td><td>66.5</td><td>65.9</td><td>67.9</td></tr><tr><td>Eureka Loss†</td><td>67.1</td><td>69.4</td><td>67.3</td><td>66.1</td><td>69.5</td></tr></table>
|
| 295 |
+
|
| 296 |
+
Table 8: Results on long-tailed CIFAR-10 data with different imbalance degrees. ID is short for imbalance degree. † is defined similarly; $\clubsuit$ denotes Zhou et al. (2019); $\spadesuit$ denotes Cao et al. (2019).
|
| 297 |
+
|
| 298 |
+
<table><tr><td>Method</td><td>ID-100</td><td>ID-50</td><td>ID-10</td></tr><tr><td>CE+RSt+</td><td>75.61</td><td>79.81</td><td>87.38</td></tr><tr><td>CE+CB++</td><td>76.34</td><td>79.97</td><td>87.56</td></tr><tr><td>LDAM+CB†+</td><td>77.03</td><td>81.03</td><td>88.16</td></tr><tr><td>BBNt</td><td>79.82</td><td>82.18</td><td>88.32</td></tr><tr><td>EL + CB†</td><td>77.95</td><td>82.00</td><td>88.35</td></tr></table>
|
| 299 |
+
|
| 300 |
+
where $\varphi$ is set to 0.5, and $b$ is $l o g ( 1 - \varphi )$ . In the simplified Eureka Loss, the encouragement is removed, and to keep the low-likelihood area unchanged, the new bonus term starts rewarding the model from $p = \varphi$ . As is shown in Table $\lvert 0 , \mathrm { H F L } ( { \mathsf { t } } { = } 0 . 5 )$ is also better than HFL and FL in terms accuracy of tail classes on the large scale long-tailed classification dataset iNaturalist 2018, This result once again shows that high-likelihood area matters and near-correct predictions of rare classes play a major role. But HFL is the combination of Focal Loss(in the low likelihood area) and Cross Entropy(in the high-likelihood area) and the performance is constrained. Unlike HFL, the loss of Simplified Eureka Loss is built on CE and the loss is much steeper than Cross Entropy in the high-likelihood area, it outperforms Cross Entropy(CE) and HFL in terms of all metrics, especially on the subset of tail classes. Eureka Loss reported in Table 2 is a continuous version of simplified Eureka Loss with an additional encouragement for rare classes, similar to $\mathrm { H F L } ( \mathrm { t } { = } 0 . 5 )$ , this setting which rewards more for rare classes achieves the best overall performance.
|
| 301 |
+
|
| 302 |
+
# B.5 EUREKA LOSS MITIGATES OVER-FITTING ON TAIL CLASSES
|
| 303 |
+
|
| 304 |
+
As shown in Figure 6, compared to Cross-Entropy Loss, Eureka Loss reduce the gap between the training accuracy and test accuracy from 33.0 to 28.6 on tail classes. Moreover, even though Classbalanced Loss achieves the highest training accuracy, its test accuracy is unexpectedly low. The difference of performance between the seen examples and the unseen examples indicates the degree of over-fitting. The results are from the “Few” subset of the iNaturalist 2018 of training 90 epochs.
|
| 305 |
+
|
| 306 |
+
Table 9: Mean/(standard deviation) test accuracy of the Focal Loss with different hyper-parameter $\gamma$ in long-tailed image classification.
|
| 307 |
+
|
| 308 |
+
<table><tr><td>Y</td><td>CIFAR10</td><td>Imagenet-LT</td><td>iNaturalist20182</td></tr><tr><td>0.5</td><td>21.2/10.8</td><td>8.3/7.1</td><td>9.2/3.2</td></tr><tr><td>1</td><td>70.8/0.6</td><td>43.8/0.3</td><td>60.2/0.3</td></tr><tr><td>2</td><td>70.3/0.6</td><td>43.6/7.9</td><td>59.5/0.2</td></tr></table>
|
| 309 |
+
|
| 310 |
+
Table 10: Comparison between the Halted Focal Loss and the Simplified Eureka Loss on long-tailed Cifar-10 (imbalance ratio is 100) and iNaturalist 2018, the mean standard deviation (Stdev) for results on iNaturalList2018 is about 0.4.
|
| 311 |
+
|
| 312 |
+
<table><tr><td rowspan="2">method Mean/Stdev</td><td rowspan="2">CIFAR10</td><td colspan="5">iNaturalList2018</td></tr><tr><td>All</td><td>Many</td><td> Medium</td><td>Few</td><td> All(natural)</td></tr><tr><td>CE</td><td>71.4/0.5</td><td>64.3</td><td>74.1</td><td>65.9</td><td>59.8</td><td>71.7</td></tr><tr><td>FL</td><td>71.3/0.6</td><td>62.9</td><td>72.9</td><td>64.1</td><td>58.8</td><td>70.7</td></tr><tr><td>HFL</td><td>71.4/0.3</td><td>63.6</td><td>73.1</td><td>64.6</td><td>59.7</td><td>70.7</td></tr><tr><td>HFL(t=0.5)</td><td>71.8/0.5</td><td>64.2</td><td>73.3</td><td>64.3</td><td>61.6</td><td>70.8</td></tr><tr><td>Simplified EL</td><td>71.8/0.9(+0.4)</td><td>66.3(+2.0)</td><td>75.1 (+1.0)</td><td>67.4(+1.6)</td><td>62.6(+2.8)</td><td>72.6(+1.1)</td></tr></table>
|
| 313 |
+
|
| 314 |
+
# C DETAILS OF EXPERIMENTAL SETTINGS
|
| 315 |
+
|
| 316 |
+
# C.1 DATASETS
|
| 317 |
+
|
| 318 |
+
There are six datasets used in this paper in total and an overview of the dataset statistics are demontrated in Table 11 and Figure 7. For image classification tasks, the iNaturalist 2018 dataset is the most imbalanced and has the most classes, which is most satisfactory for evaluating long-tailed classifications. For the language generation task, ConvAI2 has an imbalance ratio of 277K, which, however, should be taken cautiously, since most of the tail classes are not covered in evaluation. The common practice to evaluate the learning on the imbalanced language distributions is to investigate the diversity of the generated text. The 4-grams can be regarded as high-ordered classes and a 4-gram of four common words can also be a “rare class”.
|
| 319 |
+
|
| 320 |
+
# C.2 TRAINING SETTINGS
|
| 321 |
+
|
| 322 |
+
CIFAR-10 and CIFAR-100 For experiments on long-tailed CIFAR-10 and CIFAR-100, the backbone network is ResNet-32 (He et al., 2016). The model is optimized with SGD with a momentum of 0.9. The learning rate is set to 0.1 and the model is trained for 200 epochs with 128 examples per mini-batch. To stabilize the training, we adopt the warm-up strategy used by Goyal et al. (2017) in the first 5 epochs. Following Cao et al. (2019), we decay the learning rate by 0.01 at the 160th epoch and again at the 180th epoch. For the results in Figure 2 and Figure 3, we conduct experiments on long-tailed CIFAR-10 with an imbalance ratio of 10.
|
| 323 |
+
|
| 324 |
+
ImageNet-LT For experiments on ImageNet-LT ILSVRC 2012, the base network is ResNext50 (He et al., 2016). The batch size is set to 512 to accelerate training. The initial learning rate is 0.2 and we utilize a cosine learning rate scheduler.
|
| 325 |
+
|
| 326 |
+
iNaturalist 2018 Same as the experiments on ImageNet-LT, we also follow the default setting in Kang et al. (2020) for experiments on iNaturalist. To be specific, we adopt ResNet-50 model, use SGD with to train the model for 200 epochs with batch size 512 and a cosine learning rate schedule which gradually decays from 0.2 to 0.0. Results on the valid set are also reported on subset of many $( > 1 0 0$ samples), medium $( 2 0 - 1 0 0$ samples), and few $< 2 0$ samples), respectively.
|
| 327 |
+
|
| 328 |
+
ConvAI2 For the conversation generation task, we utilize a two-layer LSTM (Hochreiter & Schmidhuber, 1997) encoder-encoder architecture as our base network. The hidden size of both encoder and decoder is set to 1024. We optimize the model with SGD optimizer with momentum 0.9, the batch size is 64 and the learning rate is set to 3. The embedding size is 256 and word vectors are initialized with GloVe (Pennington et al., 2014). We select our final model until the performance on the validation is no longer improving after 5 epochs.
|
| 329 |
+
|
| 330 |
+

|
| 331 |
+
Figure 6: Illustration of the over-fitting phenomenon on tail classes, the number on the top of each bar is the difference between the training accuracy and the test accuracy.
|
| 332 |
+
|
| 333 |
+
Table 11: Data statistics of long-tailed image classification tasks. Imbalance Ratio denotes the ratio of the size of the most common class to that of the rarest class.
|
| 334 |
+
|
| 335 |
+
<table><tr><td>Dataset</td><td># Classes</td><td>Imbalance Ratio</td></tr><tr><td>COCO Detection</td><td>2</td><td>~1000</td></tr><tr><td>Long-tailed CIFAR-10</td><td>10</td><td>10-100</td></tr><tr><td>Long-tailed CIFAR-100</td><td>100</td><td>10-100</td></tr><tr><td>ImageNet-LT</td><td>1000</td><td>256</td></tr><tr><td>iNaturalist 2018</td><td>8142</td><td>500</td></tr></table>
|
| 336 |
+
|
| 337 |
+

|
| 338 |
+
Figure 7: Word frequency distribution of ConvAI2 dataset. For natural language generation tasks, each word type can be regarded as a class and most words appear scarcely in the data. If measured the same with long-tailed image classification tasks, the imbalance ratio is 277K.
|
| 339 |
+
|
| 340 |
+
COCO Dectection For experiments on COCO detection, we adopt the configuration of “RetinaNetR-50-FPN-1x” from the GitHub repository Detectron2 as our default setting. In this setting, the one-stage detector of RetinaNet with the backbone ResNet50 is trained for $9 0 \mathrm { k }$ updates and the batch size is 8 images per batch.
|
| 341 |
+
|
| 342 |
+
For the image classification tasks, the default $\beta$ is set to 0.9999 for all datasets. For the deferred version, we defer the adoption of Eureka Loss after training for 160 epochs and 180epochs on CIFAR100 and iNaturalist 2018 respectively. As for the dialog generation task ConvAI2, $\beta$ is set to 0.999 and we start the encouragement after regularly training the model for 5 epochs.
|
| 343 |
+
|
| 344 |
+
We tune the $\beta \in \{ 0 . 9 , 0 . 9 9 , 0 . 9 9 9 , 0 . 9 9 9 9 \}$ and $\gamma \in \{ 0 . 5 , 1 , 2 \}$ for the Class-Balanced Loss (CB) and the Focal Loss (FL) respectively in multi-class classification, and report the best results of these baselines. Following previous work (Cui et al., 2019), $\alpha$ is set to 1.0 for the Focal Loss(FL), and the Class-Balanced Focal Loss $\mathrm { ( F L + C B ) }$ ) in multi-class classification tasks can be viewed as the origin Focal Loss with class-level weight $\alpha$ in binary classification tasks.
|
| 345 |
+
|
| 346 |
+
The training costs are summarized in Table 12.
|
| 347 |
+
|
| 348 |
+
<table><tr><td>Data</td><td>Infrastructure</td><td>Mem/GPU</td><td>Time</td><td>Epochs</td><td>Samples</td><td>Model</td></tr><tr><td>Long-tailed CIFAR-10</td><td>RTX 2080Ti *1</td><td>1.4G</td><td>0.3h</td><td>200</td><td>12.4K</td><td>ResNet32</td></tr><tr><td>Long-tailed CIFAR-100</td><td>RTX 2080Ti *1</td><td>1.4G</td><td>0.3h</td><td>200</td><td>10.8K</td><td>ResNet32</td></tr><tr><td>ImageNet-LT</td><td>TITAN RTX *4</td><td>17G</td><td>8h</td><td>90</td><td>116K</td><td>ResNext50</td></tr><tr><td>iNaturalist 2018</td><td>RTX TITAN *4</td><td>15G</td><td>48h</td><td>200</td><td>438K</td><td>ResNet50</td></tr><tr><td>ConvAI2</td><td>RTX 2080Ti *1</td><td>9G</td><td>4h</td><td>16</td><td>131K</td><td>2-L LSTM</td></tr><tr><td>COCO Detection</td><td>RTX 2080Ti * 4</td><td>9G</td><td>8h</td><td>90K updates</td><td>118K</td><td>ResNet50</td></tr></table>
|
| 349 |
+
|
| 350 |
+
Table 12: Training costs of each task. Samples are dialogues in ConvAI2 and images in image classification tasks
|
md/train/B1lDoJSYDH/B1lDoJSYDH.md
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LAGRANGIAN FLUID SIMULATION WITH CONTINUOUS CONVOLUTIONS
|
| 2 |
+
|
| 3 |
+
Benjamin Ummenhofer Intel Labs
|
| 4 |
+
|
| 5 |
+
Lukas Prantl & Nils Thuerey Technical University of Munich
|
| 6 |
+
|
| 7 |
+
Vladlen Koltun Intel Labs
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
We present an approach to Lagrangian fluid simulation with a new type of convolutional network. Our networks process sets of moving particles, which describe fluids in space and time. Unlike previous approaches, we do not build an explicit graph structure to connect the particles but use spatial convolutions as the main differentiable operation that relates particles to their neighbors. To this end we present a simple, novel, and effective extension of N-D convolutions to the continuous domain. We show that our network architecture can simulate different materials, generalizes to arbitrary collision geometries, and can be used for inverse problems. In addition, we demonstrate that our continuous convolutions outperform prior formulations in terms of accuracy and speed.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Understanding physics can help reasoning about our environment and interacting with it. Neural networks have emerged as a particularly promising approach to capture the complexity of natural phenomena from data (Ling et al., 2016; Tompson et al., 2017; Morton et al., 2018). An important aspect of learning physics with neural networks is the choice of representation. Lagrangian representations based on particles are particularly popular and have supported recent results with rigid bodies, deformable solids, and fluids (Battaglia et al., 2016; Mrowca et al., 2018; Li et al., 2019). Many of these approaches use graph structures to define interactions; the existence of an edge determines in a binary fashion whether two particles interact.
|
| 16 |
+
|
| 17 |
+
However, a wide range of physical processes such as fluid mechanics are described by continuous partial differential equations rather than discrete graph structures. The continuous, volumetric, and tightly coupled nature of these processes causes inherent difficulties for graph-based approaches, such as a large number of edge connections that must be established, tracked, and disengaged as the particles move. In this work, instead of using graphs as the underlying representation, we adopt a continuous viewpoint. We propose to use convolutional networks (ConvNets) with continuous convolutions on particles for learning fluid mechanics. We treat fluids as spatially continuous functions sampled at a finite set of (continuously evolving) positions and process them with a novel continuous convolution layer. This matches the continuous nature of the problem more closely and simplifies the definition of neural networks by abstracting the underlying particle representation.
|
| 18 |
+
|
| 19 |
+
We extend the grid-based filter representation commonly used for discrete convolutions to the continuous domain by simple linear interpolation. Linear interpolation of the filters allows efficient lookup of spatially varying filter values at arbitrary positions while retaining the compactness and efficiency of the grid representation. In addition, we use a window function to define the support of the filters and a ball-to-cube mapping to support spherical receptive fields. We show that our convolutions, despite their simplicity, perform better than more sophisticated representations (Wang et al., 2018; Schenck & Fox, 2018).
|
| 20 |
+
|
| 21 |
+
With the presented continuous convolution layer, we develop an efficient ConvNet architecture for learning fluid mechanics. The network processes sets of particles. We use dynamic particles to represent the fluid and static particles to describe the boundary of the scene. Modeling the scene boundary with particles makes it easy to apply our network to new scenes and allows the network to learn collision handling in a unified framework. Our network generalizes to arbitrary obstacle configurations and can simulate a range of material behavior. To demonstrate the usefulness of a learned – and hence differentiable – fluid simulator, we show that material properties can be estimated from observed simulation data. Experimental results indicate that the presented approach outperforms a state-of-the-art graph-based framework (Li et al., 2019).
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
Fluids encompass a range of materials that are important in everyday life and throughout science and engineering (Wilcox, 2006). A prominent set of methods, known as Smoothed Particle Hydrodynamics (SPH), employs a Lagrangian viewpoint to simulate these phenomena. SPH originated in particle-based models for astrophysics (Gingold & Monaghan, 1977) and has become extremely popular for simulating complex flows in many fields of science (Monaghan, 1988). Among others, it has been highly successful for modeling interface flows (Colagrossi & Landrini, 2003), complex multi-phase phenomena (Hu & Adams, 2006), and even magnetohydrodynamics (Price, 2012).
|
| 26 |
+
|
| 27 |
+
SPH and its variants have been widely used to model complex real-world phenomena for visual effects. Following the earlier development of physics-based fluid simulation for special effects by Foster & Metaxas (1996), the introduction of SPH (Muller et al., 2003) has led to a large class of ¨ powerful algorithms (Solenthaler & Pajarola, 2009; Bender & Koschier, 2015). These applications often involve complex geometries at large scales, and extensions such as FleX (Macklin et al., 2014) and pressure-aware rigid-body coupling (Gissler et al., 2018) broaden the framework to encompass many physical phenomena.
|
| 28 |
+
|
| 29 |
+
Lagrangian flows have also been considered in machine learning. The pioneering work of Ladicky´ et al. (2015) demonstrated that flow representations can be learned with regression forests. CNNs were used by Tompson et al. (2017) to accelerate the expensive pressure correction step of gridbased solvers, while other works have focused on super-resolution (Xie et al., 2018), learning time evolution via the Koopman operator (Morton et al., 2018), and learning reduced representations (Wiewel et al., 2019; Kim et al., 2019). Differentiable SPH solvers were proposed to solve control tasks for robotic applications (Schenck & Fox, 2018). Generic physics simulations for Lagrangian rigid and deformable bodies were considered in a series of works that developed graph-based representations (Battaglia et al., 2016; Sanchez-Gonzalez et al., 2018). Such graph-based representations were recently applied directly to fluid simulation (Mrowca et al., 2018; Li et al., 2019). We share with these recent works the goal of modeling Lagrangian fluids with differentiable neural networks, but take a different tack: rather than using graph-based representations, we work with point clouds and continuous convolutions over the spatial domain.
|
| 30 |
+
|
| 31 |
+
From a technical perspective, our approach is also related to existing works that apply convolutions on point clouds. A number of methods transferred the convolution concept to point clouds in the context of semantic classification and segmentation of 3D objects (Hua et al., 2018; Atzmon et al., 2018; Hermosilla et al., 2018; Li et al., 2018; Su et al., 2018; Wu et al., 2019; Xu et al., 2018; Lei et al., 2019). Particularly notable in our context is the work of Wang et al. (2018), who used continuous convolutions to compute the scene flow between two point clouds, and the aforementioned work of Schenck & Fox (2018), who used convolutions to implement a differentiable version of position-based fluids (Macklin & Muller, 2013). Both works define continuous convolution opera- ¨ tors that can support regression tasks and we compare to them directly in Section 6. Most closely related to our filter representation is the work of Fey et al. (2018). They use B-splines to define continuous filters and propose to use spherical coordinates to implement spherical receptive fields. Spherical coordinates are problematic due to singularities and require special treatment, which we avoid with a ball-to-cube mapping. Furthermore, the output of the operator of Fey et al. (2018) can be discontinuous. We show in our ablation study in Section 6 that applying a window function to guarantee a continuous output is advantageous for our task.
|
| 32 |
+
|
| 33 |
+
# 3 BASICS
|
| 34 |
+
|
| 35 |
+
Fluids have been studied for centuries, and the Navier-Stokes equations for incompressible fluids are well established (Batchelor, 1967):
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\frac { \partial { \bf v } } { \partial t } + { \bf v } \cdot \nabla { \bf v } = - \frac { 1 } { \rho } \nabla p + \nu \nabla ^ { 2 } { \bf v } + { \bf g } , ~ \mathrm { s . t . } ~ \nabla \cdot { \bf v } = 0 .
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
A common approach to solve these partial differential equations is to approximate the fluid with a set of smooth particles (Monaghan, 1988). Each particle corresponds to a continuous blob of matter and carries the local properties of the fluid, such as velocity and density, which move with the flow. This is motivated by the fact that a function $A ( \mathbf { x } )$ can be represented by an integral interpolation
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
A ( \mathbf { x } ) = \int A ( \mathbf { x } ^ { \prime } ) \delta ( \| \mathbf { x } - \mathbf { x } ^ { \prime } \| _ { 2 } ) d V ( \mathbf { x } ^ { \prime } ) ,
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $\delta ( x )$ denotes the Dirac delta function. This equation can be discretized as
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
A ( { \bf x } ) \approx \sum _ { i } V _ { i } A _ { i } W ( \| { \bf x } - { \bf x } ^ { \prime } \| _ { 2 } , h ) ,
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $V _ { i }$ is the volume at the given point in space and
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\operatorname* { l i m } _ { h \to 0 } W ( | \mathbf x - \mathbf x ^ { \prime } | , h ) = \delta ( | \mathbf x - \mathbf x ^ { \prime } | ) .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
Here $W ( x , h )$ is a smooth kernel or convolution with radius $h$ , usually in the form of a Gaussian distribution, but more complex functions can also be used. In practice, the kernel is finite and yields localized neighborhoods of particles that interact via interactions weighted by the kernel of its derivatives. In this way, the continuous description for fluids from Equation 1 can be discretized in a Lagrangian fashion and solved numerically. Typically, internal forces are calculated based on the local pressure, viscosity, and surface tension, which give an update for the position of each particle. Below, we adopt the position-based fluids (PBF) method (Macklin & Muller, 2013; Macklin et al., ¨ 2014), which likewise is based on SPH, but reformulates the updates as constraints on the positions.
|
| 60 |
+
|
| 61 |
+
# 4 CONTINUOUS CONVOLUTIONS
|
| 62 |
+
|
| 63 |
+
The discrete convolution operator as commonly used in ConvNets is defined as
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
( f * g ) ( \mathbf { x } ) = \sum _ { \tau \in \Omega } f ( \mathbf { x } + \pmb { \tau } ) g ( \pmb { \tau } ) ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $f$ and $g$ are the input and the filter function, $\mathbf { x }$ is the position, $\tau$ is the shift vector, and $\Omega$ is the set of shift vectors that defines the support of the filter function. On regular data such as images, the positions $\mathbf { x }$ range over a regular grid and the shift vectors $\tau$ are integer-valued, i.e. $\mathbf { x } , \tau \in \overline { { \mathbb { Z } } } ^ { \dot { d } }$ for some dimensionality $d$ . Analogously in the continuous domain, this convolution is defined as
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
( f * g ) ( \mathbf { x } ) = \int _ { \mathbb { R } ^ { d } } f ( \mathbf { x } + \pmb { \tau } ) g ( \pmb { \tau } ) d \pmb { \tau } ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $\mathbf { x }$ and $\tau$ are real-valued vectors, i.e. $\mathbf { x } , \tau \in \mathbb { R } ^ { d }$ .
|
| 76 |
+
|
| 77 |
+
We now adapt this definition to unstructured point clouds. In this setting we have a finite number of points that sample the function $f$ but do not lie on a grid. For a point cloud with $i = 1 , . . , N$ points with values $f _ { i }$ at positions $\mathbf { x } _ { i }$ , we define the convolution at position $\mathbf { x }$ as
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
( f * g ) ( \mathbf { x } ) = \frac { 1 } { \psi ( \mathbf { x } ) } \sum _ { i \in N ( \mathbf { x } , R ) } a ( \mathbf { x } _ { i } , \mathbf { x } ) \ f _ { i } \ g ( \Lambda ( \mathbf { x } _ { i } - \mathbf { x } ) ) .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
$\mathcal { N } ( { \bf x } , R )$ is the set of points within a radius $R$ around $\ \textbf { x } , \ a$ is a scalar function that can be used for density normalization specific to the points $\mathbf { x } _ { i }$ and $\mathbf { x }$ as in Hermosilla et al. (2018). In the simplest case, $a$ can be constant: $a = 1$ . In our case we want to ensure a smooth response of our convolution under varying particle neighborhoods, therefore we define $a$ as a window function:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
a ( \mathbf x _ { i } , \mathbf x ) = \left\{ \begin{array} { l l } { \left( 1 - \frac { \| \mathbf x _ { i } - \mathbf x \| _ { 2 } ^ { 2 } } { R ^ { 2 } } \right) ^ { 3 } } & { \mathrm { f o r } \| \mathbf x _ { i } - \mathbf x \| _ { 2 } < R } \\ { 0 } & { \mathrm { e l s e } . } \end{array} \right.
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
A similar function has been used by Muller et al. (2003) in the SPH framework. ¨ $\psi$ is another scalar function for normalization, which can be set in our implementation as either
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\psi ( \mathbf { x } ) = 1 \quad \mathrm { o r } \quad \psi ( \mathbf { x } ) = \sum _ { i \in \mathcal { N } ( \mathbf { x } , R ) } a ( \mathbf { x } _ { i } , \mathbf { x } ) .
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 1: We use spherical filter shapes for our continuous convolutions but use regular grids to store the filter values. The left part of the figure shows a spherical region with radius $R$ and a point with relative coordinates r with respect to the center. We transform r via a mapping $\Lambda$ to normalized coordinates in a regular grid. The thin dotted lines illustrate the distortion of the mapping. To look up the final filter value we use trilinear interpolation in the regular grid.
|
| 97 |
+
|
| 98 |
+
We use $\psi ( \mathbf { x } ) = 1$ , since changes in the density of particles are an important feature for simulating fluids.
|
| 99 |
+
|
| 100 |
+
For the filter function $g$ we simply use a regular grid to store the filter values but use linear interpolation to make $g$ a continuous function. In addition, we use a mapping $\Lambda ( \mathbf { r } )$ of a unit ball to a unit cube to implement spherical filters as shown in Figure 1. We use the mapping described by Griepentrog et al. (2008) and give the detailed function in the appendix. The intermediate coordinate mapping $\Lambda$ provides the flexibility to implement different spatial shapes while keeping the advantages of a regular grid for the storage and lookup of filter values.
|
| 101 |
+
|
| 102 |
+
Note that Equation 7 uses a similar approximation as in the SPH framework (Equation 3). Assuming that each point represents the same volume, $V _ { i }$ is a constant factor in Equation 3, which we drop in our definition.
|
| 103 |
+
|
| 104 |
+
# 5 LEARNING FLUID MECHANICS WITH CONVOLUTIONAL NETWORKS
|
| 105 |
+
|
| 106 |
+
Our goal is to learn fluid mechanics from observing the motion of particles. The input to our ConvNet is a set of particles with corresponding features. Since position itself is not a feature but simply defines the particle’s position in space, we must assign a feature vector to each particle. The feature vector we use is a constant scalar 1 accompanied by the velocity $\mathbf { v }$ and the viscosity $\nu$ . A particle $p _ { i } ^ { n }$ at timestep $n$ with its position and input feature vector is thus a tuple $\left( \mathbf { x } _ { i } ^ { n } , \left[ 1 , \mathbf { v } _ { i } ^ { n } , \nu _ { i } \right] \right)$ . Defining the velocity explicitly as an input feature allows us to compute intermediate velocities and positions as in Ladicky et al. (2015) and to apply external forces and pass this information to the ´ network. We compute the intermediate positions $\mathbf { x } _ { i } ^ { n * }$ and velocities $\mathbf { v } _ { i } ^ { n * }$ beginning with timestep $n$ with Heun’s method as
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\begin{array} { r l } & { \mathbf { v } _ { i } ^ { n * } = \mathbf { v } _ { i } ^ { n } + \Delta t \mathbf { a } _ { \mathrm { e x t } } } \\ & { \mathbf { x } _ { i } ^ { n * } = \mathbf { x } _ { i } ^ { n } + \Delta t \frac { \mathbf { v } _ { i } ^ { n } + \mathbf { v } _ { i } ^ { n * } } { 2 } . } \end{array}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
The vector $\mathbf { a } _ { \mathrm { e x t } }$ is an acceleration through which we can apply external forces to control the fluid or to simply apply gravity. The intermediate positions and velocities lack any interactions between particles or the scene, which we are going to implement with a ConvNet. To enable the network to handle collisions with the environment we define a second set of static particles $s _ { j }$ . We sample particles on the boundaries of the scene with normals $\mathbf { n } _ { j }$ as the feature vectors, i.e. $s _ { j } ^ { \mathsf { ^ { \prime } } } = ( \mathbf { x } _ { j } , [ \mathbf { n } _ { j } ] )$ . Our network implements the function
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
[ \Delta { \bf x } _ { 1 } , \ldots , \Delta { \bf x } _ { N } ] = \mathrm { C o n v N e t } ( \{ p _ { 1 } ^ { n * } , \ldots , p _ { N } ^ { n * } \} , \{ s _ { 1 } , \ldots , s _ { M } \} ) ,
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
which uses convolutions to combine features from both particle sets. $\Delta \mathbf { x }$ is a correction of the position which accounts for all particle interactions including the collision handling with the scene. Finally, we apply the correction to update positions and velocities for $n + 1$ as
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\begin{array} { r l } & { \mathbf { x } _ { i } ^ { n + 1 } = \mathbf { x } _ { i } ^ { n * } + \Delta \mathbf { x } _ { i } } \\ & { \mathbf { v } _ { i } ^ { n + 1 } = \frac { \mathbf { x } _ { i } ^ { n + 1 } - \mathbf { x } _ { i } ^ { n } } { \Delta t } . } \end{array}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Note that the updated position $\mathbf { x } _ { i } ^ { n + 1 }$ depends on the output vector $\Delta { { \bf { x } } _ { i } }$ and allows us to directly define our learning objective on the particle positions.
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 2: Schematic of our network with a depth of four. In the first depth level we compute convolutions at each dynamic particle location with the set of static particles that defines the environment as well as the dynamic particle set. We also directly process the features of each particle via a fully-connected stream. In the following levels, we compute convolutions only on the dynamic particles. At each level we use addition to aggregate the features computed by convolutions and fully-connected layers. Between the second and third level we also include a residual connection. The final level generates the position correction $\Delta \mathbf { x }$ . Operations annotated with a \* are followed by the ReLU activation function. All CConv and FC operations use an additive bias.
|
| 128 |
+
|
| 129 |
+
# 5.1 NETWORK ARCHITECTURE
|
| 130 |
+
|
| 131 |
+
We use a simple convolutional architecture with an effective depth of four. An overview of the network is shown in Figure 2. Since we want to compute the correction for all dynamic particles in our scene, we compute convolutions for the intermediate positions defined in Equation 11. Our network is a sequence of continuous convolutions (CConv), which are defined by an input particle set, the positions at which we want to evaluate the convolution, its filters $G$ , and the radius $R$ . For instance, to describe a convolution on the static particles $s _ { i }$ at intermediate positions $\mathbf { x } _ { i } ^ { n * }$ we can write
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
[ { \bf f } _ { 1 } , \ldots , { \bf f } _ { N } ] = \mathrm { C C o n v } ( \{ s _ { 1 } , \ldots , s _ { M } \} , [ { \bf x } _ { 1 } ^ { n * } , \ldots , { \bf x } _ { N } ^ { n * } ] , G , R ) ,
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
where $\mathbf { f } _ { i }$ are the computed output features for each position $\mathbf { x } _ { i } ^ { n * }$ . $G$ is a 5D array storing all filters in the layout [width, height, depth, $\mathrm { c h } _ { \mathrm { i n } } , \mathrm { c h } _ { \mathrm { o u t } } ]$ . In contrast to discrete convolutions on a regular grid, the spatial filter dimensions here do not define the receptive field but the resolution of the filters. The receptive field depends only on the radius $R$ , which specifies the spatial extent. Throughout our network we use filters with a spatial resolution of [4, 4, 4] and a radius of 4.5 times the particle radius.
|
| 138 |
+
|
| 139 |
+
For convolutions within the dynamic particles we exclude the particle at which we evaluate the convolution and instead process the particle’s own features in a stream of fully-connected layers. After each depth level we then combine the result from the convolutions and the fully-connected layers by addition. This can be interpreted as a convolution with a spatial resolution of $4 \times 4 \times 4 + 1$ . We found that this design improves accuracy and allows us to use smaller filters with even sizes (see Table 2).
|
| 140 |
+
|
| 141 |
+
# 5.2 TRAINING PROCEDURE
|
| 142 |
+
|
| 143 |
+
We train our fluid simulation network in supervised fashion based on particle trajectories produced by classic (“ground-truth”) physics simulation. Our loss is defined as follows:
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\mathcal { L } ^ { n + 1 } = \sum _ { i = 1 } ^ { N } \phi _ { i } \left. \mathbf { x } _ { i } ^ { n + 1 } - \hat { \mathbf { x } } _ { i } ^ { n + 1 } \right. _ { 2 } ^ { \gamma } .
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
The ground-truth position at timestep $n + 1$ is denoted by $\hat { \mathbf { x } } _ { i } ^ { n + 1 }$ and the predicted position from the network is denoted by $\mathbf { x } _ { i } ^ { n + 1 } = \mathbf { x } _ { i } ^ { n * } + \Delta \mathbf { x } _ { i }$ , where $\Delta { { \bf { x } } _ { i } }$ is provided by the network. $\phi _ { i }$ is an individual weight for each point. We use $\begin{array} { r } { \phi _ { i } = \exp ( - \frac { 1 } { c } | \mathcal { N } ( \mathbf { x } _ { i } ^ { n * } ) | ) } \end{array}$ , which emphasizes the loss for particles with fewer neighbors. We choose $c = 4 0$ , which corresponds to the average number of neighbors across our experiments. Particles with few neighbors are close to the surface or interact with the scene boundary. Both cases are important for fluid simulation because particles near the surface define the liquid-air interface, which is particularly salient, and particles near the scene boundary require collision handling. The parameter $\gamma = 0 . 5$ makes our loss function more sensitive to small particle motions, which is important for increasing the accuracy and visual fidelity for small fluid flows. During training we predict particle positions for two future timesteps, namely $n + 1$ and $n + 2$ . The combined loss $\mathcal { L }$ is
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 3: Comparison to ground-truth physics simulation. Two fluid bodies collide. Top: simulation by our trained network. Bottom: simulation of the same scenario by DFSPH (Bender & Koschier, 2015), a high-fidelity solver that was executed with small timesteps (down to 0.001s). Despite using a much larger timestep (0.02s), our convolutional network produces results of comparable visual fidelity. Note that our particles are falling slightly more slowly due to differences in the integration of positions and the much larger timestep. See the supplementary video.
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
{ \mathcal { L } } = { \mathcal { L } } ^ { n + 1 } + { \mathcal { L } } ^ { n + 2 } .
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
We found that optimizing a loss defined over two frames improves the overall quality of the simulation. (Optimization for three frames did not result in further improvements.) We optimize $\mathcal { L }$ over 50,000 iterations with Adam (Kingma & Ba, 2015) and a learning rate decay with multiple steps, starting with a learning rate of 0.001 and stopping with $1 . 5 6 \cdot 1 0 ^ { - 5 }$ .
|
| 159 |
+
|
| 160 |
+
# 5.3 DATASETS
|
| 161 |
+
|
| 162 |
+
We have trained our network on multiple datasets. For quantitative comparisons with prior work we trained our network on the dam break data from Li et al. (2019). The scene simulates the behavior of a randomly placed fluid block in a static box. We generate 2000 scenes for training and 300 for testing. The data was generated with FleX, which is a position-based simulator that targets real-time applications (Macklin et al., 2014).
|
| 163 |
+
|
| 164 |
+
We also trained our network on more challenging data generated with DFSPH (Bender & Koschier, 2015), which prioritizes simulation fidelity over runtime. DFSPH can generate accurate fluid flows with very low volume compression: a desired property. We generate ground-truth data by randomly placing multiple bodies of fluid in 10 different box-like scenes and simulating them for 16 seconds each with an adaptive timestep of up to $1 \mathrm { k H z }$ . The time resolution of the generated data is $5 0 \mathrm { { H z } }$ . We show a qualitative comparison of our method to the ground truth in Figure 3. We generate 200 scenes for training and 20 scenes for the test set. To train networks that can deal with multiple materials, we additionally generate 200 scenes with fluids of varying viscosity. For estimating material properties, we generate 7 test scenes that only differ in the viscosity parameter.
|
| 165 |
+
|
| 166 |
+
# 6 EVALUATION
|
| 167 |
+
|
| 168 |
+
Baselines. We compare our method to DPI-Nets (Li et al., 2019), which were previously shown to significantly outperform prior formulations such as hierarchical relation networks (Mrowca et al., 2018). Figure 4 provides a qualitative comparison. Quantitative results are reported in Table 1. To analyze the accuracy of the forward step for each method, we compute the average error of the particle positions with respect to the ground truth. We use every $5 ^ { \mathrm { t h } }$ frame for initialization and compute the deviation from the ground truth for two subsequent frames, denoted by $n + 1$ and $n + 2$ .
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Figure 4: Qualitative comparison with DPI-Nets on a test sequence from our dataset. Two fluid bodies collide inside a container. DPI-Nets works well on data with little variance but has problems with more complex scenes and high particle velocities. The DPI-Nets simulation becomes unstable immediately after the fluid hits the box. The fluid behavior predicted by our network matches the ground truth more closely and remains stable for the whole sequence. The two networks have been trained on the same data. Test sequences are distinct from training sequences. See the supplementary video.
|
| 172 |
+
|
| 173 |
+
In addition, we report the average distance from the ground-truth particles to the closest particle in the prediction for the whole sequence, to measure long-term similarity. We compute the distance for frame $n$ as
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
d ^ { n } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \operatorname* { m i n } _ { \mathbf { x } ^ { n } \in X ^ { n } } \| \hat { \mathbf { x } } _ { i } ^ { n } - \mathbf { x } ^ { n } \| _ { 2 } ,
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
where $X ^ { n }$ is the set of predicted particle positions for frame $n$ , $\hat { \mathbf { x } } _ { i } ^ { n }$ is the ground-truth position for particle $i$ , and $N$ is the number of particles.
|
| 180 |
+
|
| 181 |
+
We also compare our continuous convolution formulation to continuous convolution representations used in SPNets (Schenck & Fox, 2018), PCNN (Wang et al., 2018), KPConv (Thomas et al., 2019), and SplineCNN (Fey et al., 2018). To this end, we plug the respective convolution operators into our network architecture as shown in Figure 2. This facilitates controlled comparisons in which the overall architecture and simulation setup are fixed and only the convolution operators are varied. As shown in Table 1, our method outperforms all baselines with respect to both accuracy and inference time.
|
| 182 |
+
|
| 183 |
+
We have trained and tested all methods on the dam break dataset from Li et al. (2019) as well as our data (generated with a high-fidelity simulator (Bender & Koschier, 2015)). To facilitate the training on our data for all methods, we generated a simplified version with a constant number of particles (6,000) and a single box environment (as shown in Figure 4). We train DPI-Nets for 5 epochs and all other networks for 50,000 iterations, which corresponds to 2.7 epochs for the dam break data and 5 epochs for our data. Training takes about a day for our method with our convolutions on an NVIDIA RTX 2080Ti. Training with PCNN convolutions (Wang et al., 2018) takes about 2 days on 4 GPUs. Note that our reimplementation of PCNN convolutions uses Tensorflow’s built-in functions, which consume a lot of memory and necessitate multi-GPU training. The DPI-Nets model trains in about one day. Training with SplineCNN Convs takes 3 to 4 days on a single GPU. We got the best results for this method with spherical kernel coordinates and closed splines. For KPConvs we used a Quadro RTX 6000 with $2 4 \mathrm { \ G B }$ of RAM due to the higher memory requirements. Training took about 1 day with 15 kernel points. For SPNets convolutions, we estimated a training time of more than 29 days with $3 \times 3 \times 3$ filters by extrapolating from timing of a smaller number of iterations. We thus only report inference time for this method. Note that the convolutions of SPNets were designed to implement the position-based fluids algorithm, while we use them here in a more general network architecture with a much larger number of channels, which explains the very long runtime.
|
| 184 |
+
|
| 185 |
+
Ablation study. We perform an ablation study to evaluate our decisions in the design of the continuous convolution operator and the network. We study the importance of the interpolation, the window function, the loss design, and the architecture choice. The results are reported in Table 2. This table reports error measures (averaged over the test sequences) that were used in Table 1, and also reports the errors for two predicted frames initialized with the frames at the end of each sequence to measure the errors for small flow velocities. Large errors for small velocities can yield perceptually salient artifacts: rather than being still, fluid particles jitter or churn.
|
| 186 |
+
|
| 187 |
+
Table 1: Accuracy and runtime analysis. We compare the average error between the ground-truth particle positions and two predicted future frames on the test set. Additionally, we report the average distance from the ground truth to the prediction over the whole sequence. In this test mode some methods become unstable after a few frames. In the last column we report the average inference time per frame.
|
| 188 |
+
|
| 189 |
+
<table><tr><td rowspan="2" colspan="2">Method</td><td colspan="2">Average pos error (mm)</td><td rowspan="2">Average distance to closest point d" (mm)</td><td rowspan="2">Frame inference time (ms)</td></tr><tr><td>n+1</td><td>n+2</td></tr><tr><td></td><td>DPI-Nets</td><td>12.73</td><td>25.38</td><td>22.07</td><td>202.56</td></tr><tr><td></td><td>SPNets Convs</td><td>一</td><td>一</td><td></td><td>1058.46</td></tr><tr><td></td><td>PCNN Convs</td><td>0.72</td><td>1.67</td><td>19.79</td><td>187.34</td></tr><tr><td>RParaasr</td><td>SplineCNN Convs</td><td>0.71</td><td>1.65</td><td>170.20</td><td>67.67</td></tr><tr><td></td><td>KPConv</td><td>2.49</td><td>7.05</td><td>unstable</td><td>47.96</td></tr><tr><td></td><td>Ours</td><td>0.62</td><td>1.49</td><td>16.98</td><td>12.01</td></tr><tr><td></td><td>DPI-Nets</td><td>26.19</td><td>51.77</td><td>unstable</td><td>305.55</td></tr><tr><td></td><td>SPNets Convs</td><td>1</td><td>1</td><td>1</td><td>784.35</td></tr><tr><td>raarae rl gaest</td><td>PCNN Convs</td><td>0.67</td><td>1.87</td><td>32.51</td><td>319.17</td></tr><tr><td></td><td>SplineCNN Convs</td><td>0.68</td><td>1.93</td><td>unstable</td><td>281.92</td></tr><tr><td></td><td>KPConv</td><td>1.65</td><td>4.54</td><td>unstable</td><td>57.89</td></tr><tr><td></td><td>Ours</td><td>0.56</td><td>1.51</td><td>29.50</td><td>16.47</td></tr></table>
|
| 190 |
+
|
| 191 |
+
Table 2: Ablation study. We compare the average error between the ground-truth particle positions and two predicted future frames on the test set, evaluated over whole test sequences (left) and just on the final frames of each test sequence (middle; this focuses on frames with small motion). The rightmost column shows the average distance from the ground truth to the predicted point set over whole test sequences. Ours w/o interpolation uses nearest-neighbor instead of trilinear interpolation for the convolution filters. Ours w/o window uses $a ( \mathbf { x } _ { i } , \mathbf { x } ) = 1$ in Equation 7. Ours w/ na¨ıve loss uses Euclidean distance as the loss, i.e. we set $\gamma = 1$ and $\phi _ { i } = 1$ in Equation 16. Ours w/o FC uses only convolutions and includes the central particle in the convolution (rather than separately processing its features via an FC layer).
|
| 192 |
+
|
| 193 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Average error (mm)</td><td colspan="2">Seq. end error (mm)</td><td rowspan="2">Average distance to closest point d" (mm)</td></tr><tr><td>n+1</td><td>n+2</td><td>n+1</td><td>n+2</td></tr><tr><td>Ours</td><td>0.67</td><td>1.87</td><td>0.25</td><td>0.74</td><td>30.63</td></tr><tr><td>Ours w/o interpolation</td><td>0.79</td><td>2.24</td><td>0.30</td><td>0.89</td><td>32.39</td></tr><tr><td>Ours w/o window</td><td>0.77</td><td>2.21</td><td>0.30</td><td>0.89</td><td>31.77</td></tr><tr><td>Ours w/ naive loss</td><td>0.69</td><td>1.86</td><td>0.27</td><td>0.77</td><td>30.35</td></tr><tr><td>Ours w/o FC</td><td>0.75</td><td>2.17</td><td>0.27</td><td>0.80</td><td>32.49</td></tr></table>
|
| 194 |
+
|
| 195 |
+
Generalization. In Figure 5 we show that our network generalizes well to scenes with drastically different geometry than seen during training. (The training set uses only box-like containers. See the appendix for visualization.) These scenarios demonstrate that we can emit particles during simulation, which can be costly for methods that build and maintain explicit graph structures. We compare generalization performance quantitatively to DFPSH on a complex scene in Figure 6. Figure 7 demonstrates generalization along a different dimension. Here we show that we can set the viscosity of the fluid at test time to a value not seen during training. The fluid shape used in this example was also not seen during training.
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 5: Generalization to environments with drastically different geometry than seen during training. Top: we use an emitter to fill up a virtual river with fluid particles, demonstrating generalization with respect to scene geometry and the number of particles. Bottom: a waterfall scene showing the fluid particles and the particle representation of the environment. See the supplementary video.
|
| 199 |
+
|
| 200 |
+

|
| 201 |
+
Figure 6: Average distance from the ground-truth particles to the predicted particles on a complex scene. Top: error over time for our trained network and DFSPH. We use a timestep of $\Delta t = 5$ ms for DFSPH and $\Delta t = 2 0 \mathrm { m s }$ for our method, which also corresponds to the frame sampling rate. The ground truth was generated with DFSPH and a timestep of 1ms. Bottom: simulation produced by our network. Large errors are concentrated in the beginning of the sequence when the fluid initially collides with the environment and the fluid behavior is most chaotic. During this phase the error is higher for our method than DFSPH. After 200 frames the error levels become similar.
|
| 202 |
+
|
| 203 |
+

|
| 204 |
+
Figure 7: We can control the viscosity of the simulated fluid at test time by changing the input parameter $\nu$ in the input feature vector.
|
| 205 |
+
|
| 206 |
+
Material estimation. In this experiment we apply our network to an inverse problem: material estimation from observation. We use our network to estimate the viscosity parameter of a fluid from the particle movement. The training data for this experiment contains 200 sequences with random viscosity parameters between 0.01 and 0.3. For testing we generate 5 new sequences with 100 frames and random viscosity within the same range as used during training and use an initial fluid shape not present in the training data. To test generalization we generate two sequences with viscosity values outside the training range, namely 0.35 and 0.4. To estimate the viscosity we backpropagate through the trained network and optimize $\nu$ with gradient descent. Table 3 reports the results, which indicate that our network can be used to estimate material properties from observed data.
|
| 207 |
+
|
| 208 |
+
<table><tr><td>GT viscosity</td><td>0.044</td><td>0.127</td><td>0.174</td><td>0.233</td><td>0.269</td><td>0.350</td><td>0.400</td><td>Mean</td></tr><tr><td>Avg. estimated viscosity</td><td>0.027</td><td>0.150</td><td>0.202</td><td>0.255</td><td>0.277</td><td>0.322</td><td>0.336</td><td></td></tr><tr><td>Avg. relative error (%)</td><td>38.377</td><td>18.542</td><td>15.604</td><td>9.568</td><td>3.235</td><td>7.954</td><td>16.016</td><td>15.614</td></tr></table>
|
| 209 |
+
|
| 210 |
+
Table 3: Application to an inverse problem: material estimation from observed fluid motion. To estimate the viscosity we backpropagate through our network and optimize $\nu$ with gradient descent. For each scene, we run the procedure 10 times, each time with random initialization, and report the average. Viscosity values 0.350 and 0.400 are outside the range that was used during training and are used to test generalization.
|
| 211 |
+
|
| 212 |
+
# 7 CONCLUSION
|
| 213 |
+
|
| 214 |
+
We have developed continuous convolutional networks for Lagrangian fluid simulation. We have introduced a simple formulation for continuous convolutions and demonstrated its accuracy and speed. Our model captures a wide range of complex material behavior, offers long-term stability, and generalizes to new situations such as varying particle counts, domain geometries, and material properties. There are numerous directions for future work, such as extending the framework to incorporate rigid and deformable solids. We will release the code to facilitate such development. Our continuous convolution implementation will be made available as part of Open3D (Zhou et al., 2018).
|
| 215 |
+
|
| 216 |
+
Acknowledgements. We thank Jan Bender for his support with the SPlisHSPlasH framework.
|
| 217 |
+
|
| 218 |
+
# REFERENCES
|
| 219 |
+
|
| 220 |
+
Matan Atzmon, Haggai Maron, and Yaron Lipman. Point convolutional neural networks by extension operators. ACM Trans. Graph., 37(4), 2018.
|
| 221 |
+
|
| 222 |
+
George K. Batchelor. An Introduction to Fluid Dynamics. Cambridge University Press, 1967.
|
| 223 |
+
|
| 224 |
+
Peter W. Battaglia, Razvan Pascanu, Matthew Lai, Danilo Rezende, and Koray Kavukcuoglu. Interaction networks for learning about objects, relations and physics. In Advances in Neural Information Processing Systems, 2016.
|
| 225 |
+
|
| 226 |
+
Jan Bender and Dan Koschier. Divergence-free smoothed particle hydrodynamics. In Symposium on Computer Animation, 2015.
|
| 227 |
+
|
| 228 |
+
Andrea Colagrossi and Maurizio Landrini. Numerical simulation of interfacial flows by smoothed particle hydrodynamics. Journal of Computational Physics, 191(2), 2003.
|
| 229 |
+
|
| 230 |
+
Matthias Fey, Jan Eric Lenssen, Frank Weichert, and Heinrich Muller. SplineCNN: Fast geometric ¨ deep learning with continuous B-spline kernels. In CVPR, 2018.
|
| 231 |
+
|
| 232 |
+
Nick Foster and Dimitris N. Metaxas. Realistic animation of liquids. Graphical Models and Image Processing, 58(5), 1996.
|
| 233 |
+
|
| 234 |
+
Robert A Gingold and Joseph J Monaghan. Smoothed particle hydrodynamics: Theory and application to non-spherical stars. Monthly Notices of the Royal Astronomical Society, 181(3), 1977.
|
| 235 |
+
|
| 236 |
+
Christoph Gissler, Andreas Peer, Stefan Band, Jan Bender, and Matthias Teschner. Interlinked SPH pressure solvers for strong fluid-rigid coupling. ACM Trans. Graph., 38(1), 2018.
|
| 237 |
+
|
| 238 |
+
Jens Andre Griepentrog, Wolfgang H ´ oppner, Hans-Christoph Kaiser, and Joachim Rehberg. A bi- ¨ Lipschitz continuous, volume preserving map from the unit ball onto a cube. Note di Matematica, 28, 2008.
|
| 239 |
+
|
| 240 |
+
Pedro Hermosilla, Tobias Ritschel, Pere-Pau Vazquez, ´ Alvar Vinacua, and Timo Ropinski. Monte \` Carlo convolution for learning on non-uniformly sampled point clouds. ACM Trans. Graph., 37 (6), 2018.
|
| 241 |
+
|
| 242 |
+
Xiang Yu Hu and Nikolaus A Adams. A multi-phase SPH method for macroscopic and mesoscopic flows. Journal of Computational Physics, 213(2), 2006.
|
| 243 |
+
|
| 244 |
+
Binh-Son Hua, Minh-Khoi Tran, and Sai-Kit Yeung. Pointwise convolutional neural networks. In CVPR, 2018.
|
| 245 |
+
|
| 246 |
+
Byungsoo Kim, Vinicius C. Azevedo, Nils Thuerey, Theodore Kim, Markus Gross, and Barbara Solenthaler. Deep fluids: A generative network for parameterized fluid simulations. Computer Graphics Forum, 38(2), 2019.
|
| 247 |
+
|
| 248 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 249 |
+
|
| 250 |
+
L’ubor Ladicky, SoHyeon Jeong, Barbara Solenthaler, Marc Pollefeys, and Markus Gross. Data- ´ driven fluid simulations using regression forests. ACM Trans. Graph., 34(6), 2015.
|
| 251 |
+
|
| 252 |
+
Huan Lei, Naveed Akhtar, and Ajmal Mian. Octree guided CNN with spherical kernels for 3D point clouds. In CVPR, 2019.
|
| 253 |
+
|
| 254 |
+
Yangyan Li, Rui Bu, Mingchao Sun, Wei Wu, Xinhan Di, and Baoquan Chen. PointCNN: Convolution on X-transformed points. In Advances in Neural Information Processing Systems, 2018.
|
| 255 |
+
|
| 256 |
+
Yunzhu Li, Jiajun Wu, Russ Tedrake, Joshua B. Tenenbaum, and Antonio Torralba. Learning particle dynamics for manipulating rigid bodies, deformable objects, and fluids. In ICLR, 2019.
|
| 257 |
+
|
| 258 |
+
Julia Ling, Andrew Kurzawski, and Jeremy Templeton. Reynolds averaged turbulence modelling using deep neural networks with embedded invariance. Journal of Fluid Mechanics, 807, 2016.
|
| 259 |
+
|
| 260 |
+
Miles Macklin and Matthias Muller. Position based fluids. ¨ ACM Trans. Graph., 32(4), 2013.
|
| 261 |
+
|
| 262 |
+
Miles Macklin, Matthias Muller, Nuttapong Chentanez, and Tae-Yong Kim. Unified particle physics ¨ for real-time applications. ACM Trans. Graph., 33(4), 2014.
|
| 263 |
+
|
| 264 |
+
J Monaghan. An introduction to SPH. Computer Physics Communications, 48(1), 1988.
|
| 265 |
+
|
| 266 |
+
Jeremy Morton, Antony Jameson, Mykel J Kochenderfer, and Freddie Witherden. Deep dynamical modeling and control of unsteady fluid flows. In Advances in Neural Information Processing Systems, 2018.
|
| 267 |
+
|
| 268 |
+
Damian Mrowca, Chengxu Zhuang, Elias Wang, Nick Haber, Li F Fei-Fei, Josh Tenenbaum, and Daniel L Yamins. Flexible neural representation for physics prediction. In Advances in Neural Information Processing Systems, 2018.
|
| 269 |
+
|
| 270 |
+
Matthias Muller, David Charypar, and Markus Gross. Particle-based fluid simulation for interactive ¨ applications. In Symposium on Computer Animation, 2003.
|
| 271 |
+
|
| 272 |
+
Daniel J Price. Smoothed particle hydrodynamics and magnetohydrodynamics. Journal of Computational Physics, 231(3), 2012.
|
| 273 |
+
|
| 274 |
+
Alvaro Sanchez-Gonzalez, Nicolas Heess, Jost Tobias Springenberg, Josh Merel, Martin A. Riedmiller, Raia Hadsell, and Peter W. Battaglia. Graph networks as learnable physics engines for inference and control. In ICML, 2018.
|
| 275 |
+
|
| 276 |
+
Connor Schenck and Dieter Fox. SPNets: Differentiable fluid dynamics for deep neural networks. In Conference on Robot Learning, 2018.
|
| 277 |
+
|
| 278 |
+
Barbara Solenthaler and Renato Pajarola. Predictive-corrective incompressible SPH. ACM Trans. Graph., 28(3), 2009.
|
| 279 |
+
|
| 280 |
+
Hang Su, Varun Jampani, Deqing Sun, Subhransu Maji, Evangelos Kalogerakis, Ming-Hsuan Yang, and Jan Kautz. SPLATNet: Sparse lattice networks for point cloud processing. In CVPR, 2018.
|
| 281 |
+
|
| 282 |
+
Matthias Teschner, Bruno Heidelberger, Matthias Muller, Danat Pomerantes, and Markus H. Gross. ¨ Optimized spatial hashing for collision detection of deformable objects. In Vision, Modeling, and Visualization (VMV), 2003.
|
| 283 |
+
|
| 284 |
+
Hugues Thomas, Charles R. Qi, Jean-Emmanuel Deschaud, Beatriz Marcotegui, Franc¸ois Goulette, and Leonidas J. Guibas. KPConv: Flexible and deformable convolution for point clouds. In ICCV, 2019.
|
| 285 |
+
|
| 286 |
+
Jonathan Tompson, Kristofer Schlachter, Pablo Sprechmann, and Ken Perlin. Accelerating Eulerian fluid simulation with convolutional networks. In ICML, 2017.
|
| 287 |
+
|
| 288 |
+
Shenlong Wang, Simon Suo, Wei-Chiu Ma, Andrei Pokrovsky, and Raquel Urtasun. Deep parametric continuous convolutional neural networks. In CVPR, 2018.
|
| 289 |
+
|
| 290 |
+
Steffen Wiewel, Moritz Becher, and Nils Thuerey. Latent space physics: Towards learning the temporal evolution of fluid flow. Computer Graphics Forum, 38(2), 2019.
|
| 291 |
+
|
| 292 |
+
David C Wilcox. Turbulence Modeling for CFD. DCW industries, 3rd edition, 2006.
|
| 293 |
+
|
| 294 |
+
Wenxuan Wu, Zhongang Qi, and Fuxin Li. PointConv: Deep convolutional networks on 3D point clouds. In CVPR, 2019.
|
| 295 |
+
|
| 296 |
+
You Xie, Erik Franz, Mengyu Chu, and Nils Thuerey. tempoGAN: A temporally coherent, volumetric GAN for super-resolution fluid flow. ACM Trans. Graph., 37(4), 2018.
|
| 297 |
+
|
| 298 |
+
Yifan Xu, Tianqi Fan, Mingye Xu, Long Zeng, and Yu Qiao. SpiderCNN: Deep learning on point sets with parameterized convolutional filters. In ECCV, 2018.
|
| 299 |
+
|
| 300 |
+
Qian-Yi Zhou, Jaesik Park, and Vladlen Koltun. Open3D: A modern library for 3D data processing. arXiv:1801.09847, 2018.
|
| 301 |
+
|
| 302 |
+
# A APPENDIX
|
| 303 |
+
|
| 304 |
+
# A.1 IMPLEMENTATION DETAILS
|
| 305 |
+
|
| 306 |
+
To accelerate the computation of Equation 7 we use existing general matrix multiplication primitives. Similar to standard convolutions in deep learning frameworks we build a matrix with patches that we then multiply with the filter matrix. We can account for the linear interpolation by applying the interpolation to the patch matrix instead of the filters. For 3D point clouds a single point contributes to up to 8 voxels in a patch.
|
| 307 |
+
|
| 308 |
+
Another crucial part of our implementation is the nearest neighbor search. Since the positions of the fluid particles update with each timestep, we have to rebuild the neighborhood information for every frame. We implement the neighborhood search with spatial hashing (we use the hash function proposed in Teschner et al. (2003)). We explicitly store all particle neighbors in a compact list, which allows us to reuse the information for multiple convolutions operating on the same point sets. Table 4 compares the average frame runtimes of our method with the baselines.
|
| 309 |
+
|
| 310 |
+
# A.2 DATASET GENERATION
|
| 311 |
+
|
| 312 |
+
To enable generalization to new environments we use 10 different containers (see Figure 8) in our data generation process. During scene generation we randomly sample an environment and place up to 3 fluid bodies with different shapes and sizes (see Figure 9) and random initial velocities in the scene. We simulate each generated scene with DFSPH using the SPlisHSPlasH framework 1 for
|
| 313 |
+
|
| 314 |
+
<table><tr><td>Method</td><td></td><td>Frame inference time (ms)</td><td>Frame NNS time (ms)</td><td>NNS Method</td></tr><tr><td></td><td>DPI-Nets</td><td>202.56</td><td>103.26</td><td>KD-Tree (SciPy)</td></tr><tr><td>Daraaa</td><td>SPNets Convs</td><td>1058.46</td><td>5.24</td><td>Spatial hashing on GPU</td></tr><tr><td></td><td>PCNN Convs</td><td>187.34</td><td>2.42</td><td>*Spatial hashing on GPU</td></tr><tr><td></td><td>SplineCNN Convs</td><td>67.67</td><td>41.92</td><td>Brute-force on GPU</td></tr><tr><td></td><td>KPConv</td><td>47.96</td><td>28.12</td><td>KD-Tree (nanoflann)</td></tr><tr><td></td><td>Ours</td><td>12.01</td><td>2.14</td><td>* Spatial hashing on GPU</td></tr><tr><td>gaaarae err tar est</td><td>DPI-Nets</td><td>305.55</td><td>171.22</td><td>KD-Tree (SciPy)</td></tr><tr><td></td><td>SPNets Convs</td><td>784.35</td><td>10.19</td><td>Spatial hashing on GPU</td></tr><tr><td></td><td>PCNN Convs</td><td>319.17</td><td>2.78</td><td>* Spatial hashing on GPU</td></tr><tr><td></td><td>SplineCNN Convs</td><td>281.92</td><td>245.52</td><td>Brute-force on GPU</td></tr><tr><td></td><td>KPConv</td><td>57.89</td><td>34.07</td><td>KD-Tree (nanoflann)</td></tr><tr><td></td><td>Ours</td><td>16.47</td><td>2.38</td><td>*Spatial hashing on GPU</td></tr></table>
|
| 315 |
+
|
| 316 |
+
Table 4: Runtime analysis. We compare the average per frame inference time and the time used for the nearest neighbor search (NNS). Our convolution achieves the shortest inference times in comparison even if NNS times would be excluded. Irrespective of that, the methods used for finding neighbors can have a significant contribution to the total runtime. Since fluid particles are moving, acceleration structures for the neighbor search have to be rebuilt each frame. This affects the KDTree methods as well as the methods using spatial hashing. Note that we use the same NNS for PCNN and Ours (denoted with \*). For all methods except for SPNets the inference time is shorter on the smaller DPI DamBreak data (3456 particles compared to the 6000 particles of our data). We attribute this to a higher number of neighbors on the DPI DamBreak, which is about 49 on average compared to the average 40 neighbors on our datasets. All runtimes were measured on a system with an Intel Core i9-7960 and an NVIDIA RTX 2080Ti.
|
| 317 |
+
|
| 318 |
+
16 seconds to ensure that each scene contains frames with small particle velocities. To create the particle representation of the box-like containers, we do Poisson-Disc sampling on the mesh surface with the tools provided by DFPSH and add surface normals to each particle.
|
| 319 |
+
|
| 320 |
+

|
| 321 |
+
Figure 8: We sample from 10 different box-like containers during data generation. For the simplified version of our dataset used in the quantitative comparison with the baselines we only use the first container (leftmost container in the first row).
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure 9: We randomly place fluid bodies of different initial shapes in the scene during data generation. We sample from 5 different shapes and vary the size, the orientation and the initial particle velocity. All particles from the same fluid body start with the same initial velocity. The image shows the particles generated from each shape for a specific size and orientation.
|
| 325 |
+
|
| 326 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Average error (mm)</td><td colspan="2">Seq. end error (mm)</td><td rowspan="2">Average distance to closest point d (mm)</td></tr><tr><td>n+1</td><td>n+2</td><td>n+1</td><td>n+2</td></tr><tr><td>Ours</td><td>0.67</td><td>1.87</td><td>0.25</td><td>0.74</td><td>30.63</td></tr><tr><td>Ours triangular window</td><td>0.69</td><td>1.94</td><td>0.27</td><td>0.79</td><td>30.28</td></tr><tr><td>Ours w/o window</td><td>0.77</td><td>2.21</td><td>0.30</td><td>0.89</td><td>31.77</td></tr></table>
|
| 327 |
+
|
| 328 |
+
Table 5: Comparison of different window functions. Ours uses a window function similar to the poly6 kernel used in Muller et al. (2003). ¨ Ours triangular window uses a triangular window function. Ours w/o window does not use a window function. This case can also be interpreted as a rectangular window since we only consider points within a radius $R$ .
|
| 329 |
+
|
| 330 |
+
# A.3 TRAINING DETAILS
|
| 331 |
+
|
| 332 |
+
We use the Tensorflow framework for implementing the training procedure. We use Adam as optimizer and train with a batch size of 16 and an initial learning rate of 0.001. We half the learning rate at steps 20000, 25000, . . . , 45000. For the convolutions we use the random uniform initializer with range [-0.05, 0.05]. All other weights are initialized with the respective default initializers of Tensorflow version 1.12. The output of the network is scaled with $\scriptstyle { \frac { 1 } { 1 2 8 } }$ to roughly adjust the output range to the ground truth position correction of the training data.
|
| 333 |
+
|
| 334 |
+
The unit of length of the training data is meter. The particle radius used in DFSPH is $h = 0 . 0 2 5 \mathrm { m }$ .
|
| 335 |
+
For our convolutions, we use spherical filters with an empirically determined radius of $R = 4 . 5 h$ .
|
| 336 |
+
|
| 337 |
+
# A.4 WINDOW FUNCTION
|
| 338 |
+
|
| 339 |
+
We compare 3 different choices for the window function $a$ from Equation 8 in Table 5. The results show that enforcing a continuous output with a window function yields better results. Further, using a window function similar to kernels used in SPH codes gives better results than a simple triangular window. Learning the window function is therefore a possible direction to extend our framework to further improve the accuracy.
|
| 340 |
+
|
| 341 |
+
# A.5 COORDINATE MAPPING FUNCTION
|
| 342 |
+
|
| 343 |
+
We use the ball to cube mapping described in (Griepentrog et al., 2008) to map a position within a spherical region to the filter values stored in a regular grid. We give here the functions used for the 3-D case as used in our implementation. For more details see (Griepentrog et al., 2008).
|
| 344 |
+
|
| 345 |
+
The function $\Lambda$ is a composition of the functions $\Lambda _ { \mathrm { b a l l c y l } }$ and $\Lambda _ { \mathrm { c y l \to c u b e } }$ , which map a sphere to a cylinder and a cylinder to a cube respectively. We define $\Lambda _ { \mathrm { b a l l c y l } }$ for vectors ${ \bf r } = ( x , y , z )$ as
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\begin{array} { r } { \Lambda _ { \mathrm { b a l l } \to \mathrm { c y l } } ( \mathbf { r } ) = \left\{ \begin{array} { l l } { ( 0 , 0 , 0 ) } & { \mathrm { i f ~ } \| \mathbf { r } \| _ { 2 } = 0 } \\ { \left( x \frac { \| \mathbf { r } \| _ { 2 } } { \| ( x , y ) \| _ { 2 } } , y \frac { \| \mathbf { r } \| _ { 2 } } { \| ( x , y ) \| _ { 2 } } , \frac { 3 } { 2 } z \right) } & { \mathrm { i f ~ } \frac { 5 } { 4 } z ^ { 2 } \leq x ^ { 2 } + y ^ { 2 } } \\ { \left( x \sqrt { \frac { 3 \| \mathbf { r } \| _ { 2 } } { \| \mathbf { r } \| _ { 2 } + | z | } } , y \sqrt { \frac { 3 \| \mathbf { r } \| _ { 2 } } { \| \mathbf { r } \| _ { 2 } + | z | } } , \mathrm { s i g n } ( z ) \| \mathbf { r } \| _ { 2 } \right) } & { \mathrm { e l s e } . } \end{array} \right. } \end{array}
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
The cylinder to cube mapping is defined as
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
\Lambda _ { \mathrm { c y l } \to \mathrm { c u b e } } ( \mathbf { r } ) = \left\{ \begin{array} { l l } { ( 0 , 0 , z ) } & { \mathrm { i f ~ } x = 0 , y = 0 } \\ { ( \mathrm { s i g n } ( x ) \| ( x , y ) \| _ { 2 } , \frac { 4 } { \pi } \mathrm { s i g n } ( x ) \| ( x , y ) \| _ { 2 } \mathrm { a r c t a n } \frac { y } { x } , z ) } & { \mathrm { i f ~ } | y | \leq | x | } \\ { \left( \frac { 4 } { \pi } \mathrm { s i g n } ( y ) \| ( x , y ) \| _ { 2 } \mathrm { a r c t a n } \frac { x } { y } , \mathrm { s i g n } ( y ) \| ( x , y ) \| _ { 2 } , z \right) } & { \mathrm { e l s e } . } \end{array} \right.
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+
We assume that vectors $\mathbf { r }$ are normalized with the search radius $R$ such that $\| \mathbf { r } \| _ { 2 } \leq 1$ . This yields the following $\Lambda$ , which maps from a unit ball to the normalized coordinates of a cube:
|
| 358 |
+
|
| 359 |
+
$$
|
| 360 |
+
\Lambda ( { \bf r } ) = \frac { 1 } { 2 } \Lambda _ { \mathrm { c y l \to c u b e } } ( \Lambda _ { \mathrm { b a l l \to c y l } } ( { \bf r } ) ) + ( 0 . 5 , 0 . 5 , 0 . 5 ) .
|
| 361 |
+
$$
|
md/train/BJg73xHtvr/BJg73xHtvr.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/BkCV_W-AZ/BkCV_W-AZ.md
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REGRET MINIMIZATION FOR PARTIALLY OBSERVABLE DEEP REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep reinforcement learning algorithms that estimate state and state-action value functions have been shown to be effective in a variety of challenging domains, including learning control strategies from raw image pixels. However, algorithms that estimate state and state-action value functions typically assume a fully observed state and must compensate for partial or non-Markovian observations by using finite-length frame-history observations or recurrent networks. In this work, we propose a new deep reinforcement learning algorithm based on counterfactual regret minimization that iteratively updates an approximation to a cumulative clipped advantage function and is robust to partially observed state. We demonstrate that on several partially observed reinforcement learning tasks, this new class of algorithms can substantially outperform strong baseline methods: on Pong with single-frame observations, and on the challenging Doom (ViZDoom) and Minecraft (Malmo) first-person navigation benchmarks. ¨
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Many reinforcement learning problems of practical interest have the property of partial observability, where observations of state are generally non-Markovian. Despite the importance of partial observation in the real world, value function-based methods such as Q-learning (Mnih et al., 2013; 2015) generally assume a Markovian observation space. On the other hand, Monte Carlo policy gradient methods do not assume Markovian observations, but many practical policy gradient methods such as A3C (Mnih et al., 2016) introduce the Markov assumption when using a critic or state-dependent baseline in order to improve sample efficiency.
|
| 12 |
+
|
| 13 |
+
Consider deep reinforcement learning methods that learn a state or state-action value function. One common workaround for the problem of partial observation is to learn value functions on the space of finite-length frame-history observations, under the assumption that frame-histories of sufficient length will give the environment the approximate appearance of full observability. When learning to play Atari 2600 games from images, deep Q-learning algorithms (Mnih et al., 2013; 2015) concatenate the last 4 observed frames of the video screen buffer as input to a state-action value convolutional network. Not all non-Markovian tasks are amenable to finite-length frame-histories; recurrent value functions can incorporate longer and potentially infinite histories (Hausknecht & Stone, 2017; Foerster et al., 2016), but at the cost of solving a harder optimization problem. Can we develop methods that learn a variant of the value function that is more robust to partial observability?
|
| 14 |
+
|
| 15 |
+
Our contribution is a new model-free deep reinforcement learning algorithm based on the principle of regret minimization which does not require access to a Markovian state. Our method learns a policy by estimating a cumulative clipped advantage function, which is an approximation to a type of regret that is central to two partial information game-solving algorithms from which we draw our primary inspiration: counterfactual regret minimization (CFR) (Zinkevich et al., 2007) and $\mathrm { C F R + }$ (Tammelin, 2014). Hence we call our algorithm “advantage-based regret minimization” (ARM).
|
| 16 |
+
|
| 17 |
+
We evaluate our approach on three visual reinforcement learning domains: Pong with varying framehistory lengths (Bellemare et al., 2013), and the first-person games Doom (Kempka et al., 2016) and Minecraft (Johnson et al., 2016). Doom and Minecraft exhibit a first-person viewpoint in a 3- dimensional environment and should appear non-Markovian even with frame-history observations. We find that our method offers substantial improvement over prior methods in these partially observable environments: on both Doom and Minecraft, our method can learn well-performing policies within about 1 million simulator steps using only visual input frame-history observations.
|
| 18 |
+
|
| 19 |
+
# 2 RELATED WORK
|
| 20 |
+
|
| 21 |
+
Deep reinforcement learning algorithms have been demonstrated to achieve excellent results on a range of complex tasks, including playing games (Mnih et al., 2015; Oh et al., 2016) and continuous control (Schulman et al., 2015; Lillicrap et al., 2016; Levine et al., 2016). Prior deep reinforcement learning algorithms either learn state or state-action value functions (Mnih et al., 2013), learn policies using policy gradients (Schulman et al., 2015), or perform a combination of the two using actor-critic architectures (Mnih et al., 2016). Policy gradient methods typically do not need to assume a Markovian state, but tend to suffer from poor sample complexity, due to their inability to use off-policy data. Methods based on learning Q-functions can use replay buffers to include off-policy data, accelerating learning (Lillicrap et al., 2016). However, learning Q-functions with Bellman error minimization typically requires a Markovian state space. When learning from observations such as images, the inputs might not be Markovian. Prior methods have proposed to mitigate this issue by using recurrent critics and Q-functions (Hausknecht & Stone, 2017; Oh et al., 2016; Mnih et al., 2016; Heess et al., 2015), and learning Q-functions that depend on entire histories of observations. Heuristics such as concatenation of short observation sequences have also been used (Mnih et al., 2015). However, all of these changes increase the size of the input space, increasing variance, and make the optimization problem more complex. Our method instead learns cumulative advantage functions that depend only on the current state, but can still handle non-Markovian problems.
|
| 22 |
+
|
| 23 |
+
The form of our advantage function update resembles positive temporal difference methods (Peng et al., 2016; van Hasselt & Wiering, 2007). Additionally, our update rule for a modified cumulative Q-function resembles the average Q-function (Anschel et al., 2017) used for variance reduction in Q-learning. In both cases, the theoretical foundations of our method are based on cumulative regret minimization, and the motivation is substantively different. Previous work by Ross et al. (2011); Ross & Bagnell (2014) has connected regret minimization to reinforcement learning, imitation learning, and structured prediction, although not with counterfactual regret minimization. Regression regret matching (Waugh et al., 2015) is based on a closely related idea, which is to directly approximate the regret with a linear regression model, however the use of a linear model is limited in representation compared to deep function approximation.
|
| 24 |
+
|
| 25 |
+
# 3 ADVANTAGE-BASED REGRET MINIMIZATION
|
| 26 |
+
|
| 27 |
+
In this section, we provide background on CFR and $\mathrm { C F R + }$ , describe ARM in detail, and give some intuition for why ARM works.
|
| 28 |
+
|
| 29 |
+
# 3.1 COUNTERFACTUAL REGRET MINIMIZATION (CFR)
|
| 30 |
+
|
| 31 |
+
In this section we review the algorithm of counterfactual regret minimization (Zinkevich et al., 2007). We closely follow the version of CFR as described in the Supplementary Material of Bowling et al. (2015), except that we try to use the notation of reinforcement learning where appropriate.
|
| 32 |
+
|
| 33 |
+
Consider the setting of an extensive game. There are $N$ players numbered $i = 1 , \ldots , N$ . An additional player may be considered a “chance” player to simulate random events. At each time step of the game, one player chooses an action $a \in A _ { i }$ . Define the following concepts and notation:
|
| 34 |
+
|
| 35 |
+
• Sequences: A sequence specifically refers to a sequence of actions starting from an initial game state. (It is assumed that a sequence of actions, including actions of the “chance” player, is sufficient for defining state within the extensive game.) Let $\mathcal { H }$ be the space of all sequences, and let $\mathcal { Z }$ be the space of terminal sequences.
|
| 36 |
+
Information sets: Let $\mathcal { T }$ be the space of information sets; that is, for each $I \in \mathcal { Z }$ , $I$ is a set of sequences $h \in I$ which are indistinguishable to the current player. Information sets are a represention of partial observability.
|
| 37 |
+
Strategies: Let $\pi _ { i } ( a | I )$ be the strategy of the $i$ -th player, where $\pi _ { i } ( a | I )$ is a probability distribution over action $a$ conditioned on information set $I$ . Let $\pi = ( \pi _ { 1 } , \ldots , \pi _ { N } )$ denote
|
| 38 |
+
|
| 39 |
+
the strategy profile for all players, and let $\pi _ { - i } = ( \pi _ { 1 } , \ldots , \pi _ { i - 1 } , \pi _ { i + 1 } , \ldots , \pi _ { N } )$ denote the strategy profile for all players except the $i$ -th player.
|
| 40 |
+
|
| 41 |
+
• Sequence probabilities: Let $\rho ^ { \pi } ( h )$ be the probability of reaching the sequence $h$ when all players follow $\pi$ . Additionally, let $\rho ^ { \pi } ( h , h ^ { \prime } )$ be the probability of reaching $h ^ { \prime }$ conditioned on $h$ having already been reached. Similarly, define $\rho _ { i } ^ { \pi }$ and $\rho _ { - i } ^ { \pi }$ to contain the contributions of respectively only the $i$ -th player or of all players except the $i$ -th.
|
| 42 |
+
|
| 43 |
+
• Values: Let $u _ { i } ( z )$ be the value of a terminal sequence $z$ to the $i$ -th player. Let the expected value of a strategy profile $\pi$ to the $i$ -th player be $\begin{array} { r } { J _ { i } ( \pi ) = \sum _ { z \in Z } \rho ^ { \bar { \pi } } ( z ) u _ { i } ( z ) } \end{array}$ .
|
| 44 |
+
|
| 45 |
+
Define the counterfactual value $Q _ { \pi , i } ^ { \mathrm { C F } }$ of all players following strategy $\pi$ , except the $i$ -th player plays to reach information set and to then take action $a$ :
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
Q _ { \pi , i } ^ { \mathrm { C F } } ( I , a ) = \sum _ { h \in I } \sum _ { z \in \mathcal { Z } : h \sqsubseteq z } \rho _ { - i } ^ { \pi } ( z ) \rho _ { i } ^ { \pi | I a } ( h , z ) u _ { i } ( z ) .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
The notation $h \sqsubset h ^ { \prime }$ denotes that $h$ is a prefix of $h ^ { \prime }$ , while $\pi | I a$ denotes that action $a$ is to be performed when $I$ is observed. The counterfactual value $Q _ { \pi , i } ^ { \mathrm { C F } } ( I , a )$ is a calculation that assumes the $i$ -th player reaches any $h \in I$ , and upon reaching any $h \in I$ it always chooses $a$ .
|
| 52 |
+
|
| 53 |
+
Consider a learning scenario where at the $t$ -th iteration the players follow a strategy profile $\pi ^ { t }$ . The $i$ -th player’s regret after $T$ iterations is defined in terms of the $i$ -th player’s optimal strategy $\pi _ { i } ^ { * }$ :
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
R _ { i } ^ { T } = \sum _ { t = 0 } ^ { T - 1 } J _ { i } ( ( \pi _ { 1 } ^ { t } , \cdot \cdot \cdot , \pi _ { i - 1 } ^ { t } , \pi _ { i } ^ { * } , \pi _ { i + 1 } ^ { t } , \cdot \cdot \cdot , \pi _ { N } ^ { t } ) ) - J _ { i } ( \pi ^ { t } ) .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
The average regret is the average over learning iterations: $( 1 / T ) R _ { i } ^ { T }$ . Now define the counterfactual regret of the $i$ -th player for taking action $a$ at information set $I$ :
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r l } & { ( R _ { i } ^ { \mathrm { ( C F ) } } ) ^ { T } ( I , a ) = \displaystyle \sum _ { t = 0 } ^ { T - 1 } \left( Q _ { \pi ^ { t } , i } ^ { \mathrm { C F } } ( I , a ) - \sum _ { a ^ { \prime } \in A } \pi _ { i } ^ { t } ( a ^ { \prime } | I ) Q _ { \pi ^ { t } , i } ^ { \mathrm { C F } } ( I , a ^ { \prime } ) \right) } \\ & { \quad \quad \quad \quad = ( R _ { i } ^ { \mathrm { ( C F ) } } ) ^ { T - 1 } ( I , a ) + Q _ { \pi ^ { T - 1 } , i } ^ { \mathrm { C F } } ( I , a ) - \displaystyle \sum _ { a ^ { \prime } \in A } \pi _ { i } ^ { T - 1 } ( a ^ { \prime } | I ) Q _ { \pi ^ { T - 1 } , i } ^ { \mathrm { C F } } ( I , a ^ { \prime } ) . } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
The counterfactual regret (Equation (3)) can be shown to majorize the regret (Equation (2)) (Theorem 3, Zinkevich et al. (2007)). CFR can then be described as a learning algorithm where the strategy is updated using regret matching (Hart & Mas-Colell, 2000) applied to the counterfactual regret calculated in the most recent iteration:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\pi _ { i } ^ { T + 1 } ( a | I ) = \left\{ \begin{array} { l l } { \frac { \operatorname* { m a x } ( 0 , ( R _ { i } ^ { \mathrm { ( C F ) } } ) ^ { T + 1 } ( I , a ) ) } { \sum _ { a ^ { \prime } \in A } \operatorname* { m a x } ( 0 , ( R _ { i } ^ { \mathrm { ( C F ) } } ) ^ { T + 1 } ( I , a ^ { \prime } ) ) } } & { \mathrm { i f } \sum _ { a ^ { \prime } \in A } \operatorname* { m a x } ( 0 , ( R _ { i } ^ { \mathrm { ( C F ) } } ) ^ { T + 1 } ( I , a ^ { \prime } ) ) > 0 } \\ { \frac { 1 } { | A | } } & { \mathrm { o t h e r w i s e } . } \end{array} \right.
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
If all players follow the CFR regret matching strategy (Equation (5)), then at the $T$ -th iteration the players’ average regrets are bounded by ${ \cal O } ( T ^ { - 1 / 2 } )$ (Theorem 4, Zinkevich et al. (2007)).
|
| 72 |
+
|
| 73 |
+
# 3.2 $\mathrm { C F R + }$
|
| 74 |
+
|
| 75 |
+
$\mathrm { C F R + }$ (Tammelin, 2014) consists of a modification to CFR, in which instead of calculating the full counterfactual regret as in (4), instead the counterfactual regret is recursively positively clipped to yield the clipped counterfactual regret:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
( R _ { i } ^ { \mathrm { ( C F + } } ) ^ { T } ( I , a ) = \operatorname* { m a x } ( 0 , ( R _ { i } ^ { \mathrm { ( C F + } } ) ) ^ { T - 1 } ( I , a ) ) + Q _ { \pi ^ { T - 1 } , i } ^ { \mathrm { C F } } ( I , a ) - \sum _ { a ^ { \prime } \in A } \pi _ { i } ^ { T - 1 } ( a ^ { \prime } | I ) Q _ { \pi ^ { T - 1 } , i } ^ { \mathrm { C F } } ( I , a ^ { \prime } ) .
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
Comparing Equation (4) with Equation (6), one can see that the only difference in CFR is that the previous iteration’s counterfactual regret is positively clipped in the recursion. The one-line change of $\mathrm { C F R + }$ turns out to yield a large practical improvement in the performance of the algorithm (Bowling et al., 2015), and there is also an associated regret bound for $\mathrm { C F R + }$ that is as strong as the bound for CFR (Tammelin et al., 2015).
|
| 82 |
+
|
| 83 |
+
# 3.3 FROM CFR AND $\mathrm { C F R + }$ TO ARM
|
| 84 |
+
|
| 85 |
+
CFR and $\mathrm { C F R + }$ are formulated for imperfect information extensive-form games, so they are naturally generalized to partially observed stochastic games since a stochastic game can always be represented in extensive form. A 1-player partially observed stochastic game is simply a POMDP with observation space $\mathcal { O }$ (Littman, 1994). By mapping information sets $I \in \mathcal { T }$ to observations $o \in \mathcal { O }$ e counterfactual value as a kind of statio that assumes the agent follows the policy ary observation-actioexcept on observing value, after $Q _ { \pi , i } ^ { \mathrm { C F } } ( I , a ) \equiv Q _ { \pi | o \mapsto a } ^ { ( \mathrm { s t a t } ) } ( o , a )$ $\pi$ $o$ $a$ $Q _ { \pi | o \mapsto a } ^ { ( \mathrm { s t a t } ) } ( o , a ) \approx Q _ { \pi } ( o , a )$ , where $Q _ { \pi }$ is the usual action value function, is valid when observations are rarely seen more than once in a trajectory. By approximating $Q _ { \pi | o \mapsto a } ^ { ( \mathrm { s t a t } ) } ( o , a ) \approx Q _ { \pi } ( o , a )$ , we get a recurrence in terms of more familiar value functions (compare Equations (6) and (7)):
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\begin{array} { l } { \bar { A } _ { t } ^ { + } ( o _ { k } , a _ { k } ) = \operatorname* { m a x } ( 0 , \bar { A } _ { t - 1 } ^ { + } ( o _ { k } , a _ { k } ) ) + Q _ { \pi _ { t } } ( o _ { k } , a _ { k } ) - { \displaystyle \sum _ { a ^ { \prime } \in \mathcal { A } } } \pi _ { t } ( a ^ { \prime } | o _ { k } ) Q _ { \pi _ { t } } ( o _ { k } , a ^ { \prime } ) } \\ { = \operatorname* { m a x } ( 0 , \bar { A } _ { t - 1 } ^ { + } ( o _ { k } , a _ { k } ) ) + Q _ { \pi _ { t } } ( o _ { k } , a _ { k } ) - V _ { \pi _ { t } } ( o _ { k } ) } \\ { = \operatorname* { m a x } ( 0 , \bar { A } _ { t - 1 } ^ { + } ( o _ { k } , a _ { k } ) ) + A _ { \pi _ { t } } ( o _ { k } , a _ { k } ) } \end{array}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $\bar { A } _ { t } ^ { + } ( o , a )$ is the cumulative clipped advantage function, and $A _ { \pi _ { t } } ( o , a )$ is the ordinary advantage function evaluated at policy $\pi _ { t }$ . Advantage-based regret minimization (ARM) is the resulting reinforcement learning algorithm that updates the policy to regret match on the cumulative clipped advantage function:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\pi _ { t + 1 } ( a _ { k } | o _ { k } ) = \left\{ \begin{array} { l l } { \frac { \operatorname* { m a x } ( 0 , \bar { A } _ { t } ^ { + } ( o _ { k } , a _ { k } ) ) } { \sum _ { a ^ { \prime } \in A } \operatorname* { m a x } ( 0 , \bar { A } _ { t } ^ { + } ( o _ { k } , a ^ { \prime } ) ) } } & { \mathrm { i f ~ } \sum _ { a ^ { \prime } \in A } \operatorname* { m a x } ( 0 , \bar { A } _ { t } ^ { + } ( o _ { k } , a ^ { \prime } ) ) > 0 } \\ { \frac { 1 } { | \bar { A } | } } & { \mathrm { o t h e r w i s e } . } \end{array} \right.
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
Equations (9) and (10) suggest the outline of a batch-mode deep reinforcement learning algorithm. At the $t$ -th sampling iteration, a batch of data is collected by sampling trajectories using the current policy $\pi _ { t }$ , followed by two processing steps: (a) fit $\bar { A } _ { t } ^ { + }$ using Equation (9), then (b) set the next iteration’s policy $\pi _ { t + 1 }$ using Equation (10).
|
| 98 |
+
|
| 99 |
+
# 3.4 IMPLEMENTATION OF ARM
|
| 100 |
+
|
| 101 |
+
To implement Equation (9) with deep function approximation, we define two value function approximations, $V _ { \pi _ { t } } \left( o _ { k } ; \theta _ { t } \right)$ and $\bar { Q } _ { t } ^ { + } ( o _ { k } , a _ { k } ; \omega _ { t } )$ , as well as a target value function $V ^ { \prime } ( o _ { k } ; \varphi )$ , where $\theta _ { t } , \omega _ { t }$ , and $\varphi$ are the learnable parameters. The cumulative clipped advantage function is represented as $\bar { A } _ { t } ^ { + } ( \dot { o } _ { k } , a _ { k } ) = \bar { Q } _ { t } ^ { + } ( o _ { k } , \dot { a _ { k } } ; \omega _ { t } ) - V _ { \pi _ { t } } ( o _ { k } ; \theta _ { t } )$ . Within each sampling iteration, the value functions are fitted using stochastic gradient descent by sampling minibatches and performing gradient steps. The state-value function $V _ { \pi _ { t } } ( o _ { k } ; \theta _ { t } )$ is fit to minimize an $n$ -step temporal difference loss with a moving target $V ^ { \prime } ( o _ { k + n } ; \varphi )$ , essentially using the estimator of the deep deterministic policy gradient (DDPG) (Lillicrap et al., 2016). In the same minibatch, $\bar { Q } _ { t } ^ { + } ( o _ { k } , a _ { k } ; \theta _ { t } )$ is fit to a similar loss, but with an additional target reward bonus that incorporates the previous iteration’s cumulative clipped advantage, $\operatorname* { m a x } ( 0 , \bar { A } _ { t - 1 } ^ { \mp } ( o _ { k } , a _ { k } ) )$ . The regression targets $v ( o _ { k } ; \varphi )$ and $\bar { q } ^ { + } ( o _ { k } , a _ { k } ; \varphi )$ are defined in terms of the $n$ -step returns $\begin{array} { r } { g _ { k } ^ { n } = \sum _ { k ^ { \prime } = k } ^ { k + n - 1 } \gamma ^ { k ^ { \prime } - k } r _ { k ^ { \prime } } } \end{array}$
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\begin{array} { r l } & { \qquad v ( o _ { k } ; \varphi ) \triangleq g _ { k } ^ { n } + \gamma ^ { n } V ^ { \prime } ( o _ { k + n } ; \varphi ) } \\ & { \qquad q ( o _ { k } , a _ { k } ; \varphi ) \triangleq r _ { k } + \gamma g _ { k + 1 } ^ { n - 1 } + \gamma ^ { n } V ^ { \prime } ( o _ { k + n } ; \varphi ) } \\ & { \qquad q ^ { + } ( o _ { k } , a _ { k } ; \varphi ) \triangleq \operatorname* { m a x } ( 0 , \bar { Q } _ { t - 1 } ^ { + } ( o _ { k } , a _ { k } ; \omega _ { t - 1 } ) - V _ { \pi _ { t - 1 } } ( o _ { k } ; \theta _ { t - 1 } ) ) + q ( o _ { k } , a _ { k } ; \varphi ) . } \end{array}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
Altogether, each minibatch step of the optimization subproblem consists of the following three parameter updates in terms of the regression targets $v ( o _ { k } ; \varphi )$ and $\bar { q } ^ { + } ( o _ { k } , a _ { k } ; \varphi )$ :
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\begin{array} { r l } & { \theta _ { t } ^ { ( \ell + 1 ) } \theta _ { t } ^ { ( \ell ) } - \frac { \alpha } { 2 } \nabla _ { \theta _ { t } ^ { ( \ell ) } } ( V _ { \pi _ { t } } ( o _ { k } ; \theta _ { t } ^ { ( \ell ) } ) - v ( o _ { k } ; \varphi ^ { ( \ell ) } ) ) ^ { 2 } } \\ & { \omega _ { t } ^ { ( \ell + 1 ) } \omega _ { t } ^ { ( \ell ) } - \frac { \alpha } { 2 } \nabla _ { \omega _ { t } ^ { ( \ell ) } } ( \bar { Q } _ { t } ^ { + } ( o _ { k } , a _ { k } ; \omega _ { t } ^ { ( \ell ) } ) - \bar { q } ^ { + } ( o _ { k } , a _ { k } ; \varphi ^ { ( \ell ) } ) ) ^ { 2 } } \\ & { \varphi ^ { ( \ell + 1 ) } \varphi ^ { ( \ell ) } + \tau ( \theta _ { t } ^ { ( \ell + 1 ) } - \varphi ^ { ( \ell ) } ) . } \end{array}
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
Algorithm 1 Advantage-based regret minimization (ARM).
|
| 114 |
+
|
| 115 |
+
<table><tr><td>initialize πo ←uniform,θ-1,ω-1 ←arbitrary for tin O,...do collect batch of trajectory data Dt ~ t initialize0t←0t-1,Wt←Wt-1,←0t-1 forlinO,...do sample transitions (Ok,ak,rk,.::, Ok+n-1,ak+n-1,rk+n-1,Ok+n) ~ Dt</td></tr><tr><td>calculate n-step returns g = ∑k=k k+n-1 k'-krk' set δk+n ← I[ok+n is terminal] if t=O then set k←0</td></tr><tr><td>else setΦk ←max(0,Qt-1(Ok,ak; Wt-1) -Vπt-1(Ok;0t-1)) end if</td></tr><tr><td>set v(ok) ←gκ+γn(1-δk+n)V'(0k+n;φ) update 0t with step size α and targets v(ok) (Equation (14))</td></tr><tr><td>update Wt with step size α and targets q+(Ok, ak) (Equation (15)) update with moving average step size T (Equation (16)) end for set πt+1(alo) x max(0,Qt(o,a; wt)-Vπt(o;0t))</td></tr></table>
|
| 116 |
+
|
| 117 |
+
The overall advantage-based regret minimization algorithm is summarized in Algorithm 1.
|
| 118 |
+
|
| 119 |
+
We note that the mechanics of the ARM updates are similar to on-policy value function estimation, but ARM learns a modified on-policy Q-function from transitions with the added reward bonus $\operatorname* { m a x } ( 0 , \bar { A } _ { t - 1 } ^ { + } ( o _ { k } , a _ { k } ) )$ (Equation (13)). This reward bonus can be thought of a kind of “optimism in the face of uncertainty.”
|
| 120 |
+
|
| 121 |
+
# 3.5 ARM VS. EXISTING POLICY GRADIENT METHODS
|
| 122 |
+
|
| 123 |
+
In this section, we accentuate that ARM represents an inherently different update compared to existing policy gradient methods.
|
| 124 |
+
|
| 125 |
+
Recent work has shown that policy gradient methods and Q-learning methods are connected via entropy regularization (O’Donoghue et al., 2017; Haarnoja et al., 2017; Nachum et al., 2017; Schulman et al., 2017; Anonymous, 2018). One perspective is from the soft policy iteration framework for batch-mode reinforcement learning (Anonymous, 2018), where at each batch iteration the updated policy is obtained by minimizing the average KL-divergence between the policy class $\Pi$ and a target policy $f$ . Below is the soft policy iteration update, where the subscript $t$ refers to the batch iteration:
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\begin{array} { r l } & { \pi _ { t + 1 } \gets \arg \underset { \pi \in \Pi } { \operatorname* { m i n } } \mathbb { E } _ { o \sim \rho _ { t } } [ D _ { \mathrm { K L } } ( \pi \| f ) ] } \\ & { \qquad = \arg \underset { \pi \in \Pi } { \operatorname* { m i n } } \mathbb { E } _ { o \sim \rho _ { t } } [ \mathbb { E } _ { a \sim \pi ( \cdot | o ) } [ \log ( \pi ( a | o ) ) - \log ( f ( a | o ) ) ] ] . } \end{array}
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
Using the connection between policy gradient methods and Q-learning, we define the policy gradient target policy as the softmax distribution on the entropy regularized advantage function Aβ-soft:
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
f ^ { \mathrm { P G } } ( a | o ) \triangleq \frac { \exp ( \beta A _ { t } ^ { \beta \mathrm { - s o f t } } ( o , a ) ) } { \sum _ { a ^ { \prime } \in \mathcal { A } } \exp ( \beta A _ { t } ^ { \beta \mathrm { - s o f t } } ( o , a ^ { \prime } ) ) } .
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
We note that it is more conventional in the literature to use the soft Q-function $Q ^ { \beta - \mathrm { s o f t } } ( o , a )$ rather than the soft advantage function $A ^ { \beta - \mathrm { s o f t } } ( o , a )$ , however since they differ only by a function of $o$ then they both induce the same target softmax policy. Now, parameterizing the policy $\pi$ in terms of an explicit parameter $\theta$ , we obtain the expression for the existing policy gradient, where $b ( o )$ is a baseline function:
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\Delta \theta ^ { \mathrm { P G } } \propto \mathbb { E } _ { o \sim \rho _ { t } } [ \mathbb { E } _ { a \sim \pi ( \cdot | a ; \theta ) } [ \nabla _ { \theta } \log ( \pi ( o | a ; \theta ) ) ( ( 1 / \beta ) \log ( \pi ( o | a ; \theta ) ) - A _ { t } ^ { \beta \sim \mathrm { o f f } } ( o , a ) + b ( o ) ) ] ] .
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
The classic policy gradient arises in the limit $\beta \to \infty$ .
|
| 144 |
+
|
| 145 |
+
Note that an alternative choice of target policy $f$ will lead to a different kind of policy gradient update. A policy gradient algorithm based on ARM instead proposes the following target policy based on the regret-matching distribution:
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
f ^ { \mathrm { A R M } } ( a | o ) \triangleq \frac { \operatorname* { m a x } ( 0 , \bar { A } _ { t } ^ { + } ( o , a ) ) } { \sum _ { a ^ { \prime } \in \mathcal { A } } \operatorname* { m a x } ( 0 , \bar { A } _ { t } ^ { + } ( o , a ^ { \prime } ) ) } .
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
Similarly, we can express the ARM-like policy gradient, where again $b ( o )$ is a baseline:
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\begin{array} { r } { \mathtt { D } \theta ^ { \mathrm { A R M } } = \mathbb { E } _ { o \sim \rho _ { \mathrm { f } } } [ \mathbb { E } _ { a \sim \pi ( \cdot | \sigma ; \theta ) } [ \nabla _ { \theta } \log ( \pi ( o | a ; \theta ) ) ( \log ( \pi ( o | a ; \theta ) ) - \log ( \operatorname* { m a x } ( 0 , \bar { A } _ { t } ^ { + } ( o , a ) ) ) + b ( o ) ) ] ] . } \end{array}
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
Comparing Equations (20) and (22), we see that the ARM-like policy gradient (Equation (22)) has a logarithmic dependence on the advantage-like function $\bar { A } ^ { + }$ , whereas the existing policy gradient (Equation (20)) is only linearly dependent on the advantage function $A ^ { \beta - \mathrm { s o f t } }$ . This difference in logarithmic vs. linear dependence is responsible for a large part of the inherent distinction of ARM from existing policy gradient methods. One consequence of the difference in logarithmic vs. linear dependence is that the ARM-like update should be less sensitive to large positive advantages that may result from overestimation compared to existing policy gradient methods.
|
| 158 |
+
|
| 159 |
+
We also see that for the existing policy gradient (Equation (20)), the $( 1 / \beta ) \log ( \pi ( a | o ; \theta ) )$ term, which is derived from the policy entropy, is vanishing for large $\beta$ (e.g. $\beta = 1 0 0$ is a common choice in practice). On the other hand, for the ARM-like policy gradient (Equation (22)), there is no similar vanishing effect, suggesting that ARM may perform a kind of entropy regularization by default.
|
| 160 |
+
|
| 161 |
+
In practice we cannot implement an ARM-like policy gradient exactly as in Equation (22), as due to the positive clipping $\operatorname* { m a x } ( 0 , { \bar { A } } ^ { + } )$ there can appear $\log ( 0 )$ . However we believe this is not an intrinsic obstacle, leaving the issue of implementing an ARM-like policy gradient to future work.
|
| 162 |
+
|
| 163 |
+
# 3.6 WHY DOES ARM WORK BETTER IN PARTIALLY OBSERVABLE DOMAINS?
|
| 164 |
+
|
| 165 |
+
In the previous Section 3.5, we showed that ARM and existing policy gradient methods can be distinguished by their choices of target policy and the nature of their dependence on their respective advantage-like functions. In this section, we argue that the convergence results of CFR and $\mathrm { C F R + }$ suggest that ARM, to the degree that it inherits the properties of $\mathrm { C F R / C F R + }$ , ought to benefit from greater partial observability compared to other methods.
|
| 166 |
+
|
| 167 |
+
We assume that regret bounds are a useful way to compare the convergence of different RL algorithms, due to the interpretation of regret as “area over the learning curve (and under the optimal√ expected value $J ^ { * }$ ).” Specifically, the regret bound of CFR and $\mathrm { C F R + }$ is $O ( | O | \sqrt { T } )$ where $| \mathcal { O } |$ is the size of the observation space (Zinkevich et al., 2007; Tammelin et al., 2015). The policy gradient method with a suitable baseline has a learning rate $\eta$ -dependent regret bound derived from the stochastic gradient method; assuming parameter norm bound $B$ and gradient estimator second moments $G ^ { 2 }$ , by setting the learning rate $\eta \propto T ^ { - 1 / 2 }$ policy gradient achieves a regret bound of $O ( \sqrt { T } )$ with no explicit dependence on the observation space size $| \mathcal { O } |$ (Dick, 2015).
|
| 168 |
+
|
| 169 |
+
We argue that possessing a regret bound proportional to the observation space size $| \mathcal { O } |$ is beneficial in highly partially observable domains. Let us fix an underlying state space $s$ . Compare two RL algorithms, where algorithm 1 (which is ARM-like) has a regret bound $c _ { 1 } | \mathcal { O } | \sqrt { T }$ , whereas algorithm 2 (which is policy gradient-like) has a regret bound $c _ { 2 } \sqrt { T }$ ; here, $c _ { 1 }$ and $c _ { 2 }$ are constants. Note that if $c _ { 1 } | \mathcal { O } | = c _ { 2 }$ or equivalently $| \mathcal { O } | = c _ { 2 } / c _ { 1 }$ , then the two RL algorithms possess the exact same regret bound. If on the other hand $\left| \mathcal { O } \right| < c _ { 2 } / c _ { 1 }$ , then the regret bound of RL algorithm 1 is actually lower than that of RL algorithm 2. Applying this intuition to CFR and hence ARM suggests that ARM can benefit from greater partial observability if the degree of partial observability is above a threshold.
|
| 170 |
+
|
| 171 |
+
For Q-learning per se, we are not aware of any known regret bound. Szepesvari proved that the ´ convergence rate of Q-learning in the $L ^ { \infty }$ -norm, assuming a fixed exploration strategy, depends on a condition number $C$ , which is the ratio of the minimum to maximum state-action occupation frequencies (Szepesvari, 1998), and which describes how “balanced” the exploration strategy is. If ´ partial observability leads to imbalanced exploration due to confounding of states from perceptual aliasing (McCallum, 1997), then Q-learning should be negatively affected.
|
| 172 |
+
|
| 173 |
+
We note that there remains a gap between ARM as implemented and the theory of CFR: the use of (a) function approximation and sampling over tabular enumeration; (b) the “ordinary” Q-function instead of the “stationary” Q-function; and (c) $n$ -step bootstrapped values instead of full returns for value function estimation. Waugh et al. (2015) address CFR with function approximation via a noisy version of a generalized Blackwell’s condition (Cesa-Bianchi & Lugosi, 2003). Even the original implementation of CFR used sampling in place of enumeration (Zinkevich et al., 2007). We refer the reader to Bellemare et al. (2016) for a more in-depth discussion of the stationary Q-function. Although only the full returns are guaranteed to be unbiased in non-Markovian settings, it is quite common for practical RL algorithms to trade off strict unbiasedness in favor of lower variance by using $n$ -step returns or variations thereof (Schulman et al., 2016; Gu et al., 2017).
|
| 174 |
+
|
| 175 |
+
# 4 EXPERIMENTS
|
| 176 |
+
|
| 177 |
+
Because we hypothesize that ARM should perform well in partially observable reinforcement learning environments, we conduct our experiments on visual domains that naturally provide partial observations of state. All of our evaluations use feedforward convnets with frame-history observations. We are interested in comparing ARM with methods that assume Markovian observations, namely double deep Q-learning (van Hasselt et al., 2016), as well as methods that can handle non-Markovian observations, primarily TRPO (Schulman et al., 2015; 2016), and to a lesser extent A3C (Mnih et al., 2016) whose critic assumes Markovian observations. We are also interested in controlling for the advantage structure of ARM by comparing with other advantage-structured methods, which include dueling networks (Wang et al., 2016), as well as policy gradient methods that estimate an empirical advantage using a baseline state-value function or critic (e.g. TRPO, A3C).
|
| 178 |
+
|
| 179 |
+
# 4.1 LEARNING TO PLAY PONG WITH A SINGLE FRAME
|
| 180 |
+
|
| 181 |
+
Atari games consist of a small set of moving sprites with fixed shapes and palettes, and the motion of sprites can be highly deterministic, so that with only 4 recently observed frames as input one can predict hundreds of frames into the future on some games using only a feedforward model (Oh et al., 2015). To increase the partial observability of Atari games, one may artificially limit the amount of frame history fed as input to the networks (Hausknecht & Stone, 2017). As a proof of concept of ARM, we trained agents to play Pong via the Arcade Learning Environment (Bellemare et al., 2013) when the frame-history length is varied between 4 (the default) and 1. We found that the performance of double deep Q-learning degraded noticeably when the frame-history length was reduced from 4 to 1, whereas performance of ARM was not affected nearly as much. Our results on Pong are summarized in Figure 1.
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
Figure 1: Comparing double deep Q-learning (orange) and ARM (blue) on Pong.
|
| 185 |
+
|
| 186 |
+
# 4.2 LEARNING TO NAVIGATE IN VIZDOOM
|
| 187 |
+
|
| 188 |
+
We evaluated ARM on the task of learning first-person navigation in the ViZDoom (Kempka et al., 2016) domain based on the game of Doom. Doom is a substantially more complex domain than Atari, featuring an egocentric viewpoint, 3D perspective, and complex visuals. We expect that Doom exhibits a substantial degree of partial observability and therefore serves as a more difficult evaluation of reinforcement learning algorithms’ effectiveness on partially observable domains. We performed our evaluation on two standard ViZDoom navigation benchmarks, “HealthGathering”
|
| 189 |
+
|
| 190 |
+
and “MyWayHome.” In “HealthGathering,” the agent is placed in a toxic room and continually loses life points, but can navigate toward healthkit objects to prolong its life; the goal is to survive for as long as possible. In “MyWayHome,” the agent is randomly placed in a small maze and must find a target object that has a fixed visual appearance and is in a fixed location in the maze; the goal is to reach the target object before time runs out. Figure 2 (top row) shows example observations from the two ViZDoom scenarios.
|
| 191 |
+
|
| 192 |
+
Unlike previous evaluations which augmented the raw pixel frames with extra information about the game state, e.g. elapsed time ticks or remaining health (Kempka et al., 2016; Dosovitskiy & Koltun, 2017), in our evaluation we forced all networks to learn using only visual input. Despite this restriction, ARM is still able to quickly learn policies with minimal tuning of hyperparameters and reach close to the maximum score in under 1 million steps. On “HealthGathering,” we observed that ARM very quickly learns a policy that can achieve close to the maximum episode return of 2100. Double deep Q-learning learns a more consistent policy on “HealthGathering” compared to ARM and TRPO, but we believe this to be the result of evaluating double DQN’s $\epsilon$ -greedy policy with small $\epsilon$ compared to the truly stochastic policies learned by ARM and TRPO. On “MyWayHome,” we observed that ARM generally learned a well-performing policy more quickly than other methods. Additionally, we found that ARM is able to take advantage of an off-policy replay memory when learning on ViZDoom by storing the trajectories of previous sampling batches and applying an importance sampling correction to the $n$ -step returns; please see Section 6.2 in the Appendix for details. Our Doom results are in Figure 6.
|
| 193 |
+
|
| 194 |
+

|
| 195 |
+
Figure 2: Top row: Doom screenshots from (left) “HealthGathering” and (right) “MyWayHome.” Bottom row: Minecraft screenshots from (leftmost) “L1” through (rightmost) “L5”
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 3: Evaluating double deep Q-learning (orange), dueling double DQN (red), A3C (purple), TRPO (green), ARM (blue), and ARM with off-policy data (cyan) on two ViZDoom scenarios.
|
| 199 |
+
|
| 200 |
+
# 4.3 LEARNING TO NAVIGATE IN MINECRAFT
|
| 201 |
+
|
| 202 |
+
We finally evaluated ARM on the task of learning first-person navigation in the Malmo domain ¨ based on the game of Minecraft (Johnson et al., 2016). Minecraft has similar visual complexity to Doom and should possess a comparable degree of partial observability, but Minecraft has the potential to be more difficult than Doom due to the diversity of possible Minecraft environments that can be generated. Our evaluation on Minecraft is adapted from the teacher-student curriculum learning protocol (Matiisen et al., 2017), which consists of 5 consecutive “levels” that successively increase the difficulty of completing the simple task of reaching a target block: the first level (“L1”) consists of a single room; the intermediate levels (“L2”–“L4”) consist of a corridor with lava-bridge and wall-gap obstacles; and the final level (“L5”) consists of a $2 \times 2$ arrangement of rooms randomly separated by lava-bridge or wall-gap obstacles. Figure 2 (bottom row) shows example observations from the five Minecraft levels.
|
| 203 |
+
|
| 204 |
+
We performed our Minecraft experiments using fixed curriculum learning schedules to evaluate the sample efficiency of different algorithms: the agent is initially placed in the first level (“L1”), and the agent is advanced to the next level whenever a preselected number of simulator steps have elapsed, until the agent reaches the last level (“L5”). We found that ARM and dueling double DQN both were able to learn on an aggressive “fast” schedule of only 62500 simulator steps between levels. TRPO required a “slow” schedule of 93750 simulator steps between levels to reliably learn. ARM was able to consistently learn a well performing policy on all of the levels, whereas double DQN learned more slowly on some of the intermediate levels. ARM also more consistently reached a high score on the final, most difficult level (“L5”). Our Minecraft results are shown in Figure 4.
|
| 205 |
+
|
| 206 |
+

|
| 207 |
+
Figure 4: Evaluating double deep Q-learning (orange), dueling double DQN (red), TRPO (green), and ARM (blue) on a Minecraft curriculum learning protocol. The simulator step counts at which each level begins are labeled and demarcated with dashed vertical lines.
|
| 208 |
+
|
| 209 |
+
# 5 DISCUSSION
|
| 210 |
+
|
| 211 |
+
In this paper, we presented a novel deep reinforcement learning algorithm based on counterfactual regret minimization (CFR). We call our method advantage-based regret minimization (ARM). Similarly to prior methods that learn state or state-action value functions, our method learns a cumulative clipped advantage function of observation and action. However, in contrast to these prior methods, ARM is well suited to partially observed or non-Markovian environments, making it an appealing choice in a number of difficult domains. When compared to baseline methods, including deep Q-learning and TRPO, on non-Markovian tasks such as the challenging ViZDoom and Malmo first- ¨ person navigation benchmarks, ARM achieves substantially better results. This illustrates the value of ARM for partially observable problems. In future work, we plan to further explore applications of ARM to more complex tasks, including continuous action spaces.
|
| 212 |
+
|
| 213 |
+
# REFERENCES
|
| 214 |
+
|
| 215 |
+
Anonymous. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id=HJjvxl-Cb.
|
| 216 |
+
|
| 217 |
+
Oron Anschel, Nir Baram, and Nahum Shimkin. Averaged-DQN: Variance Reduction and Stabilization for Deep Reinforcement Learning. In International Conference on Machine Learning, pp. 176–185, 2017.
|
| 218 |
+
|
| 219 |
+
Marc G. Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The Arcade Learning Environment: An evaluation platform for general agents. Journal of Artificial Intelligence Research, 47:253–279, 2013.
|
| 220 |
+
|
| 221 |
+
Mark G. Bellemare, Georg Ostrovski, Arthur Guez, Philip S. Thomas, and Remi Munos. Increasing ´ the Action Gap: New Operators for Reinforcement Learning. In AAAI, 2016.
|
| 222 |
+
|
| 223 |
+
Michael Bowling, Neil Burch, Michael Johanson, and Oskari Tammelin. Heads-up limit hold’em poker is solved. Science, 347(6218):145–149, 2015.
|
| 224 |
+
|
| 225 |
+
Nicolo Cesa-Bianchi and G \` abor Lugosi. Potential-Based Algorithms in On-Line Prediction and ´ Game Theory. Machine Learning, 51(3):239–261, 2003.
|
| 226 |
+
|
| 227 |
+
Travis Dick. Policy Gradient Reinforcement Learning Without Regret. Master’s thesis, University of Alberta, 2015.
|
| 228 |
+
|
| 229 |
+
Alexey Dosovitskiy and Vladlen Koltun. Learning to Act by Predicting the Future. arXiv preprint arXiv:1611.01779v2, 2017.
|
| 230 |
+
|
| 231 |
+
Jakob N. Foerster, Yannis M. Assael, Nando de Freitas, and Shimon Whiteson. Learning to Communicate with Deep Multi-Agent Reinforcement Learning. In Advances in Neural Information Processing Systems 29, 2016.
|
| 232 |
+
|
| 233 |
+
Shixiang Gu, Timothy Lillicrap, Zoubin Ghahramani, Richard E. Turner, Bernhard Scholkopf, and ¨ Sergey Levine. Interpolated Policy Gradient: Merging On-Policy and Off-Policy Gradient Estimation for Deep Reinforcement Learning. arXiv preprint arXiv:1706.00387v1, 2017.
|
| 234 |
+
|
| 235 |
+
Tuomas Haarnoja, Haoran Tang, Pieter Abbeel, and Sergey Levine. Reinforcement Learning with Deep Energy-Based Policies. arXiv preprint arXiv:1702.08165v2, 2017.
|
| 236 |
+
|
| 237 |
+
Sergiu Hart and Andreu Mas-Colell. A Simple Adaptive Procedure Leading to Correlated Equilibrium. Econometrica, 68(5):1127–1150, 2000.
|
| 238 |
+
|
| 239 |
+
Matthew Hausknecht and Peter Stone. Deep Recurrent Q-Learning for Partially Observable MDPs. arXiv preprint arXiv:1507.06527v4, 2017.
|
| 240 |
+
|
| 241 |
+
Nicolas Heess, Jonathan J. Hunt, Timothy P. Lillicrap, and David Silver. Memory-based control with recurrent neural networks. arXiv preprint arXiv:1512.04455v1, 2015.
|
| 242 |
+
|
| 243 |
+
Edward L Ionides. Truncated Importance Sampling. Journal of Computational and Graphical Statistics, 17(2):295–311, 2008.
|
| 244 |
+
|
| 245 |
+
Matthew Johnson, Katja Hofmann, Tim Hutton, and David Bignell. The Malmo Platform for Artificial Intelligence Experimentation. In Proceedings of the 25th International Joint Conference on Artificial Intelligence, 2016.
|
| 246 |
+
|
| 247 |
+
Michal Kempka, Marek Wydmuch, Grzegorz Runc, Jakub Toczek, and Wojciech Jaskowski. ViZ- ´ Doom: A Doom-based AI Research Platform for Visual Reinforcement Learning. arXiv preprint arXiv:1605.02097v2, 2016.
|
| 248 |
+
|
| 249 |
+
Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. The Journal of Machine Learning Research, 17(1):1334–1373, 2016.
|
| 250 |
+
|
| 251 |
+
Timothy P. Lillicrap, Jonathan J. Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971v5, 2016.
|
| 252 |
+
|
| 253 |
+
Michael L. Littman. Markov games as a framework for multi-agent reinforcement learning. In Proceedings of the 11th International Conference on Machine Learning, pp. 157–163, 1994.
|
| 254 |
+
|
| 255 |
+
Tambet Matiisen, Avital Oliver, Taco Cohen, and John Schulman. Teacher-Student Curriculum Learning. arXiv preprint arXiv:1707.00183v1, 2017.
|
| 256 |
+
|
| 257 |
+
Andrew Kachites McCallum. Efficient Exploration in Reinforcement Learning with Hidden State. In AAAI Fall Symposium on Model-directed Autonomous Systems, 1997.
|
| 258 |
+
|
| 259 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing Atari with Deep Reinforcement Learning. arXiv preprint arXiv:1312.5602v1, 2013.
|
| 260 |
+
|
| 261 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015.
|
| 262 |
+
|
| 263 |
+
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 International Conference on Machine Learning, pp. 1928–1937, 2016.
|
| 264 |
+
|
| 265 |
+
Ofir Nachum, Mohammad Norouzi, Kelvin Xu, and Dale Schuurmans. Bridging the Gap Between Value and Policy Based Reinforcement Learning. In 31st Conference on Neural Information Processing Systems, 2017.
|
| 266 |
+
|
| 267 |
+
Brendan O’Donoghue, Remi Munos, Koray Kavukcuoglu, and Volodymyr Mnih. Combining policy ´ gradient and Q-learning. arXiv preprint arXiv:1611.01626v3, 2017.
|
| 268 |
+
|
| 269 |
+
Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L Lewis, and Satinder Singh. Action-Conditional Video Prediction using Deep Networks in Atari Games. In Advances in Neural Information Processing Systems, pp. 2863–2871, 2015.
|
| 270 |
+
|
| 271 |
+
Junhyuk Oh, Valliappa Chockalingam, Satinder Singh, and Honglak Lee. Control of memory, active perception, and action in minecraft. In Proceedings of The 33rd International Conference on Machine Learning, pp. 2790–2799, 2016.
|
| 272 |
+
|
| 273 |
+
Xue Bin Peng, Glen Berseth, and Michiel van de Penne. Terrain-Adaptive Locomotion Skills Using Deep Reinforcement Learning. ACM Transactions on Graphics, 35(4):81, 2016.
|
| 274 |
+
|
| 275 |
+
Stephane Ross and J. Andrew Bagnell. Reinforcement and Imitation Learning via Interactive No-´ Regret Learning. arXiv preprint arXiv:1406.5979v1, 2014.
|
| 276 |
+
|
| 277 |
+
Stephane Ross, Geoffrey J. Gordon, and J. Andrew Bagnell. A Reduction of Imitation Learning and ´ Structured Prediction to No-Regret Online Learning. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 627–635, 2011.
|
| 278 |
+
|
| 279 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pp. 1889–1897, 2015.
|
| 280 |
+
|
| 281 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael I. Jordan, and Pieter Abbeel. HighDimensional Continuous Control Using Generalized Advantage Estimation. arXiv preprint arXiv:1506.02438v5, 2016.
|
| 282 |
+
|
| 283 |
+
John Schulman, Xi Chen, and Pieter Abbeel. Equivalence Between Policy Gradients and Soft QLearning. arXiv preprint arXiv:1704.06440v1, 2017.
|
| 284 |
+
|
| 285 |
+
Csaba Szepesvari. The Asymptotic Convergence-Rate of Q-learning. In ´ Advances in Neural Information Processing Systems, pp. 1064–1070, 1998.
|
| 286 |
+
|
| 287 |
+
Oskari Tammelin. Solving Large Imperfect Information Games Using $\mathrm { C F R + }$ . arXiv preprint arXiv:1407.5042v1, 2014.
|
| 288 |
+
|
| 289 |
+
Oskari Tammelin, Neil Burch, Michael Johanson, and Michael Bowling. Solving Heads-up Limit Texas Hold’em. In Proceedings of the 24th International Joint Conference on Artificial Intelligence, 2015.
|
| 290 |
+
|
| 291 |
+
Hado van Hasselt and Marco A. Wiering. Reinforcement Learning in Continuous Action Spaces. In Proceedings of the 2007 IEEE Symposium on Approximate Dynamic Programming and Reinforcement Learning, pp. 272–279, 2007.
|
| 292 |
+
|
| 293 |
+
Hado van Hasselt, Arthur Guez, and David Silver. Deep Reinforcement Learning and Double QLearning. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, 2016.
|
| 294 |
+
|
| 295 |
+
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 $3 3 r d$ International Conference on Machine Learning, pp. 1995–2003, 2016.
|
| 296 |
+
|
| 297 |
+
Ziyu Wang, Victor Bapst, Nicolas Heess, Volodymyr Mnih, Remi Munos, Koray Kavukcuoglu, and Nando de Freitas. Sample Efficient Actor-Critic with Experience Replay. arXiv preprint arXiv:1611.01224v2, 2017.
|
| 298 |
+
|
| 299 |
+
Kevin Waugh, Dustin Morrill, J. Andrew Bagnell, and Michael Bowling. Solving Games with Functional Regret Estimation. In Workshops at the Twenty-Ninth AAAI Conference on Artificial Intelligence, 2015. Supplementary material in arXiv preprint arXiv:1411.7974v2.
|
| 300 |
+
|
| 301 |
+
Martin Zinkevich, Michael Johanson, Michael H. Bowling, and Carmelo Piccione. Regret Minimization in Games with Incomplete Information. In Advances in Neural Information Processing Systems 20, pp. 1729–1736, 2007.
|
| 302 |
+
|
| 303 |
+
# 6 APPENDIX
|
| 304 |
+
|
| 305 |
+
# 6.1 EXPERIMENTAL DETAILS
|
| 306 |
+
|
| 307 |
+
# 6.1.1 PONG (ARCADE LEARNING ENVIRONMENT)
|
| 308 |
+
|
| 309 |
+
We use the preprocessing and convolutional network model of (Mnih et al., 2013). Specifically, we view every 4th emulator frame, convert the raw frames to grayscale, and perform downsampling to generate a single observed frame. The input observation of the convnet is a concatenation of the most recent frames (either 4 frames or 1 frame). The convnet consists of an $8 \times 8$ convolution with stride 4 and 16 filters followed by ReLU, a $4 \times 4$ convolution with stride 2 and 32 filters followed by ReLU, a linear map with 256 filters followed by ReLU, and a linear map with $| { \cal A } |$ filters where $| { \cal A } |$ is the action space cardinality $\lvert \lvert A \rvert = 6$ for Pong).
|
| 310 |
+
|
| 311 |
+
We used Adam with a constant learning rate of $\alpha = 1 0 ^ { - 4 }$ , a minibatch size of 32, and the moment decay rates set to their defaults $\beta _ { 1 } = 0 . 9$ and $\beta _ { 2 } = 0 . 9 9 9$ . Our results on each method are averaged across 3 random seeds.
|
| 312 |
+
|
| 313 |
+
We ran ARM with the hyperparameters: sampling batch size of 12500, 4000/3000 minibatches of Adam for the first/subsequent sampling iterations respectively, and target update step size $\tau = 0 . 0 1$ . Double DQN uses the tuned hyperparameters (van Hasselt et al., 2016). Note that our choice of ARM hyperparameters yields an equivalent number of minibatch gradient updates per sample as used by DQN and double DQN, i.e. 1 minibatch gradient update per 4 simulator steps.
|
| 314 |
+
|
| 315 |
+
# 6.1.2 DOOM (VIZDOOM)
|
| 316 |
+
|
| 317 |
+
We used a convolutional network architecture similar to those of (Kempka et al., 2016) and (Dosovitskiy & Koltun, 2017). The Doom screen was rendered at a resolution of $1 6 0 \times 1 2 0$ and downsized to $8 4 \times 8 4$ . Only every 4th frame was rendered, and the input observation to the convnet is a concatenation of the last 4 rendered RGB frames for a total of 12 input channels. The convnet contains 3 convolutions with 32 filters each: the first is size $8 \times 8$ with stride 4, the second is size $4 \times 4$ with stride 2, and the third is size $3 \times 3$ with stride 1. The final convolution is followed by a linear map with 1024 filters. A second linear map yields the output. Hidden activations are gated by ReLUs.
|
| 318 |
+
|
| 319 |
+
For “HealthGathering” only, we scaled rewards by a factor of 0.01. We did not scale rewards for “MyWayHome.” We used Adam with a constant learning rate of $\alpha = 1 0 ^ { - 5 }$ and a minibatch size of 32 to train all networks (except TRPO). For “HealthGathering” we set $\beta _ { 1 } = 0 . 9 5$ , whereas for “MyWayHome” we set $\beta _ { 1 } = 0 . 9$ . We set $\beta _ { 2 } = 0 . 9 9 9$ for both scenarios. Our results on each method are averaged across 3 random seeds.
|
| 320 |
+
|
| 321 |
+
Double DQN and dueling double DQN: $n = 5$ step returns; update interval 30000; 1 minibatch gradient update per 4 simulator steps; replay memory uniform initialization size 50000; replay memory maximum size 240000; exploration period 240000; with final exploration rate $\epsilon = 0 . 0 1$ .
|
| 322 |
+
|
| 323 |
+
A3C: 16 workers; $n = 2 0$ steps for “HealthGathering” and $n = 4 0$ steps for “MyWayHome”;
|
| 324 |
+
negentropy regularization $\beta = 0 . 0 1$ ; and gradient norm clip 5.
|
| 325 |
+
|
| 326 |
+
TRPO: sampling batch size 12500; KL-divergence step size $\delta = 0 . 0 1$ ; 10 conjugate gradient iterations; and Fisher information/Gauss-Newton damping coefficient $\lambda = 0 . 1$ .
|
| 327 |
+
|
| 328 |
+
ARM: $n = 5$ step returns; sampling batch size 12500; 4000 Adam minibatches in the first sampling iteration, 3000 Adam minibatches in all subsequent sampling iterations; target update step size $\tau = 0 . 0 1$ . Again, our choice of ARM hyperparameters yields an equivalent number of minibatch gradient updates per sample as used by DQN and double DQN. For “HealthGathering” only, because ARM converges so quickly we annealed the Adam learning rate to $\alpha = 2 . 5 \times 1 0 ^ { - 6 }$ after 500000 elapsed simulator steps.
|
| 329 |
+
|
| 330 |
+
Off-policy ARM: $n = 5$ step returns; sampling batch size 1563, replay cache sample size 25000; 400 Adam minibatches per sampling iteration; target update step size $\tau = 0 . 0 1$ ; and importance sampling weight clip $c = 1$ .
|
| 331 |
+
|
| 332 |
+
# 6.1.3 MINECRAFT (MALMO¨ )
|
| 333 |
+
|
| 334 |
+
Our Minecraft tasks generally were the same as the ones used by Matiisen et al. (2017), with a few differences. Instead of using a continuous action space, we used a discrete action space with 4 move and turn actions. To aid learning on the last level (“L5”), we removed the reward penalty upon episode timeout and we increased the timeout on “L5” from 45 seconds to 75 seconds due to the larger size of the environment. We scaled rewards for all levels by 0.001.
|
| 335 |
+
|
| 336 |
+
We use the same convolutional network architecture for Minecraft as we used for ViZDoom in Section 4.2. The Minecraft screen was rendered at a resolution of $3 2 0 \times 2 4 0$ and downsized to $8 4 \times$ 84. Only every 5th frame was rendered, and the input observation of the convnet is a concatenation of the last 4 rendered RGB frames for a total of 12 input channels. We used Adam with constant learning rate $\alpha = 1 0 ^ { - 5 }$ , moment decay rates $\beta _ { 1 } = 0 . 9$ and $\beta _ { 2 } = 0 . 9 9 9$ , and minibatch size 32 to train all networks (except TRPO). Our results on each method are averaged across 5 random seeds.
|
| 337 |
+
|
| 338 |
+
Double DQN and dueling double DQN: $n = 5$ step returns; update interval 12500; 1 minibatch gradient update per 4 simulator steps; replay memory uniform initialization size 12500; replay memory maximum size 62500; exploration period 62500; with final exploration rate $\epsilon = 0 . 0 1$ .
|
| 339 |
+
|
| 340 |
+
TRPO: sampling batch size 6250; KL-divergence step size $\delta = 0 . 0 1$ ; 10 conjugate gradient iterations; and Fisher information/Gauss-Newton damping coefficient $\lambda = 0 . 1$ .
|
| 341 |
+
|
| 342 |
+
ARM: $n = 5$ step returns; sampling batch size 12500; 4000 Adam minibatches in the first sampling iteration, 3000 Adam minibatches in all subsequent sampling iterations; target update step size $\tau = 0 . 0 1$ .
|
| 343 |
+
|
| 344 |
+
# 6.2 OFF-POLICY ARM VIA IMPORTANCE SAMPLING
|
| 345 |
+
|
| 346 |
+
Our current approach to running ARM with off-policy data consists of applying an importance sampling correction directly to the $n$ -step returns. Given the behavior policy $\mu$ under which the data was sampled, the current policy $\pi _ { t }$ under which we want to perform estimation, and an importance sampling weight clip $c$ for variance reduction, the corrected $n$ -step return we use is:
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
g _ { k } ^ { n } ( \mu \| \pi _ { t } ) = \sum _ { k ^ { \prime } = k } ^ { k + n - 1 } \gamma ^ { k ^ { \prime } - k } \left( \prod _ { \ell = k } ^ { k ^ { \prime } } w _ { \mu \| \pi _ { t } } ( a _ { \ell } | o _ { \ell } ) \right) r _ { k ^ { \prime } }
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
where the truncated importance weight $\scriptstyle w _ { \mu \parallel \pi _ { t } } ( a | o )$ is defined (Ionides, 2008):
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
w _ { \boldsymbol { \mu } \parallel \pi _ { t } } ( a | o ) = \operatorname* { m i n } \left( c , \frac { \pi _ { t } ( a | o ) } { \mu ( a | o ) } \right) .
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
Our choice of $c = 1$ in our experiments was inspired by Wang et al. (2017). We found that $c = 1$ worked well but note other choices for $c$ may also be reasonable.
|
| 359 |
+
|
| 360 |
+
When applying our importance sampling correction, we preserve all details of the ARM algorithm except for two aspects: the transition sampling strategy (a finite memory of previous batches are cached and uniformly sampled) and the regression targets for learning the value functions. Specifically, the regression targets $v ( o _ { k } ; \varphi )$ , $q ( o _ { k } , a _ { k } ; \varphi )$ , and $\bar { q } ^ { + } ( o _ { k } , a _ { k } ; \bar { \varphi } )$ (Equations (11)–(13)) are modified to the following:
|
| 361 |
+
|
| 362 |
+
$$
|
| 363 |
+
\begin{array} { r l } & { \quad v _ { \mu \parallel \pi _ { t } } ( o _ { k } ; \varphi ) = g _ { k } ^ { n } ( \mu \| \pi _ { t } ) + \gamma ^ { n } V ^ { \prime } ( o _ { k + n } ; \varphi ) } \\ & { \quad q _ { \mu \parallel \pi _ { t } } ( o _ { k } , a _ { k } ; \varphi ) = r _ { k } + \gamma w _ { \mu \parallel \pi _ { t } } ( a _ { k } | o _ { k } ) g _ { k + 1 } ^ { n - 1 } ( \mu \| \pi _ { t } ) + \gamma ^ { n } V ^ { \prime } ( o _ { k + n } ; \varphi ) } \\ & { \quad \bar { q } _ { \mu \parallel \pi _ { t } } ^ { + } ( o _ { k } , a _ { k } ; \varphi ) = \operatorname* { m a x } ( 0 , \bar { Q } _ { t - 1 } ^ { + } ( o _ { k } , a _ { k } ; \omega _ { t - 1 } ) - V _ { \pi _ { t - 1 } } ( o _ { k } ; \theta _ { t - 1 } ) ) + q _ { \mu \parallel \pi _ { t } } ( o _ { k } , a _ { k } ; \varphi ) . } \end{array}
|
| 364 |
+
$$
|
| 365 |
+
|
| 366 |
+
Note that the target value function $V ^ { \prime } ( o _ { k + n } ; \varphi )$ does not require an importance sampling correction because $V ^ { \prime }$ already approximates the on-policy value function $V _ { \pi _ { t } } \big ( o _ { k + n } ; \theta _ { t } \big )$ .
|
| 367 |
+
|
| 368 |
+
# 6.3 ADDITIONAL EXPERIMENTS
|
| 369 |
+
|
| 370 |
+
# 6.3.1 ATARI 2600 GAMES
|
| 371 |
+
|
| 372 |
+
Although our primary interest is in partially observable reinforcement learning domains, we also want to check that ARM works in nearly fully observable and Markovian environments, such as
|
| 373 |
+
|
| 374 |
+
Atari 2600 games. We consider two baselines: double deep Q-learning, and double deep fitted Qiteration which is a batch counterpart to double DQN. We find that double deep Q-learning is a strong baseline for learning to play Atari games, although ARM still successfully learns interesting policies. One major benefit of Q-learning-based methods is the ability to utilize a large off-policy replay memory. Our results on a suite of Atari games are in Figure 5.
|
| 375 |
+
|
| 376 |
+

|
| 377 |
+
Figure 5: Comparing double deep Q-learning (orange), double deep fitted Q-iteration (red), and ARM (blue) on a suite of seven Atari games from the Arcade Learning Environment. For each method, we plot the mean across 3 trials along with standard error bars.
|
| 378 |
+
|
| 379 |
+
# 6.3.2 RECURRENCE IN DOOM MYWAYHOME
|
| 380 |
+
|
| 381 |
+
We evaluated the effect of recurrent policy and value function estimation in the maze-like MyWayHome scenario of ViZDoom. We found that recurrence has a small positive effect on the convergence of A2C (Mnih et al., 2016), but was much less significant than the choice of algorithm. Our hyperparameters were similar to those described for A3C in Section 6.1.2, except we used a learning rate $\mathrm { \dot { 1 } 0 ^ { - 4 } }$ and gradient norm clip 0.5. For the recurrent policy and value function, we replaced the first fully connected operation with an LSTM featuring an equivalent number of hidden units (1024).
|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
Figure 6: Comparing A2C with a feedforward convolutional network (blue) and a recurrent convolutional-LSTM network (orange) on the ViZDoom scenario MyWayHome.
|
md/train/BkVsWbbAW/BkVsWbbAW.md
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP GENERATIVE DUAL MEMORY NETWORK FOR CONTINUAL LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Despite advances in deep learning, artificial neural networks do not learn the same way as humans do. Today, neural networks can learn multiple tasks when trained on them jointly, but cannot maintain performance on learnt tasks when tasks are presented one at a time – this phenomenon called catastrophic forgetting is a fundamental challenge to overcome before neural networks can learn continually from incoming data. In this work, we derive inspiration from human memory to develop an architecture capable of learning continuously from sequentially incoming tasks, while averting catastrophic forgetting. Specifically, our model consists of a dual memory architecture to emulate the complementary learning systems (hippocampus and the neocortex) in the human brain and maintains a consolidated long-term memory via generative replay of past experiences. We (i) substantiate our claim that replay should be generative, (ii) show the benefits of generative replay and dual memory via experiments, and (iii) demonstrate improved performance retention even for small models with low capacity. Our architecture displays many important characteristics of the human memory and provides insights on the connection between sleep and learning in humans.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Many machine learning models, when trained sequentially on tasks, forget how to perform the previously learnt tasks. This phenomenon called catastrophic forgetting is prominent in neural networks (McCloskey & Cohen, 1989). Without a way to avert catastrophic forgetting, a learning system needs to store all training data and relearn on it along with new incoming data, when retraining. Hence, it is an important challenge to overcome in order to enable systems to learn continuously.
|
| 12 |
+
|
| 13 |
+
McCloskey & Cohen (1989) first suggested that the underlying cause of forgetting was the distributed shared representation of tasks via network weights. Subsequent works attempted to remedy the issue by reducing representational overlap between input representations via activation sharpening algorithms (Kortge, 1990), orthogonal recoding of inputs (Lewandowsky, 1991) or orthogonal activations at all hidden layers (McRae & Hetherington, 1993; French, 1994). More recent works have explored activations like dropout (Goodfellow et al., 2015) and local winner-takes-all (Srivastava et al., 2013) to create sparse, less correlated feature representations. But such sparse encodings can be task specific at times and in general act as heuristics to mildly pacify the underlying problem.
|
| 14 |
+
|
| 15 |
+
Further, natural cognitive systems are also connectionist in nature and yet they forget gradually but not ‘catastrophically’. For instance, humans demonstrate gradual systematic forgetting. Frequently and recently encountered tasks tend to survive much longer in the human memory, while those rarely encountered are slowly forgotten. Some of the earlier tasks may be seen again, but it is not necessary for them to be retained in memory (French, 1999). Hence only sparsifying representations does not solve the problem. Instead, neuroscientific evidence suggests that humans have evolved mechanisms to separately learn new incoming tasks and consolidate the learning with previous knowledge to avert catastrophic forgetting (McClelland et al., 1995; O’Neill et al., 2010; French, 1999).
|
| 16 |
+
|
| 17 |
+
Complementary learning systems: McClelland et al. (1995) suggested that this separation has been achieved in the human brain via evolution of two separate areas of the brain, the hippocampus and the neocortex. The neocortex is a long term memory which specializes in consolidating new information with previous knowledge and gradually learns the joint structure of all tasks and experiences; whereas the hippocampus acts as a temporary memory to rapidly learn new tasks and then slowly transfer the knowledge to neocortex after acquisition.
|
| 18 |
+
|
| 19 |
+
Experience replay: Another factor deemed essential for sequential learning is experience replay. McClelland et al. (1995); O’Neill et al. (2010) have emphasized the importance of replayed data patterns in the human brain during sleep and waking rest. Robins (1995; 2004) proposed several replay techniques (a.k.a. pseudopattern rehearsal) to achieve replay, but they involved generating replay data without storing input representations and our experiments show that they lack the accuracy required for consolidation.
|
| 20 |
+
|
| 21 |
+
Weight consolidation or freezing: Recent evidence from neuroscience also suggests that mammalian brain protects knowledge in the neocortex via task-specific consolidation of neural synapses over long periods of time (Yang et al., 2014; Benna & Fusi, 2016). Such techniques have recently been employed in progressive neural networks (Rusu et al., 2016) and Pathnets (Fernando et al., 2017) both of which freeze neural network weights after learning tasks. Kirkpatrick et al. (2017) have used the fisher information matrix (FIM) to slow down learning on network weights which correlate with previously acquired knowledge.
|
| 22 |
+
|
| 23 |
+
In this paper, we address the catastrophic forgetting problem by drawing inspiration from the above neuroscientific insights and present a method to overcome catastrophic forgetting. More specifically, we propose a dual-memory architecture for learning tasks sequentially while averting catastrophic forgetting. Our model comprises of two generative models: a short-term memory (STM) to emulate the human hippocampal system and a long term memory (LTM) to emulate the neocortical learning system. The STM learns new tasks without interfering with previously learnt tasks in the LTM. The LTM stores all previously learnt tasks and aids the STM in learning tasks similar to previous tasks. During sleep/down-time, the STM generates and transfers samples of learnt tasks to the LTM. These are gradually consolidated with the LTM’s knowledge base of previous tasks via generative replay.
|
| 24 |
+
|
| 25 |
+
Our approach is inspired from the strengths of deep generative models, experience replay and the complementary learning systems literature. We demonstrate our method’s effectiveness in averting catastrophic forgetting by sequentially learning multiple tasks. Moreover, our experiments shed light on some characteristics of human memory as observed in the psychology and neuroscience literature.
|
| 26 |
+
|
| 27 |
+
# 2 PROBLEM SETTING: SEQUENTIAL MULTITASK LEARNING
|
| 28 |
+
|
| 29 |
+
Formally, our problem setting can be called Sequential Multitask Learning and is characterized by a set of tasks $\mathbb { T }$ , which are to be learnt by a model parameterized by weights $\theta$ (e.g. a neural network). From here on, we will use the the phrase model and neural network interchangeably. In this work we mainly consider supervised learning tasks i.e. task $t \in \mathbb { T }$ has training examples: $\{ x _ { i } ^ { t } , y _ { i } ^ { t } \} _ { i = 1 : N _ { t } }$ for $x _ { i } ^ { t } \in \mathcal X$ and $y _ { i } ^ { t } \in \bar { \mathcal { V } }$ , but our model easily generalizes to unsupervised learning settings. Note that tasks are presented sequentially and the total number of tasks $\lvert \mathbb { T } \rvert$ is not known a priori.
|
| 30 |
+
|
| 31 |
+
Finite memory: We further assume that any training algorithm can store some examples from each task if needed, but the storage $( N _ { m a x } )$ is limited and can be smaller than the total number of examples from all tasks $\left( \sum _ { t = 1 } ^ { | \mathbb { T } | } N _ { t } \right)$ . So, algorithms cannot store all training examples and re-learn on them when new tasks arrive. The same restriction applies to algorithms with generative models i.e. no more than $N _ { m a x }$ examples allowed at any time (generated $^ +$ stored).
|
| 32 |
+
|
| 33 |
+
For testing, the model can be asked to predict the label $y ^ { t } \in \mathcal { V }$ for any example $x ^ { t } \in \mathcal { X }$ from any previously seen task $t \in \mathbb { T }$ . Our goal is to devise an algorithm which learns these tasks sequentially while avoiding catastrophic forgetting and can achieve a test loss close to that of a model which learnt all the tasks jointly.
|
| 34 |
+
|
| 35 |
+
# 3 DEEP GENERATIVE DUAL MEMORY NETWORK
|
| 36 |
+
|
| 37 |
+
The idea of replaying experience to a neural network has been used previously for reinforcement learning (Lin, 1993; Mnih et al., 2015). A study by O’Neill et al. (2010) suggests that experience replay also occurs in the human brain during sleep and waking rest and aids in consolidation of learnt experiences. We propose that experience replay must be generative in nature. This is better than storing all samples in replay memories as is common in reinforcement learning (Mnih et al., 2015), since sampling from a generative model automatically provides the most frequently encountered samples. It is also feasible with limited total memory, whereas explicitly storing samples from previous tasks requires determining which and how many samples to store for each task. Determining this can depend on the total tasks $\left| \mathbb { T } \right|$ , number of examples per task $N _ { t }$ and frequency of occurrence of samples, which are often not available a priori.
|
| 38 |
+
|
| 39 |
+
Previously proposed non-generative approaches to experience replay (Robins, 1995; French, 1997; Robins, 2004) propose to preserve neural networks’ learnt mappings by arbitrarily sampling random inputs and their corresponding outputs from the neural networks and using them along with new task samples while training. These approaches have only been tested in small binary input spaces in previous works, and our experiments in section 4 show that sampling random inputs in highdimensional spaces (e.g. images) does not preserve the mapping learnt by neural networks.
|
| 40 |
+
|
| 41 |
+
# 3.1 GENERATIVE EXPERIENCE REPLAY
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 1: Deep Generative Replay to train a Deep Generative Memory
|
| 45 |
+
|
| 46 |
+
Deep Generative Memory (DGM): We first introduce a sub-model called the Deep Generative Memory (see figure 1) which has three elements: (i) a generative model (the generator $G$ ), (ii) a feedforward network (the learner $L$ ), and (iii) a dictionary $( D _ { d g m } )$ with task IDs of learnt tasks and the number of times they were encountered. We call this a memory because of its weights and learning capacity, not due to any recurrent connections. We assume availability of unique task IDs for replay and to identify repetition. In practice, a task identification system (e.g., a HMM-based inference model) like in previous works (Kirkpatrick et al., 2017) suffices for this purpose. We choose variational autoencoder (VAE) (Kingma & Welling, 2014) for the generator, since our generative model requires reconstruction capabilities (see section 3.2).
|
| 47 |
+
|
| 48 |
+
Deep Generative Replay (DGR): We update a DGM with samples from (multiple) new tasks using our algorithm Deep Generative Replay (see figure 1 above and algorithm 1 in appendix A). Given new incoming samples $( X , Y )$ , DGR first computes the fraction of total samples that should come from incoming samples $( \eta _ { t a s k s } )$ and the fraction to come from previous task samples $( \eta _ { g e n } )$ proportionate to the number of tasks (counting repetitions). It allots a minimum fraction $\kappa$ of the memory capacity $N _ { m a x }$ per new task. This ensures that as the DGM saturates with tasks over time, new tasks are still learnt at the cost of gradually losing performance on the least recent previous tasks. This saturation is synonymous to how learning slows down in humans as they age but they still continue to learn new tasks while forgetting old things gradually (French, 1999). Next, DGR computes the number of samples to be generated from previous tasks and subsamples the incoming samples (if needed) to obey maximum memory capacity $( N _ { m a x } )$ . It then generates samples of previously learnt tasks $( X _ { g e n } , Y _ { g e n } )$ using the generator and learner, reconstructs the data $\{ X , X _ { g e n } \}$ using the generator (hence we use a VAE) and then trains the DGM on resulting samples $\scriptstyle ( X _ { r e c o n }$ , $\{ Y , Y _ { g e n } \} )$ . Doing this final reconstruction provides robustness to noise and occlusion (section 5).
|
| 49 |
+
|
| 50 |
+
# 3.2 DUAL MEMORY NETWORKS
|
| 51 |
+
|
| 52 |
+
A good continual learning system needs to quickly acquire new tasks and also retain performance on previously learnt tasks. These conflicting requirements are hard to satisfy simultaneously. Hence, inspired by nature’s solution to this problem, we propose a dual memory network to combat forgetting.
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 2: Deep Generative Dual Memory Network (DGDMN)
|
| 56 |
+
|
| 57 |
+
Our architecture (DGDMN) shown in figure 2 comprises of a large deep generative memory (DGM) called the long-term memory (LTM) which stores information of all previously learnt tasks like the neocortex, and a short-term memory (STM) which behaves similar to the hippocampus and learns new incoming tasks quickly without interference from previous tasks. The STM is a collection of small, dedicated, task-specific deep generative memories (called short-term task memory – STTM), which can each learn one unique task. If an incoming task comes is already in an STTM, the same STTM is used to retrain on it, otherwise a fresh STTM is allocated to the task. Additionally, if the task has been previously consolidated then the LTM reconstructs the incoming samples for that task using the generator (hence we use a VAE), predicts labels for the reconstructions using its learner and sends these newly generated samples to the STTM allocated to this task. This provides extra samples on tasks which have been learnt previously and helps to learn them better, while also preserving the previous performance on that task to some extent.
|
| 58 |
+
|
| 59 |
+
Once all $\left( n _ { S T M } \right)$ STTMs are exhausted, the architecture sleeps (like humans) to consolidate all tasks into the LTM and free up the STTMs for new tasks. While asleep, the STM generates and sends samples of learnt tasks to the LTM, where these are consolidated via deep generative replay (see figure 2). While testing on task $t$ (even intermittently between tasks), if any STTM currently contains task $t$ , it is used to predict the labels, else the prediction is deferred to the LTM. This allows predicting on all tasks seen uptil now (including the most recent ones) without sleeping.
|
| 60 |
+
|
| 61 |
+
# 4 EXPERIMENTS
|
| 62 |
+
|
| 63 |
+
We perform experiments to demonstrate forgetting on sequential image classification tasks. We briefly describe our datasets here (details in appendix B): (a) Permnist is a catastrophic forgetting (Goodfellow et al., 2015; Kirkpatrick et al., 2017) benchmark and each task contains a fixed permutation of pixels on MNIST images (LeCun et al., 1998), (b) Digits dataset involves classifying a single MNIST digit per task, (c) TDigits is a transformed variant of MNIST similar to Digits but with 40 tasks for long task sequences, (d) Shapes contains several geometric shape classification tasks, and (e) Hindi contains a sequence of 8 tasks with hindi language consonant recognition.
|
| 64 |
+
|
| 65 |
+
Along with our model (DGDMN), we test several baselines for catastrophic forgetting, which are briefly described here (implementation and hyperparameter details in appendix B): (a) Feedforward neural networks (NN): We use these to characterize the forgetting in the absence of any prevention mechanism and as a datum for other approaches, (b) Neural nets with dropout (DropNN): Goodfellow et al. (2015) suggested using dropout as a means to prevent representational overlaps and pacify catastrophic forgetting, (c) Pseudopattern Rehearsal (PPR): A non-generative approach to experience replay (Robins, 2004), (d) Elastic Weight Consolidation (EWC): Kirkpatrick et al. (2017) proposed using the Fisher Information Matrix for task-specific consolidation of weights in a neural network, and (e) Deep Generative Replay (DGR): Using a single DGM to separate the effects of generative replay and dual memory architecture.
|
| 66 |
+
|
| 67 |
+
In our preliminary experiments, we observed that large networks with excessive parameters can more easily adapt to sequentially incoming tasks, thereby masking the severity of catastrophic forgetting. So we have chosen network architectures which have to share all their parameters appropriately amongst the various tasks in a dataset to achieve reasonable joint accuracy on the dataset. This allows us to evaluate an algorithm carefully while ignoring the benefits provided by excessive parameterization.
|
| 68 |
+
|
| 69 |
+
# 4.1 ACCURACY AND FORGETTING CURVES
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
Figure 3: Accuracy curves for Permnist (x: tasks seen, y: classification accuracy on task).
|
| 73 |
+
|
| 74 |
+
We trained DGDMN and all above baselines sequentially on the image classification tasks of Permnist, Digits, Shapes and Hindi datasets (separately). We show results on the Shapes and Hindi dataset in appendix A. The classification accuracy on a held out test set for each task, after training on the $t ^ { t h }$ task has been shown in figures 3 and 4. We used the same network architecture for each of NN, PPR, EWC, learner in DGR, and learner in the LTM of DGDMN (for a single dataset). DropNN had two intermediate dropout layers after each hidden layer (see appendix B for details).
|
| 75 |
+
|
| 76 |
+
We observe from figures 3a and 3b, that NN and DropNN forget catastrophically when they learn new tasks. This shows that sparse representation based methods rely on the neural network being of high enough capacity to learn sparse representations (Goodfellow et al., 2015) and may not perform well if the network does not have redundant weights available. EWC forgets less than NN and DropNN, but it rapidly slows down learning on many weights and its learning effectively stagnates after Task 3 (e.g. see Tasks 5 and 6 in figure 3d). The learning slowdown on weights hinders EWC from reusing those weights later on to jointly discover common structures amongst previously learnt and newly incoming tasks. Note that the networks do have the capacity to learn all tasks and our algorithms DGR and DGDMN outperform all baselines by learning all tasks sequentially with this same learner network (figures 3e, 3f).
|
| 77 |
+
|
| 78 |
+
We observed heavy forgetting on Digits (figure 4) for most baselines, which is expected because all samples in the $t ^ { t h }$ task have a single label $\mathbf { \rho } ( t )$ and so the $t ^ { t h }$ task can be learnt on its own by setting the $\hat { t } ^ { t h }$ bias of the softmax layer to be high and the other biases low. Such sequential tasks cause catastrophic forgetting. We observed that NN, DropNN, PPR and EWC learnt only the task being trained on and forgot all previous knowledge immediately. Sometimes, we also observed saturation due to the softmax bias being set very high and then being unable to recover from it. PPR showed severe saturation since its replay prevented it from coming out of the saturation.
|
| 79 |
+
|
| 80 |
+
DGR and DGDMN still retain performance on all tasks of Digits, and our replay strategy prevents saturation by appropriately balancing the ratios of new incoming samples and generated samples from previous tasks. The average forgetting on all tasks $\in \{ 1 , \ldots , t \}$ , after training on the $t ^ { t h }$ task (for both Digits and Permnist) is shown in figure 5. For absolute reference, the accuracy of NN by training it jointly on all tasks uptil the $t ^ { t h }$ task has also been shown for each $t$ . Again DGR and DGDMN outperform baselines in terms of retained average accuracy. In figure 5b, NN, DropNN, PPR and EWC follow nearly overlapping curves $\begin{array} { r } { ( a c c \approx \frac { 1 } { t } } \end{array}$ ) since they are only able to learn one task at a time. Further, though PPR involves experience replay, it does not compare against DGR and
|
| 81 |
+
|
| 82 |
+

|
| 83 |
+
Figure 4: Accuracy curves for Digits (x: tasks seen, y: classification accuracy on task).
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
Figure 5: Forgetting curves (x: tasks seen, y: avg classification accuracy on tasks seen).
|
| 87 |
+
|
| 88 |
+
DGDMN (figures 3c, 4c). Although, it does preserve its learnt mapping around the points randomly sampled from its domain, these random samples are not close to real images and fail to preserve performance. These observations substantiate our claim that any replay mechanism must model the input domain accurately and hence needs to be generative in nature. We observed similar results for the Shapes and Hindi dataset (appendix A).
|
| 89 |
+
|
| 90 |
+
We point out that datasets like Digits, which contain tasks with highly correlated input (and/or output) samples should be important benchmarks for continual learning for two main reasons: (i) High correlation amongst task samples promotes overfitting to the new incoming task and therefore causes catastrophic forgetting. Being able to retain performance on such task sequences is a strong indicator of the efficacy of a continual learning algorithm. (ii) Humans also learn by seeing many correlated samples together in a short span of time, rather than witnessing nearly IID samples (like in Permnist). For examples, kids learn a single alphabet per day in kindergarten by seeing and writing that alphabet many times that day. Since NN, DropNN and PPR do not fare well on such tasks, we show experiments on EWC, DGR and DGDMN from here on.
|
| 91 |
+
|
| 92 |
+
# 4.2 REPEATED TASKS AND REVISION
|
| 93 |
+
|
| 94 |
+
It is well known in psychology literature that human learning improves via revision (Kahana & Howard, 2005; Cepeda et al., 2006). We show performance of EWC and DGDMN on Permnist, when some tasks are repeated (figure 6). DGR performs very similar to DGDMN, hence we omit it. EWC stagnates and once learning has slowed down on the weights important for Task 1, the weights cannot be changed again, not even for improving Task 1. Further, it did not learn Task 6 the first time and revision does not help either. However, DGDMN learns all tasks uptil Task 6, then benefits by revising Task 1 again (accuracy goes up), and somewhat for Task 6 (it did not forget Task 6 substantially). We reiterate that DGDMN, by its design, benefits significantly from revision because STTMs learning a repeated task gain extra samples from the LTM (or generated samples from themselves, if they had learnt the task before). While many previous works do not investigate revision, it is crucial for learning continuously and should improve performance on tasks. The ability to learn from correlated task samples and revision makes our memory architecture functionally similar to that of humans.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 6: Accuracy curves when tasks are revised: (a) EWC, (b) DGDMN.
|
| 98 |
+
|
| 99 |
+
# 4.3 CONNECTIONS TO COMPLEMENTARY LEARNING SYSTEMS AND SLEEP
|
| 100 |
+
|
| 101 |
+
To explore the role of the dual memory architecture and differentiate between DGDMN and DGR, we trained these algorithms on the long sequence of 40 tasks from TDigits dataset. We limited $N _ { m a x }$ to 120, 000 samples for this task to explore the case where the LTM in DGDMN (DGM in DGR) cannot regenerate as many samples as in the full dataset and has to forget some tasks. At least $\kappa = 0 . 0 5$ fraction of memory was ensured per new task and consolidation in DGDMN happened after $n _ { S T M } = 5$ tasks.
|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
Figure 7: Accuracy curves for TDigits on: (a) tasks seen so far, (b) last 10 tasks seen.
|
| 105 |
+
|
| 106 |
+
The average forgetting curves vs. tasks encountered are plotted in figure 7a. DGDMN and DGR start around an average accuracy of 1.0, but start dropping after 10 tasks since the LTM (DGM for DGR) begins to saturate. While DGDMN drops slowly and retains $> 4 0 \%$ accuracy on all tasks, DGR drops below $2 0 \%$ accuracy. This is because DGR consolidates its DGM too often and the DGM’s self-generated slightly erroneous samples compound errors quite fast. DGDMN uses small STTMs to learn single tasks with low error and transfers them simultaneously to the LTM. As a consequence, DGDMN consolidates its LTM with more accurate samples and less often, hence its error accumulates much slower. We discuss the effect of the small error in STTM representations in section 5.
|
| 107 |
+
|
| 108 |
+
Even though DGDMN displays inevitable forgetting in figure $\mathrm { 7 a }$ (due to memory constraint), the forgetting is gradual and not catastrophic as seen for NN, DropNN, PPR etc. on Digits dataset. We also measure average accuracy on the most recent few tasks seen (say 10). Figure 7b shows that DGDMN oscillates around $9 0 \%$ average accuracy, whereas DGR’s frequent consolidation propagates errors too fast and its accuracy drops even on this metric.
|
| 109 |
+
|
| 110 |
+
Another advantage of dual memories is revealed by the training time for the algorithms. Figure 9a shows an order of magnitude of difference between DGDMN and DGR in training time. This is because STTMs are smaller and faster to train than the LTM. LTM preserves all the tasks seen so far and hence requires a large number of samples to consolidate, which is costly and should not be done after every task. Learning new tasks quickly in the STM and holding them till sleep provides a speed advantage and allows learning quickly with only periodic consolidation.
|
| 111 |
+
|
| 112 |
+
The dual memory architecture is a critical design choice for scalability and has also emerged naturally in humans, in the form of the complementary learning systems and the need to sleep periodically. Even though sleeping is a dangerous behavior for any organism since it can be harmed or attacked by a predator while asleep, sleep has still survived through eons of evolution and never been lost (Joiner, 2016). Today, most organisms with even a slightly developed nervous system (centralized or diffuse) display either sleep or light-resting behavior (Nath et al., 2017). The experiment demonstrates the importance of sleep, since without the dual memory architecture intertwined with periodic sleep, learning would be very short lived and highly time consuming (as in DGR).
|
| 113 |
+
|
| 114 |
+
# 5 ANALYSIS AND DISCUSSION
|
| 115 |
+
|
| 116 |
+
In this section we show that DGDMN shares some more remarkable characteristics with the human memory and present a discussion of some more related ideas. Due to space constraints, visualizations of the learnt latent structures when training jointly vs. sequentially have been deferred to appendix A. The hyperparameters of DGDMN $\kappa$ and $n _ { S T M }$ ) have intuitive interpretations and we have provided simple heuristics to choose them without any complex searches (in appendix B).
|
| 117 |
+
|
| 118 |
+
Resilience to noise and occlusion: We use a VAE to be able to reconstruct representations of samples. Reconstructed images are less noisy and can recover from partial occlusion, which gives our model human-like abilities to recognize objects in noisy, distorted or occluded images. We test our LTM model and a NN model by jointly training on uncorrupted Digits data and testing on noisy and occluded images. We see that the LTM is more robust to noisy and occluded images and exhibits smoother degradation in classification accuracy because of its denoising reconstructive properties (see figure 8).
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 8: (a) LTM reconstruction from noisy and occluded digits, (b) Classification accuracy with increasing gaussian noise, and (c) Classification accuracy with increasing occlusion factor.
|
| 122 |
+
|
| 123 |
+
The choice of underlying generative model: Our consolidation ability and retention performance relies heavily on the generation and reconstruction ability of the underlying generative model. We chose a VAE for its reconstructive capabilities but our architecture is agnostic to the choice of the underlying generative model as long as the generator can generate reliable samples and reconstruct incoming samples accurately. Hence, variants of Generative Adversarial Networks (GAN) Goodfellow et al. (2014) like BiGANs (Donahue et al., 2017), ALI (Dumoulin et al., 2017) and AVB (Mescheder et al., 2017) can also be used for the generative model depending on the modeled domain.
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 9: (a) Training time for DGDMN and DGR, (b) Accuracy curves: DGDMN (no STM).
|
| 127 |
+
|
| 128 |
+
Why use short-term memory?: Our LTM always learns from STTMs and never from real data, and the STTMs’ errors slowly propagate into the LTM and contribute to forgetting. An alternative could be to directly store data from new incoming tasks, consolidate it into the LTM after periodic intervals, and then discard the data. We show the accuracy curves on Digits dataset for this approach in figure 9b. This results in higher retention compared to DGDMN in figure 4 because LTM now learns from real data. However, this approach is not truly online since recently learnt tasks cannot be used immediately until after a sleep phase. Since the STM’s error can be made smaller by using high capacity generators and classifiers, we suggest using a STM for true online continual learning.
|
| 129 |
+
|
| 130 |
+
Connections to knowledge distillation: Previous works on (joint) multitask learning have also proposed approaches to learn individual tasks with small networks and then “distilling” them jointly into a larger neural network (Rusu et al., 2015). Such distillation can sometimes improve performance on individual tasks if they share structure and at other times mitigate inter-task interference due to refinement of learnt functions while distilling (Parisotto et al., 2016). Though we do not use temperature-controlled soft-labels while consolidating tasks into the LTM (unlike distillation), we surmise that due to refinement and compression during consolidation phase, DGDMN is also able to learn joint task structure effectively while mitigating interference between tasks.
|
| 131 |
+
|
| 132 |
+
Approaches based on synaptic consolidation: Though our architecture draws inspiration from complementary learning systems and experience replay in the human brain, there is also considerable neuroscientific evidence for synaptic consolidation in the human brain (like in EWC). It might be interesting to explore how synaptic consolidation can be incorporated in our dual memory architecture without causing stagnation and we leave this to future work. We also plan to extend our architecture to learning optimal policies over time via reinforcement learning without explicit replay memories.
|
| 133 |
+
|
| 134 |
+
# 6 CONCLUSION
|
| 135 |
+
|
| 136 |
+
In this work, we have developed a model capable of learning continuously on sequentially incoming tasks, while averting catastrophic forgetting. Our model employs a dual memory architecture to emulate the complementary learning systems (hippocampus and the neocortex) in the human brain and maintains a consolidated long-term memory via generative replay of past experiences. We have shown that generative replay performs the best for long-term performance retention even for neural networks with small capacity, while demonstrating the benefits of using generative replay and a dual memory architecture via our experiments. Our model hyperparameters have simple interpretations and can be set without much tuning. Moreover, our architecture displays remarkable parallels with the human memory system and provides useful insights about the connection between sleep and learning in humans.
|
| 137 |
+
|
| 138 |
+
# REFERENCES
|
| 139 |
+
|
| 140 |
+
Marcus K Benna and Stefano Fusi. Computational principles of synaptic memory consolidation. Nature neuroscience, 2016.
|
| 141 |
+
|
| 142 |
+
Nicholas J Cepeda, Harold Pashler, Edward Vul, John T Wixted, and Doug Rohrer. Distributed practice in verbal recall tasks: A review and quantitative synthesis. Psychological bulletin, 132(3): 354, 2006.
|
| 143 |
+
|
| 144 |
+
Jeff Donahue, Philipp Krähenbühl, and Trevor Darrell. Adversarial feature learning. In International Conference on Learning Representations (ICLR), 2017.
|
| 145 |
+
|
| 146 |
+
Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Alex Lamb, Martin Arjovsky, Olivier Mastropietro, and Aaron Courville. Adversarially learned inference. In International Conference on Learning Representations (ICLR), 2017.
|
| 147 |
+
|
| 148 |
+
Chrisantha Fernando, Dylan Banarse, Charles Blundell, Yori Zwols, David Ha, Andrei A Rusu, Alexander Pritzel, and Daan Wierstra. Pathnet: Evolution channels gradient descent in super neural networks. arXiv preprint arXiv:1701.08734, 2017.
|
| 149 |
+
|
| 150 |
+
Robert M French. Dynamically constraining connectionist networks to produce distributed, orthogonal representations to reduce catastrophic interference. network, 1111:00001, 1994.
|
| 151 |
+
|
| 152 |
+
Robert M French. Pseudo-recurrent connectionist networks: An approach to the’sensitivitystability’dilemma. Connection Science, 9(4):353–380, 1997.
|
| 153 |
+
|
| 154 |
+
Robert M French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3 (4):128–135, 1999.
|
| 155 |
+
|
| 156 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Neural Information Processing Systems (NIPS), pp. 2672–2680, 2014.
|
| 157 |
+
|
| 158 |
+
Ian J Goodfellow, Mehdi Mirza, Da Xiao, Aaron Courville, and Yoshua Bengio. An empirical investigation of catastrophic forgetting in gradient-based neural networks. arXiv preprint arXiv:1312.6211, 2015.
|
| 159 |
+
|
| 160 |
+
Google. The quick, draw! dataset. URL: https://github.com/googlecreativelab/quickdraw-dataset, 2017.
|
| 161 |
+
|
| 162 |
+
Geoffrey Hinton. Neural networks for machine learning - lecture 6a - overview of mini-batch gradient descent, 2012.
|
| 163 |
+
|
| 164 |
+
William J Joiner. Unraveling the evolutionary determinants of sleep. Current Biology, 26(20): R1073–R1087, 2016.
|
| 165 |
+
|
| 166 |
+
Kaggle. Devanagari character set. URL: https://www.kaggle.com/rishianand/devanagari-character-set, 2017.
|
| 167 |
+
|
| 168 |
+
Michael J Kahana and Marc W Howard. Spacing and lag effects in free recall of pure lists. Psychonomic Bulletin & Review, 12(1):159–164, 2005.
|
| 169 |
+
|
| 170 |
+
D. P. Kingma and M. Welling. Auto-encoding variational bayes. In International Conference on Learning Representations (ICLR), 2014.
|
| 171 |
+
|
| 172 |
+
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences, pp. 201611835, 2017.
|
| 173 |
+
|
| 174 |
+
Chris A Kortge. Episodic memory in connectionist networks. In Proceedings of the 12th Annual Conference of the Cognitive Science Society, volume 764, pp. 771. Erlbaum, 1990.
|
| 175 |
+
|
| 176 |
+
Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 177 |
+
|
| 178 |
+
Stephan Lewandowsky. Gradual unlearning and catastrophic interference: A comparison of distributed architectures. Relating theory and data: Essays on human memory in honor of Bennet B. Murdock, pp. 445–476, 1991.
|
| 179 |
+
|
| 180 |
+
Long-Ji Lin. Reinforcement learning for robots using neural networks. PhD thesis, Fujitsu Laboratories Ltd, 1993.
|
| 181 |
+
|
| 182 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of Machine Learning Research, 9(Nov):2579–2605, 2008.
|
| 183 |
+
|
| 184 |
+
James L McClelland, Bruce L McNaughton, and Randall C O’reilly. Why there are complementary learning systems in the hippocampus and neocortex: insights from the successes and failures of connectionist models of learning and memory. Psychological review, 102(3):419, 1995.
|
| 185 |
+
|
| 186 |
+
Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. Psychology of learning and motivation, 24:109–165, 1989.
|
| 187 |
+
|
| 188 |
+
Ken McRae and Phil A Hetherington. Catastrophic interference is eliminated in pretrained networks. In Proceedings of the 15h Annual Conference of the Cognitive Science Society, pp. 723–728, 1993.
|
| 189 |
+
|
| 190 |
+
Lars Mescheder, Sebastian Nowozin, and Andreas Geiger. Adversarial variational bayes: Unifying variational autoencoders and generative adversarial networks. arXiv preprint arXiv:1701.04722, 2017.
|
| 191 |
+
|
| 192 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015.
|
| 193 |
+
|
| 194 |
+
Decebal Constantin Mocanu, Maria Torres Vega, Eric Eaton, Peter Stone, and Antonio Liotta. Online contrastive divergence with generative replay: Experience replay without storing data. CoRR, abs/1610.05555, 2016.
|
| 195 |
+
|
| 196 |
+
Ravi D Nath, Claire N Bedbrook, Michael J Abrams, Ty Basinger, Justin S Bois, David A Prober, Paul W Sternberg, Viviana Gradinaru, and Lea Goentoro. The jellyfish cassiopea exhibits a sleep-like state. Current Biology, 27(19):2984–2990, 2017.
|
| 197 |
+
|
| 198 |
+
Joseph O’Neill, Barty Pleydell-Bouverie, David Dupret, and Jozsef Csicsvari. Play it again: reactivation of waking experience and memory. Trends in neurosciences, 33(5):220–229, 2010.
|
| 199 |
+
|
| 200 |
+
Emilio Parisotto, Jimmy Lei Ba, and Ruslan Salakhutdinov. Actor-mimic: Deep multitask and transfer reinforcement learning. In International Conference on Learning Representations (ICLR), 2016.
|
| 201 |
+
|
| 202 |
+
Anthony Robins. Catastrophic forgetting, rehearsal and pseudorehearsal. Connection Science, 7(2): 123–146, 1995.
|
| 203 |
+
|
| 204 |
+
Anthony Robins. Sequential learning in neural networks: A review and a discussion of pseudorehearsal based methods. Intelligent Data Analysis, 8(3):301–322, 2004.
|
| 205 |
+
|
| 206 |
+
Andrei A Rusu, Sergio Gomez Colmenarejo, Caglar Gulcehre, Guillaume Desjardins, James Kirkpatrick, Razvan Pascanu, Volodymyr Mnih, Koray Kavukcuoglu, and Raia Hadsell. Policy distillation. arXiv preprint arXiv:1511.06295, 2015.
|
| 207 |
+
|
| 208 |
+
Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016.
|
| 209 |
+
|
| 210 |
+
Hanul Shin, Jung Kwon Lee, Jaehong Kim, and Jiwon Kim. Continual learning with deep generative replay. In Neural Information Processing Systems (NIPS), 2017.
|
| 211 |
+
|
| 212 |
+
Rupesh K Srivastava, Jonathan Masci, Sohrob Kazerounian, Faustino Gomez, and Jürgen Schmidhuber. Compete to compute. In Neural Information Processing Systems (NIPS), pp. 2310–2318, 2013.
|
| 213 |
+
|
| 214 |
+
Guang Yang, Cora Sau Wan Lai, Joseph Cichon, Lei Ma, Wei Li, and Wen-Biao Gan. Sleep promotes branch-specific formation of dendritic spines after learning. Science, 344(6188):1173–1178, 2014.
|
| 215 |
+
|
| 216 |
+
# 7 APPENDIX A
|
| 217 |
+
|
| 218 |
+
7.1 DEEP GENERATIVE REPLAY
|
| 219 |
+
|
| 220 |
+
# Algorithm 1: Deep Generative Replay
|
| 221 |
+
|
| 222 |
+
1: Input: Current parameters of DGM, new samples: $( X , Y )$ , dictionary for new samples: $D _ { t a s k s }$ (there can be multiple tasks), minimum fraction: $\kappa$ , memory capacity: $N _ { m a x }$
|
| 223 |
+
2: Output: New parameters of DGM // Compute sampling fractions
|
| 224 |
+
3: ηtasks := P tasksDdgm+P Dtasks and $\eta _ { g e n } : = 1 - \eta _ { t a s k s }$
|
| 225 |
+
4: if $\eta _ { t a s k s } < \kappa | D _ { t a s k s } |$ then
|
| 226 |
+
5: $\eta _ { t a s k s } : = \kappa | D _ { t a s k s } |$ and $\eta _ { g e n } : = 1 - \eta _ { t a s k s }$
|
| 227 |
+
6: end if // Compute number of samples
|
| 228 |
+
7: if $| X | > \eta _ { t a s k s } \times N _ { m a x }$ then
|
| 229 |
+
8: $n _ { t a s k s } : = \eta _ { t a s k s } \times N _ { m a x }$ and $n _ { g e n } : = N _ { m a x } - n _ { t a s k s }$
|
| 230 |
+
9: Subsample $( X , Y )$ to meet size $n _ { t a s k s }$
|
| 231 |
+
10: else
|
| 232 |
+
11: $n _ { t a s k s } : = | X |$ and $\begin{array} { r } { n _ { g e n } : = \frac { \eta _ { g e n } } { \eta _ { t a s k s } } \times | \boldsymbol { X } | } \end{array}$
|
| 233 |
+
12 : end if // Generate and reconstruct samples
|
| 234 |
+
13: Generate $n _ { g e n }$ samples: $X _ { g e n }$ from generator $G$ and labels from learner $L$ : $Y _ { g e n } = L ( X _ { g e n } )$
|
| 235 |
+
14: $X _ { r e c o n } = \mathrm { R }$ econstruct $\{ X , \bar { X } _ { g e n } \}$ using the generator $G$ // Train the DGM
|
| 236 |
+
15: Train the generator $G$ on $X _ { r e c o n }$
|
| 237 |
+
16: Train the learner $L$ on $( X _ { r e c o n } , \{ Y , Y _ { g e n } \} )$
|
| 238 |
+
|
| 239 |
+
Deep Generative Replay (algorithm 1), as described in section 3.1, consolidates new tasks for a DGM with previously learnt tasks. It first computes sampling fractions for new tasks $( \eta _ { t a s k s } )$ and previously learnt tasks $( \eta _ { g e n } )$ and ensures a minimum fraction $\left( \kappa \right)$ per new task (lines 3–6). Then it computes the number of samples to generate from previous tasks and whether to subsample the incoming task samples to satisfy the memory capacity $N _ { m a x }$ (lines 7–12). Finally, it generates the required number of samples from previous tasks, reconstructs all data and trains the DGM on resulting data (lines 13–16). For a dictionary $D , \sum D$ is the total number of tasks in $D$ counting repetitions, while $| D |$ is the total number of tasks without repetitions. $| X |$ is the number of samples in set $X$ .
|
| 240 |
+
|
| 241 |
+
Shin et al. (2017) have recently proposed a similar idea independently and Mocanu et al. (2016) have also employed a generative replay in two-layer restricted boltzmann machines, but they do not describe balancing new and generated samples and cannot recognize repeated tasks (section 4.2). Their generative replay without a dual memory architecture is costly to train (section 4.3) and a lack of reconstruction for new samples makes their representations less robust to noise and occlusions (section 5).
|
| 242 |
+
|
| 243 |
+
# .2 MORE EXPERIMENTS WITH ACCURACY AND FORGETTING CURVES
|
| 244 |
+
|
| 245 |
+
In this section, we present more experiments on the Shapes and the Hindi dataset, which contain sequences of tasks with geometric shapes and hindi consonants recognition respectively. We observed similar forgetting patterns as on the Digits dataset in section 4. All baselines exhibited catastrophic forgetting on these sequences of tasks, but DGR and DGDMN were able to learn the task structure sequentially (figures 10, 11). The same is reflected in the average forgetting curves in figure 12.
|
| 246 |
+
|
| 247 |
+
# 7.3 JOINTLY VS. SEQUENTIALLY LEARNT STRUCTURE
|
| 248 |
+
|
| 249 |
+
To explore whether learning tasks sequentially results in a similar structure as learning them jointly, we visualized t-SNE (Maaten & Hinton, 2008) embeddings of the latent vectors of the LTM generator (VAE) in DGDMN after training it: (a) jointly over all tasks (Figure 13a), and (b) sequentially over tasks seen one at a time (Figure 13b) on the Digits dataset. To maintain consistency, we used the same random seed in t-SNE for both joint and sequential embeddings.
|
| 250 |
+
|
| 251 |
+

|
| 252 |
+
Figure 10: Accuracy curves for Shapes (x: tasks seen, y: classification accuracy on task).
|
| 253 |
+
|
| 254 |
+

|
| 255 |
+
Figure 11: Accuracy curves for Hindi (x: tasks seen, y: classification accuracy on task).
|
| 256 |
+
|
| 257 |
+
We observe that the LTM’s latent space effectively segregates the 10 digits in both cases (joint and sequential). Though the absolute locations of the digit clusters differ in the two plots, the relative locations of digits share some similarity between both plots i.e. the neighboring digit clusters for each cluster are roughly similar. This may not be sufficient to conclude that the LTM discovers the same latent representation for the underlying shared structure of tasks in these cases and we leave a more thorough investigation to future work.
|
| 258 |
+
|
| 259 |
+
# 7.4 VISUALIZATIONS FOR THE JOINTLY AND SEQUENTIALLY LEARNT LTM
|
| 260 |
+
|
| 261 |
+
We also show visualizations of digits from the LTM when trained jointly on Digits tasks (Figure 14a) and when trained sequentially (Figure 14b). Though the digits generated from the jointly trained LTM are quite sharp, the same is not true for the sequentially trained LTM. We observe that the
|
| 262 |
+
|
| 263 |
+

|
| 264 |
+
Figure 12: Forgetting curves on Shapes and Hindi dataset (x: tasks seen, y: avg classification accuracy on tasks seen).
|
| 265 |
+
|
| 266 |
+

|
| 267 |
+
Figure 13: t-SNE embedding for latent vectors of the VAE generator on Digits dataset when: (a) tasks are learnt jointly, and (b) tasks are learnt sequentially.
|
| 268 |
+
|
| 269 |
+
sequentially trained LTM produces sharp samples of the recently learnt tasks (digits 6, 7, 8 and 9), but blurred samples of previously learnt tasks, which is due to partial forgetting on these previous tasks.
|
| 270 |
+
|
| 271 |
+

|
| 272 |
+
Figure 14: Visualization of digits from LTM when trained: (a) jointly, (b) sequentially
|
| 273 |
+
|
| 274 |
+
# 8 APPENDIX B
|
| 275 |
+
|
| 276 |
+
# 8.1 DATASET PREPROCESSING
|
| 277 |
+
|
| 278 |
+
All our datasets have images with intensities normalized in the range [0.0, 1.0] and size $( 2 8 \times 2 8 )$ , except Hindi which has $( 3 2 \times 3 2 )$ size images.
|
| 279 |
+
|
| 280 |
+
Permnist: Our version involved six tasks, each containing a fixed permutation on images sampled from the original MNIST dataset. We sampled 30, 000 images from the training set and all the 10, 000 test set images for each task. The tasks were as follows: (i) Original MNIST, (ii) 8x8 central patch of each image blackened, (iii) 8x8 central patch of each image whitened, (iv) 8x8 central patch of each image permuted with a fixed random permutation, (v) 12x12 central patch of each image permuted with a fixed random permutation, and (vi) mirror images of MNIST. This way each task is as hard as MNIST and the tasks share some common underlying structure.
|
| 281 |
+
|
| 282 |
+
Digits: We introduce this smaller dataset which contains 10 tasks with the $t ^ { t h }$ task being classification of digit $t$ from the MNIST dataset.
|
| 283 |
+
|
| 284 |
+
TDigits: We introduced a transformed variant of MNIST containing all ten digits, their mirror images, their upside down images, and their images when reflected about the main diagonal making a total of 40 tasks. This dataset poses similar difficulty as the Digits dataset and we use it for experiments involving longer sequence of tasks.
|
| 285 |
+
|
| 286 |
+
Shapes: This dataset was extracted from the Quick, Draw! dataset recently released by Google (2017), which contains 50 million drawings across 345 categories of hand-drawn images. We subsampled 4, 500 training images and 500 test images from all geometric shapes in Quick, Draw! (namely circle, hexagon, octagon, square, triangle and zigzag).
|
| 287 |
+
|
| 288 |
+
Hindi: Extracted from the Devanagri dataset (Kaggle, 2017) and contains a sequence of 8 tasks, each involving image classification of a hindi language consonant.
|
| 289 |
+
|
| 290 |
+
# 8.2 TRAINING ALGORITHM AND ITS PARAMETERS
|
| 291 |
+
|
| 292 |
+
All models were trained with RMSProp (Hinton, 2012) using learning rate $= \ 0 . 0 0 1$ , $\rho = 0 . 9$ , $\epsilon = 1 0 ^ { - 8 }$ and no decay. We used a batch size of 128 and all classifiers were provided 20 epochs of training when trained jointly, and 6 epochs when trained sequentially over tasks. For generative models (VAEs), we used gradient clipping in RMSProp with $\mathtt { c l i p n o r m = 1 . 0 }$ and clipvalue $=$ 0.5, and they were always trained for 25 epochs regardless of the task or dataset involved.
|
| 293 |
+
|
| 294 |
+
# 8.3 NEURAL NETWORK ARCHITECTURES
|
| 295 |
+
|
| 296 |
+
We chose all our models by first training them jointly on all tasks in a dataset to ensure that our models had enough capacity to perform reasonably well on all tasks. But we gave preference to simpler models over very high capacity models.
|
| 297 |
+
|
| 298 |
+
Classifier Models: Our implementation of NN, DropNN, PPR, EWC, learner for DGR and the learner for LTM in DGDMN used a neural network with three fully-connected layers with the number of units tuned differently according to the dataset (24, 24 units for Digits, 48, 48 for Permnist and 36, 36 for TDigits). DropNN also added two dropout layers, one after each hidden layer with droput rate $= 0 . 2$ each. The classifiers (learners) for Shapes and Hindi datasets had two convolutional layers (1 $2 , 2 0 : 3 \times 3$ kernels for Shapes and 2 $4 , 3 2 : 3 \times 3$ kernels for Hindi) each followed by a $2 \times 2$ max-pooling layer. The last two layers were fully-connected (16, 6 for Shapes and 144, 36 for Hindi). The hidden layers used ReLU activations, the last layer had a softmax activation, and the model was trained to minimize the cross-entropy objective function. The learners for STTMs in DGDMN were kept smaller for speed and efficiency concerns.
|
| 299 |
+
|
| 300 |
+
Generative models: The generators (VAE) for DGR and LTM of DGDMN employed encoders and decoders with two fully connected hidden layers each with ReLU activation for Permnist, Digits and TDigits, and convolutional variants for Shapes and Hindi. The sizes and number of units/kernels in the layers were tuned independently for each dataset with an approximate coarse grid-search. The size of the latent variable $z$ was set to 32 for Digits, 64 for Permnist, 96 for TDigits, 32 for Shapes and 48 for Hindi. The STTM generators for DGDMN were kept smaller for speed and efficiency.
|
| 301 |
+
|
| 302 |
+
# 8.4 HYPERPARAMETERS OF DGDMN
|
| 303 |
+
|
| 304 |
+
DGDMN has two new hyperparameters: (i) $\kappa$ : minimum fraction of $N _ { m a x }$ reserved for incoming tasks, and (ii) $n _ { S T M }$ : number of STTMs (also sleep/consolidation frequency). Both these have straightforward interpretations and can be set directly without complex hyperparameter searches.
|
| 305 |
+
|
| 306 |
+
$\kappa$ ensures continual incorporation of new tasks by guaranteeing them a minimum fraction of LTM samples during consolidation. Given that LTM should perform well on last $K$ tasks seen in long
|
| 307 |
+
|
| 308 |
+
task sequence of $T$ tasks, we observed that it is safe to assume that about $5 0 \%$ of the LTM would be
|
| 309 |
+
crowded by the earlier $T - K$ tasks. The remaining 0.5 fraction should be distributed to the last $K$
|
| 310 |
+
tasks. So choosing this choice in secti $\textstyle \kappa = { \frac { 0 . 5 } { K } }$ woith in pand as a good starting point for tuning). We made, and hence plotted the average accuracy over $K = 1 0$ $\kappa = 0 . 0 5$
|
| 311 |
+
the last 10 tasks as a metric.
|
| 312 |
+
|
| 313 |
+
$n _ { S T M }$ controls the consolidation cycle frequency. Increasing $n _ { S T M }$ gives more STTMs, less frequent consolidations and hence a learning speed advantage. But this also means that fewer samples of previous tasks would participate in consolidation (due to maximum capacity $N _ { m a x }$ of LTM), and hence more forgetting might occur. This parameter does not affect learning much till the LTM remains unsaturated (i.e. $N _ { m a x }$ capacity is unfilled by generated $^ +$ new samples) and becomes active after that. For long sequences of tasks, we found it best to keep at least $7 5 \%$ of the total samples from previously learnt tasks to have appropriate retention. Hence, $n _ { S T M }$ can be set as approximately $\frac { 0 . 2 5 } { \kappa }$ in practice (as we did in section 4.3), or as a starting point for tuning.
|
| 314 |
+
|
| 315 |
+
# 8.5 ALGORITHM SPECIFIC HYPERPARAMETERS
|
| 316 |
+
|
| 317 |
+
PPR: We used a maximum memory capacity of about $3 - 6$ times the number of samples in a task for the dataset being learnt on (i.e. 18, 000 for Digits, 60, 000 for Permnist, 15, 000 for Shapes and 5, 400 for Hindi). While replaying, apart from the task samples, the remaining memory was filled with random samples and corresponding labels.
|
| 318 |
+
|
| 319 |
+
EWC: Most values of the coefficient of the Fisher Information Matrix based regularizer between 1 to 500 worked reasonably well for our datasets. We chose 100 for our experiments.
|
| 320 |
+
|
| 321 |
+
DGR and DGDMN: $N _ { m a x }$ for the DGM in DGR and for the LTM in DGDMN for Digits, Permnist, Shapes and Hindi was set as the total number of samples in the datasets (summed over all tasks) to ensure that there was enough capacity to regenerate the datasets well. For TDigits, we deliberately restricted memory capacity to see the effects of learning tasks over a long time and we kept $N _ { m a x }$ as half the total number of samples. $n _ { S T M }$ was kept at 2 for Digits, Permnist and Shapes, 5 for TDigits and 2 for Hindi. $\kappa$ was set to be small, so that it does not come into play for Digits, Permnist, Shapes and Hindi since we already provided memories with full capacity for all samples. For TDigits, we used $\kappa = 0 . 0 5$ which would let us incorporate roughly 10 out of the 40 tasks well.
|
md/train/ByOvsIqeg/ByOvsIqeg.md
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REGULARIZING CNNS WITH LOCALLY CONSTRAINED DECORRELATIONS
|
| 2 |
+
|
| 3 |
+
Pau Rodr´ıguez†, Jordi Gonzalez \` †,‡, Guillem Cucurull†, Josep M. Gonfaus‡, Xavier Roca†,‡ †Computer Vision Center - Univ. Autonoma de Barcelona (UAB), 08193 Bellaterra, Catalonia Spain \` ‡Visual Tagging Services, Campus UAB, 08193 Bellaterra, Catalonia Spain
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Regularization is key for deep learning since it allows training more complex models while keeping lower levels of overfitting. However, the most prevalent regularizations do not leverage all the capacity of the models since they rely on reducing the effective number of parameters. Feature decorrelation is an alternative for using the full capacity of the models but the overfitting reduction margins are too narrow given the overhead it introduces. In this paper, we show that regularizing negatively correlated features is an obstacle for effective decorrelation and present OrthoReg, a novel regularization technique that locally enforces feature orthogonality. As a result, imposing locality constraints in feature decorrelation removes interferences between negatively correlated feature weights, allowing the regularizer to reach higher decorrelation bounds, and reducing the overfitting more effectively. In particular, we show that the models regularized with OrthoReg have higher accuracy bounds even when batch normalization and dropout are present. Moreover, since our regularization is directly performed on the weights, it is especially suitable for fully convolutional neural networks, where the weight space is constant compared to the feature map space. As a result, we are able to reduce the overfitting of state-of-the-art CNNs on CIFAR-10, CIFAR-100, and SVHN.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Neural networks perform really well in numerous tasks even when initialized randomly and trained with Stochastic Gradient Descent (SGD) (see Krizhevsky et al. (2012)). Deeper models, like Googlenet (Szegedy et al. (2015)) and Deep Residual Networks (Szegedy et al. (2015); He et al. (2015a)) are released each year, providing impressive results and even surpassing human performances in well-known datasets such as the Imagenet (Russakovsky et al. (2015)). This would not have been possible without the help of regularization and initialization techniques which solve the overfitting and convergence problems that are usually caused by data scarcity and the growth of the architectures.
|
| 12 |
+
|
| 13 |
+
From the literature, two different regularization strategies can be defined. The first ones consist in reducing the complexity of the model by (i) reducing the effective number of parameters with weight decay (Nowlan & Hinton (1992)), and (ii) randomly dropping activations with Dropout (Srivastava et al. (2014)) or dropping weights with DropConnect (Wan et al. (2013)) so as to prevent feature co-adaptation. Due to their nature, although this set of strategies have proved to be very effective, they do not leverage all the capacity of the models they regularize.
|
| 14 |
+
|
| 15 |
+
The second group of regularizations is those which improve the effectiveness and generality of the trained model without reducing its capacity. In this second group, the most relevant approaches decorrelate the weights or feature maps, e.g. Bengio & Bergstra (2009) introduced a new criterion so as to learn slow decorrelated features while pre-training models. In the same line Bao et al. (2013) presented ”incoherent training”, a regularizer for reducing the decorrelation of the network activations or feature maps in the context of speech recognition. Although regularizations in the second group are promising and have already been used to reduce the overfitting in different tasks, even with the presence of Dropout (as shown by Cogswell et al. (2016)), they are seldom used in the large scale image recognition domain because of the small improvement margins they provide together with the computational overhead they introduce.
|
| 16 |
+
|
| 17 |
+
<table><tr><td></td><td>Base</td><td>DeCov</td><td>OrthoReg</td></tr><tr><td>MLP</td><td>8.1108</td><td>5.21010</td><td>9.7109</td></tr><tr><td>ResNet-110</td><td>6.51010</td><td>3.4 1014</td><td>3.4 108</td></tr></table>
|
| 18 |
+
|
| 19 |
+
Table 1: Count of the Flops for the models used in this paper: the 3-hidden-layer MLP and the 110- layer ResNet we use later in the experiments section when not regularized, using DeCov (Cogswell et al. (2016)) and using OrthoReg. Batch size is set to 128, the same we use to train the ResNet. Regularizing weights is orders of magnitude faster than regularizing activations.
|
| 20 |
+
|
| 21 |
+
Although they are not directly presented as regularizers, there are other strategies to reduce the overfitting such as Batch Normalization (Ioffe & Szegedy (2015)), which decreases the overfitting by reducing the internal covariance shift. In the same line, initialization strategies such as ”Xavier” (Glorot & Bengio (2010)) or ”He” (He et al. (2015b)), also keep the same variance at both input and output of the layers in order to preserve propagated signals in deep neural networks. Orthogonal initialization techniques are another family which set the weights in a decorrelated initial state so as to condition the network training to converge into better representations. For instance, Mishkin & Matas (2016) propose to initialize the network with decorrelated features using orthonormal initialization (Saxe et al. (2013)) while normalizing the variance of the outputs as well.
|
| 22 |
+
|
| 23 |
+
In this work we hypothesize that regularizing negatively correlated features is an obstacle for achieving better results and we introduce OrhoReg, a novel regularization technique that addresses the performance margin issue by only regularizing positively correlated feature weights. Moreover, OrthoReg is computationally efficient since it only regularizes the feature weights, which makes it very suitable for the latest CNN models. We verify our hypothesis through a series of experiments: first using MNIST as a proof of concept, secondly we regularize wide residual networks on CIFAR-10, CIFAR-100, and SVHN (Netzer et al. (2011)) achieving the lowest error rates in the dataset to the best of our knowledge.
|
| 24 |
+
|
| 25 |
+
# 2 DEALING WITH WEIGHT REDUNDANCIES
|
| 26 |
+
|
| 27 |
+
Deep Neural Networks (DNN) are very expressive models which can usually have millions of parameters. However, with limited data, they tend to overfit. There is an abundant number of techniques in order to deal with this problem, from L1 and L2 regularizations (Nowlan & Hinton (1992)), early-stopping, Dropout or DropConnect. Models presenting high levels of overfitting usually have a lot of redundancy in their feature weights, capturing similar patterns with slight differences which usually correspond to noise in the training data. A particular case where this is evident is in AlexNet (Krizhevsky et al. (2012)), which presents very similar convolution filters and even ”dead” ones, as it was remarked by Zeiler & Fergus (2014).
|
| 28 |
+
|
| 29 |
+
In fact, given a set of parameters $\theta _ { I , j }$ connecting a set of inputs $I = \{ i _ { 1 } , i _ { 2 } , . . . , i _ { n } \}$ to a neuron $h _ { j }$ , two neurons $\{ h _ { j } , \bar { h } _ { k } \}$ , $j \neq k$ will be positively correlated, and thus fire always together if $\bar { \theta _ { I , j } } = \theta _ { I , k }$ and negatively correlated if $\theta _ { I , j } = - \theta _ { I , k }$ . In other words, two neurons with the same or slightly different weights will produce very similar outputs. In order to reduce the redundancy present in the network parameters, one should maximize the amount of information encoded by each neuron. From an information theory point of view, this means one should not be able to predict the output of a neuron given the output of the rest of the neurons of the layer. However, this measure requires batch statistics, huge joint probability tables, and it would have a high computational cost.
|
| 30 |
+
|
| 31 |
+
In this paper, we will focus on the weights correlation rather than activation independence since it still is an open problem in many neural network models and it can be addressed without introducing too much overhead, see Table 1. Then, we show that models generalize better when different feature detectors are enforced to be dissimilar. Although it might seem contradictory, CNNs can benefit from having repeated filter weights with different biases, as shown by Li et al. (2016). However, those repeated filters must be shared copies and adding too many unshared filter weights to CNNs increases overfitting and the need for stronger regularization (Zagoruyko & Komodakis (May 2016)). Thus, our proposed method and multi-bias neural networks are complementary since they jointly increase the representation power of the network with fewer parameters.
|
| 32 |
+
|
| 33 |
+
In order to find a good target to optimize so as to reduce the correlation between weights, it is first required to find a metric to measure it. In this paper, we propose to use the cosine similarity between feature detectors to express how strong is their relationship. Note that the cosine similarity is equivalent to the Pearson correlation for mean-centered normalized vectors, but we will use the term correlation for the sake of clarity.
|
| 34 |
+
|
| 35 |
+
# 2.1 ORTHOGONAL WEIGHT REGULARIZATION
|
| 36 |
+
|
| 37 |
+
This section introduces the orthogonal weight regularization, a regularization technique that aims to reduce feature detector correlation enforcing local orthogonality between all pairs of weight vectors. In order to keep the magnitudes of the detectors unaffected, we have chosen the cosine similarity between the vector pairs in order to solely focus on the vectors angle $\beta \in [ - \pi , \pi ]$ . Then, given any pair of feature vectors of the same size $\theta _ { 1 } , \theta _ { 2 }$ the cosine of their relative angle is:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\cos ( \theta _ { 1 } , \theta _ { 2 } ) = \frac { \langle \theta _ { 1 } , \theta _ { 2 } \rangle } { | | \theta _ { 1 } | | | | \theta _ { 2 } | | }
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
Where $\left. \theta _ { 1 } , \theta _ { 2 } \right.$ denotes the inner product between $\theta _ { 1 }$ and $\theta _ { 2 }$ . We then square the cosine similarity in order to define a regularization cost function for steepest descent that has its local minima when vectors are orthogonal:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
C ( \theta ) = \frac { 1 } { 2 } \sum _ { i = 1 } ^ { n } \sum _ { \substack { j = 1 , j \neq i } } ^ { n } \cos ^ { 2 } ( \theta _ { i } , \theta _ { j } ) = \frac { 1 } { 2 } \sum _ { \substack { i = 1 } } ^ { n } \sum _ { \substack { j = 1 , j \neq i } } ^ { n } \left( \frac { \langle \theta _ { i } , \theta _ { j } \rangle } { | | \theta _ { i } | | | | \theta _ { j } | | } \right) ^ { 2 }
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
Where $\theta _ { i }$ are the weights connecting the output of the layer $l - 1$ to the neuron $i$ of the layer $l$ , which has $n$ hidden units. Interestingly, minimizing this cost function relates to the minimization of the Frobenius norm of the cross-covariance matrix without the diagonal. This cost will be added to the global cost of the model $J ( \theta ; X , y )$ , where $X$ are the inputs and $y$ are the labels or targets, obtaining $\tilde { J } ( \theta ; X , y ) = J ( \theta ; X , y ) + \gamma C ( \theta )$ . Note that $\gamma$ is an hyperparameter that weights the relative contribution of the regularization term. We can now define the gradient with respect to the parameters:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\frac { \delta } { \delta \theta _ { ( i , j ) } } C ( \theta ) = \sum _ { k = 1 , k \neq i } ^ { n } \frac { \theta _ { ( k , j ) } \langle \theta _ { i } , \theta _ { k } \rangle } { \langle \theta _ { i } , \theta _ { i } \rangle \langle \theta _ { k } , \theta _ { k } \rangle } - \frac { \theta _ { ( i , j ) } \langle \theta _ { i } , \theta _ { k } \rangle ^ { 2 } } { \langle \theta _ { i } , \theta _ { i } \rangle ^ { 2 } \langle \theta _ { k } , \theta _ { k } \rangle }
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
The second term is introduced by the magnitude normalization. As magnitudes are not relevant for the vector angle problem, this equation can be simplified just by assuming normalized feature detectors:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
{ \frac { \delta } { \delta \theta _ { ( i , j ) } } } C ( \theta ) = \sum _ { k = 1 , k \neq i } ^ { n } \theta _ { ( k , j ) } \langle \theta _ { i } , \theta _ { k } \rangle
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
We then add eq. 4 to the backpropagation gradient:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\Delta \theta _ { ( i , j ) } = - \alpha \Big ( \nabla J _ { \theta _ { ( i , j ) } } + \gamma \sum _ { k = 1 , k \neq i } ^ { n } \theta _ { ( k , j ) } \langle \theta _ { i } , \theta _ { k } \rangle \Big )
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
Where $\alpha$ is the global learning rate coefficient, $J$ any target loss function for the backpropagation algorithm.
|
| 68 |
+
|
| 69 |
+
Although this update can be done sequentially for each feature-detector pair, it can be vectorized to speedup computations. Let $\Theta$ be a matrix where each row is a feature detector $\theta _ { ( I , j ) }$ corresponding to the normalized weights connecting the whole input $I$ of the layer to the neuron $j$ . Then, $\Theta \Theta ^ { t }$ contains the inner product of each pair of vectors $i$ and $j$ in each position $i , j$ . Subsequently, we
|
| 70 |
+
|
| 71 |
+
# Algorithm 1 Orthogonal Regularization Step.
|
| 72 |
+
|
| 73 |
+
Require: Layer parameter matrices $\Theta ^ { l }$ , regularization coefficient $\gamma$ , global learning rate $\alpha$
|
| 74 |
+
|
| 75 |
+
1: for each layer $l$ to regularize do
|
| 76 |
+
2: $\eta _ { 1 } = n o r m \_ r o w s ( \Theta ^ { l } )$
|
| 77 |
+
3: $\Theta _ { 1 } ^ { l } = d i v \_ r o w s ( \Theta ^ { l } , \eta _ { 1 } )$ .
|
| 78 |
+
4: in $\AA \ i e r P r o d M a t = \Theta _ { 1 } ^ { l } t r a n s p o s e ( \Theta _ { 1 } ^ { l } )$
|
| 79 |
+
5: ∇Θl1 = $\models \gamma ( i n n e r P r o d M a t - d i a g ( i n n e r P r o d M a t ) ) \Theta _ { 1 } ^ { l }$
|
| 80 |
+
6: $\Delta \Theta ^ { l } = - \alpha ( \nabla J _ { \Theta ^ { l } } + \gamma \nabla \Theta _ { 1 } ^ { l } )$
|
| 81 |
+
7: end for
|
| 82 |
+
|
| 83 |
+
. Second term in eq. 6 . Complete eq. 6.
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
Figure 1: Comparison between the two loss functions represented by eq.2 and 7. (a) is the original loss, (b) is the new loss that discards negative correlations given for different $\lambda$ values. It can be seen $\lambda = 1 0$ reaches a plateau when approximating to $\frac { \pi } { 2 }$ . (c) and (d) shows the directions of the gradients for the two loss functions above. For instance, a red arrow coming from a green ball represents the gradient of the loss between the red and green balls with respect to the green one. In (d) most of the arrows disappear since the loss in (b) only applies to angles smaller than $\frac { \pi } { 2 }$ .
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
(d) Direction of gradients for loss in (b).
|
| 90 |
+
|
| 91 |
+
(c) Direction of gradients for the loss in (a).
|
| 92 |
+
|
| 93 |
+
subtract the diagonal so as to ignore the angle from each feature with respect to itself and multiply by $\Theta$ to compute the final value corresponding to the sum in eq. 5:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\Delta \Theta = - \alpha \Big ( \nabla J _ { \Theta } + \gamma \big ( \Theta \Theta ^ { t } - d i a g ( \Theta \Theta ^ { t } ) \big ) \Theta \Big )
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
Where the second term is $\nabla C _ { \Theta }$ . Algorithm 1 summarizes the steps in order to apply OrthoReg.
|
| 100 |
+
|
| 101 |
+
# 2.2 NEGATIVE CORRELATIONS
|
| 102 |
+
|
| 103 |
+
Note that the presented algorithm, based on the cosine similarity, penalizes any kind of correlation between all pairs of feature detectors, i.e. the positive and the negative correlations, see Figure 1a. However, negative correlations are related to inhibitory connections, competitive learning, and self-organization. In fact, there is evidence that negative correlations can help a neural population to increase the signal-to-noise ratio (Chelaru & Dragoi (2016)) in the V1. In order to find out the advantages of keeping negative correlations, we propose to use an exponential to squash the gradients for angles greater than $\frac { \pi } { 2 }$ (orthogonal):
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
C ( \theta ) = \sum _ { i = 1 } ^ { n } \sum _ { j = 1 , j \neq i } ^ { n } \log ( 1 + e ^ { \lambda ( c o s ( \theta _ { i } , \theta _ { j } ) - 1 ) } ) = \log ( 1 + e ^ { \lambda ( \langle \theta _ { i } , \theta _ { j } \rangle - 1 ) } ) , \ | | \theta _ { i } | | = | | \theta _ { j } | | = 1
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
Where $\lambda$ is a coefficient that controls the minimum angle-of-influence of the regularizer, i.e. the minimum angle between two feature weights so that there exists a gradient pushing them apart, see Figure 1b. We empirically found that the regularizer worked well for $\lambda = 1 0$ , see Figure 2b. Note that when $\lambda \simeq 1 0$ the loss and the gradients approximate to zero when vectors are at more than $\textstyle { \frac { \pi } { 2 } }$ (orthogonal). As a result of incorporating the squashing function on the cosine similarity, negatively correlated feature weights will not be regularized. This is different from all previous approaches and the loss presented in eq. 2, where all pairs of weight vectors influence each other. Thus, from now on, the loss in eq. 2 is named as global loss and the loss in eq. 7 is named as local loss.
|
| 110 |
+
|
| 111 |
+
The derivative of eq. 7 is:
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
{ \frac { \delta } { \delta \theta _ { ( i , j ) } } } C ( \theta ) = \sum _ { k = 1 , k \neq i } ^ { n } \lambda { \frac { e ^ { \lambda \langle \theta _ { i } , \theta _ { k } \rangle } \theta _ { ( k , j ) } } { e ^ { \lambda \langle \theta _ { i } , \theta _ { k } \rangle } + e ^ { \lambda } } }
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
Then, given the element-wise exponential operator exp, we define the following expression in order to simplify the formulas:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\hat { \Theta } = \exp ( \lambda ( \Theta \Theta ^ { t } ) )
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
and thus, the $\Delta$ in vectorial form can be formulated as:
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\nabla C _ { \Theta } = \lambda \frac { ( \hat { \Theta } - d i a g ( \hat { \Theta } ) ) \Theta } { \hat { \Theta } - d i a g ( \hat { \Theta } ) + e ^ { \lambda } }
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
In order to provide a visual example, we have created a $2 D$ toy dataset and used the previous equations for positive and negative $\gamma$ values, see Figure 2. As expected, it can be seen that the angle between all pairs of adjacent feature weights becomes more uniform after regularization. Note that Figure 2b shows that regularization with the global loss (eq. 2) results in less uniform angles than using the local loss as shown in 2c (which corresponds to the local loss presented in eq. 7) because vectors in opposite quadrants still influence each other. This is why in Figure 2d, it can be seen that the mean nearest neighbor angle using the global loss (b) is more unstable than the local loss (c). As a proof of concept, we also performed gradient ascent, which minimizes the angle between the vectors. Thus, in Figures 2e and 2f, it can be seen that the locality introduced by the local loss reaches a stable configuration where feature weights with angle $\frac { \pi } { 2 }$ are too far to attract each other.
|
| 130 |
+
|
| 131 |
+
The effects of global and local regularizations on Alexnet, VGG-16 and a 50-layer ResNet are shown on Figure 3. As it can be seen, OrthoReg reaches higher decorrelation bounds. Lower decorrelation peaks are still observed when the input dimensionality of the layers is smaller than the output since all vectors cannot be orthogonal at the same time. In this case, local regularization largely outperforms global regularization since it removes interferences caused by negatively correlated feature weights. This suggests why increasing fully connected layers’ size has not improved networks performance.
|
| 132 |
+
|
| 133 |
+
# 3 EXPERIMENTS
|
| 134 |
+
|
| 135 |
+
In this section we provide a set of experiments that verify that (i) training with the proposed regularization increases the performance of naive unregularized models, (ii) negatively correlated feature weights are useful, and (iii) the proposed regularization improves the performance of state-of-the-art models.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 2: 2D toy dataset regularized with global loss (eq. 2) and local loss (eq. 7). (a) shows the initial 2D randomly generated dataset. (b) the dataset after 300 regularization steps using the global loss and (c) using the local loss. (d) the evolution of the mean nearest neighbor angle for the global loss (b) and the local loss (c). (e) and (f) correspond to (b) and (c) but using gradient ascent instead of gradient descent as a sanity-check.
|
| 141 |
+
Figure 3: Effects of local and global regularization on the Alexnet, VGG-16 and 50-layer-ResNet weights. The regularized versions reach higher decorrelation bounds (in terms of minimum angle) than the unregularized counterparts.
|
| 142 |
+
|
| 143 |
+
# 3.1 VERIFICATION EXPERIMENTS
|
| 144 |
+
|
| 145 |
+
As a sanity check, we first train a three-hidden-layer Multi-Layer Perceptron (MLP) with ReLU non-liniarities on the MNIST dataset (LeCun et al. (1998)). Our code is based in the train-a-digit-classifier example included in torch/demos1, which uses an upsampled version of the dataset $( 3 2 \times 3 2 )$ ). The only pre-processing applied to the data is a global standardization. The model is trained with SGD and a batch size of 200 during 200 epochs. No momentum neither weight decay was applied. By default, the magnitude of the weights of this experiments is recovered after each regularization step in order to prove the regularization only affects their angle.
|
| 146 |
+
|
| 147 |
+
Sensitivity to hyperparameters. We train a three-hidden-layer MLP with 1024 hidden units, and different $\gamma$ and $\lambda$ values so as to verify how they affect the performance of the model. Figure 4a shows that the model effectively achieves the best error rate for the highest gamma value $( \gamma = 1 )$ ), thus proving the advantages of the regularization. On Figure 4b, we verify that higher regularization rates produce more general models. Figure 5a depicts the sensitivity of the model to $\lambda$ . As expected, the best value is found when lambda corresponds to Orthogonality $\lambda \simeq 1 0$ ).
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 4: (a) The evolution of the error rate on the MNIST validation set for different regularization magnitudes. It can be seen that for $\gamma = 1$ it reaches the best error rate $( 1 . 4 5 \% )$ while the unregularized counterpart $( \gamma = 0 )$ is $1 . 7 4 \%$ . (b) Measures the overfitting of the model for different $\gamma$ , confirming that higher regularization rates decrease overfitting.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 5: (a) Shows the minimum error rate for different $\lambda$ values. (b) Classification error on MNIST for different loss functions. Not regularizing negative correlated feature weights (eq. 7) results in better test error than regularizing them (eq.2).
|
| 154 |
+
|
| 155 |
+
Negative Correlations. Figure 5b highlights the difference between regularizing with the global or the local regularizer. Although both regularizations reach better error rates than the unregularized counterpart, the local regularization is better than the global. This confirms the hypothesis that negative correlations are useful and thus, performance decreases when we reduce them.
|
| 156 |
+
|
| 157 |
+
Compatibility with initialization and dropout. To demonstrate the proposed regularization can help even when other regularizations are present, we trained a CNN with (i) dropout $( \mathtt { c 3 2 - c \bar { 6 } 4 - 1 5 1 2 - d 0 . 5 - 1 1 0 } ) ^ { 2 }$ or (ii) LSUV initialization (Mishkin & Matas (2016)). In Table 2, we show that best results are obtained when orthogonal regularization is present. The results are consistent with the hypothesis that OrthoReg, as well as Dropout and LSUV, focuses on reducing the model redundancy. Thus, when one of them is present, the margin of improvement for the others is reduced.
|
| 158 |
+
|
| 159 |
+
<table><tr><td>OrthoReg</td><td>Base</td><td>Base+Dropout</td><td>Base+LSUV</td></tr><tr><td>None</td><td>0.92</td><td>0.70 ± 0.01</td><td>0.86</td></tr><tr><td>Conv Layers</td><td>0.75</td><td>0.69 ± 0.03</td><td>0.83</td></tr><tr><td>All Layers</td><td>0.75</td><td>0.66 ± 0.03</td><td>0.79</td></tr></table>
|
| 160 |
+
|
| 161 |
+
Table 2: Error rates for a small CNN trained with the MNIST dataset. OrthoReg leads to much better results when no other improvements such as Dropout and LSUV are present but it can still make small accuracy increments when these two techniques are present.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 6: Wide ResNet error rate on Cifar10 and Cifar100. OrthoReg shows better performance than the base regularizer (all feature maps), and the unregularized counterparts.
|
| 165 |
+
|
| 166 |
+
# 3.2 REGULARIZATION ON CIFAR-10 AND CIFAR-100
|
| 167 |
+
|
| 168 |
+
We show that the proposed OrthoReg can help to improve the performance of state-of-the-art models such as deep residual networks (He et al. (2015a)). In order to show the regularization is suitable for deep CNNs, we successfuly regularize a 110-layer ResNet3 on CIFAR-10, decreasing its error from $6 . 5 5 \%$ to $6 . 2 9 \%$ without data augmentation.
|
| 169 |
+
|
| 170 |
+
In order to compare with the most recent state-of-the-art, we train a wide residual network (Zagoruyko & Komodakis (November 2016)) on CIFAR-10 and CIFAR-100. The experiment is based on a torch implementation of the 28-layer and 10th width factor wide deep residual model, for which the median error rate on CIFAR-10 is $3 . 8 9 \%$ and $1 8 . 8 5 \%$ on CIFAR- $1 0 0 ^ { 4 }$ . As it can be seen in Figure 6, regularizing with OrthoReg yields the best test error rates compared to the baselines.
|
| 171 |
+
|
| 172 |
+
The regularization coefficient $\gamma$ was chosen using grid search although similar values were found for all the experiments, specially if regularization gradients are normalized before adding them to the weights. The regularization was equally applied to all the convolution layers of the (wide) ResNet. We found that, although the regularized models were already using weight decay, dropout, and batch normalization, best error rates were always achieved with OrthoReg.
|
| 173 |
+
|
| 174 |
+
Table 3 compares the performance of the regularized models with other state-of-the-art results. As it can be seen the regularized model surpasses the state of the art, with a $5 . 1 \%$ relative error improvement on CIFAR-10, and a $1 . 5 \%$ relative error improvement on CIFAR-100.
|
| 175 |
+
|
| 176 |
+
# 3.3 REGULARIZATION ON SVHN
|
| 177 |
+
|
| 178 |
+
For SVHN we follow the procedure depicted in Zagoruyko & Komodakis (May 2016), training a wide residual network of depth $^ { \underline { { { \ O } } } } = 2 8$ , width $= 4$ , and dropout. Results are shown in Table 4. As it
|
| 179 |
+
|
| 180 |
+
Table 3: Comparison with other CNNs on CIFAR-10 and CIFAR-100 (Test error $\%$ ). Orthogonally regularized residual networks achieve the best results to the best of our knowldege. Only single-crop results are reported for fairness of comparison. \*Median over 5 runs as reported by Zagoruyko & Komodakis (November 2016).
|
| 181 |
+
|
| 182 |
+
<table><tr><td>Network</td><td>CIFAR-10</td><td>CIFAR-100</td><td>Augmented</td></tr><tr><td>Maxout (Goodfellow et al. (2013))</td><td>9.38</td><td>38.57</td><td>YES</td></tr><tr><td>NiN (Lin et al. (2014))</td><td>8.81</td><td>35.68</td><td>YES</td></tr><tr><td>DSN (Lee et al. (2015))</td><td>7.97</td><td>34.57</td><td>YES</td></tr><tr><td>Highway Network (Srivastava et al. (2015))</td><td>7.60</td><td>32.24</td><td>YES</td></tr><tr><td>All-CNN (Springenberg et al. (2015))</td><td>7.25</td><td>33.71</td><td>NO</td></tr><tr><td>110-Layer ResNet (He et al. (2015a))</td><td>6.61</td><td>28.4</td><td>NO</td></tr><tr><td>ELU-Network (Clevert et al. (2016))</td><td>6.55</td><td>24.28</td><td>NO</td></tr><tr><td>OrthoReg on 110-Layer ResNet*</td><td>6.29 ± 0.19</td><td>28.33 ± 0.5</td><td>NO</td></tr><tr><td>LSUV (Mishkin & Matas (2016))</td><td>5.84</td><td>1</td><td>YES</td></tr><tr><td>Fract.Max-Pooling (Graham (2014))</td><td>4.50</td><td>27.62</td><td>YES</td></tr><tr><td>Wide ResNet v1 (Zagoruyko & Komodakis (May 2016))*</td><td>4.37</td><td>20.40</td><td>YES</td></tr><tr><td>OrthoReg on Wide ResNet v1 (May 2016)*</td><td>4.32 ± 0.05</td><td>19.50 ± 0.03</td><td>YES</td></tr><tr><td>Wide ResNet v2 (Zagoruyko & Komodakis (November 2016))*</td><td>3.89</td><td>18.85</td><td>YES</td></tr><tr><td>OrthoReg on Wide ResNet v2 (November 2016)*</td><td>3.69 ± 0.01</td><td>18.56 ± 0.12</td><td>YES</td></tr></table>
|
| 183 |
+
|
| 184 |
+
Table 4: Comparison with other CNNs on SVHN. Wide Resnets regularized with OrthoReg show better performance.
|
| 185 |
+
|
| 186 |
+
<table><tr><td>Model</td><td>Error rate</td></tr><tr><td>NiN (Lin et al. (2014))</td><td>2.35</td></tr><tr><td>DSN (Lee et al. (2015))</td><td>1.92</td></tr><tr><td>Stochastic Depth ResNet (Huang et al. (2016))</td><td>1.75</td></tr><tr><td>Wide Resnet (Zagoruyko & Komodakis (May 2016))</td><td>1.64</td></tr><tr><td>OrthoReg on Wide Resnet</td><td>1.54</td></tr></table>
|
| 187 |
+
|
| 188 |
+
can be seen, we reduce the error rate from $1 . 6 4 \%$ to $1 . 5 4 \%$ , which is the lowest value reported on this dataset to the best of our knowledge.
|
| 189 |
+
|
| 190 |
+
# 4 DISCUSSION
|
| 191 |
+
|
| 192 |
+
Regularization by feature decorrelation can reduce Neural Networks overfitting even in the presence of other kinds of regularizations. However, especially when the number of feature detectors is higher than the input dimensionality, its decorrelation capacity is limited due to the effects of negatively correlated features. We showed that imposing locality constraints in feature decorrelation removes interferences between negatively correlated feature weights, allowing regularizers to reach higher decorrelation bounds, and reducing the overfitting more effectively.
|
| 193 |
+
|
| 194 |
+
In particular, we show that the models regularized with the constrained regularization present lower overfitting even when batch normalization and dropout are present. Moreover, since our regularization is directly performed on the weights, it is especially suitable for fully convolutional neural networks, where the weight space is constant compared to the feature map space. As a result, we are able to reduce the overfitting of 110-layer ResNets and wide ResNets on CIFAR-10, CIFAR-100, and SVHN improving their performance. Note that despite OrthoReg consistently improves state of the art ReLU networks, the choice of the activation function could affect regularizers like the one presented in this work. In this sense, the effect of asymmetrical activations on feature correlations and regularizers should be further investigated in the future.
|
| 195 |
+
|
| 196 |
+
# ACKNOWLEDGEMENTS
|
| 197 |
+
|
| 198 |
+
Authors acknowledge the support of the Spanish project TIN2015-65464-R (MINECO/FEDER), the 2016FI B 01163 grant of Generalitat de Catalunya, and the COST Action IC1307 iV&L Net (European Network on Integrating Vision and Language) supported by COST (European Cooperation in Science and Technology). We also gratefully acknowledge the support of NVIDIA Corporation with the donation of a Tesla K40 GPU and a GTX TITAN GPU, used for this research.
|
| 199 |
+
|
| 200 |
+
# REFERENCES
|
| 201 |
+
|
| 202 |
+
Yebo Bao, Hui Jiang, Lirong Dai, and Cong Liu. Incoherent training of deep neural networks to de-correlate bottleneck features for speech recognition. In 2013 IEEE ICASSP, pp. 6980–6984. IEEE, 2013.
|
| 203 |
+
Yoshua Bengio and James S Bergstra. Slow, decorrelated features for pretraining complex cell-like networks. In NIPS, pp. 99–107, 2009.
|
| 204 |
+
Mircea I Chelaru and Valentin Dragoi. Negative correlations in visual cortical networks. Cerebral Cortex, 26(1):246–256, 2016.
|
| 205 |
+
Djork-Arn Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network learning by exponential linear units (ELUs). ICLR, 2016.
|
| 206 |
+
Michael Cogswell, Faruk Ahmed, Ross Girshick, Larry Zitnick, and Dhruv Batra. Reducing overfitting in deep networks by decorrelating representations. ICLR, 2016.
|
| 207 |
+
Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In AISTATS, 2010.
|
| 208 |
+
Ian Goodfellow, David Warde-Farley, Mehdi Mirza, Aaron Courville, and Yoshua Bengio. Maxout networks. In ICML, pp. 1319–1327, 2013.
|
| 209 |
+
Benjamin Graham. Fractional max-pooling. arXiv preprint arXiv:1412.6071, 2014.
|
| 210 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015a.
|
| 211 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In ICCV, pp. 1026–1034, 2015b.
|
| 212 |
+
Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Weinberger. Deep networks with stochastic depth. arXiv preprint arXiv:1603.09382, 2016.
|
| 213 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, pp. 448–456, 2015.
|
| 214 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. ImageNet Classification with Deep Convolutional Neural Networks. In NIPS, pp. 1106–1114, 2012.
|
| 215 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 216 |
+
Chen-Yu Lee, Saining Xie, Patrick W. Gallagher, Zhengyou Zhang, and Zhuowen Tu. Deeplysupervised nets. In Guy Lebanon and S. V. N. Vishwanathan (eds.), AISTATS, volume 38 of JMLR Proceedings. JMLR.org, 2015.
|
| 217 |
+
Hongyang Li, Wanli Ouyang, and Xiaogang Wang. Multi-bias non-linear activation in deep neural networks. arXiv preprint arXiv:1604.00676, 2016.
|
| 218 |
+
Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. arXiv preprint arXiv:1312.4400, March 2014.
|
| 219 |
+
|
| 220 |
+
Dmytro Mishkin and Jiri Matas. All you need is a good init. ICLR, 2016.
|
| 221 |
+
|
| 222 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
|
| 223 |
+
Steven J. Nowlan and Geoffrey E. Hinton. Simplifying neural networks by soft weight-sharing. Neural computation, 4(4):473–493, 1992.
|
| 224 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. IJCV, 115(3):211–252, 2015.
|
| 225 |
+
Andrew M. Saxe, James L. McClelland, and Surya Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv:1312.6120, December 2013.
|
| 226 |
+
Jost T. Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. In ICLR (workshop track), 2015.
|
| 227 |
+
Nitish Srivastava, Geoffrey E. Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. JMLR, 15(1):1929–1958, 2014.
|
| 228 |
+
Rupesh K. Srivastava, Klaus Greff, and Jurgen Schmidhuber. Training very deep networks. In ¨ NIPS, pp. 2368–2376, 2015.
|
| 229 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In CVPR, pp. 1–9, 2015.
|
| 230 |
+
Li Wan, Matthew D Zeiler, Sixin Zhang, Yann L Cun, and Rob Fergus. Regularization of neural networks using dropconnect. In ICML, pp. 1058–1066, 2013.
|
| 231 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In BMVC, May 2016.
|
| 232 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, November 2016.
|
| 233 |
+
Matthew D. Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In ECCV, pp. 818–833. 2014.
|
md/train/CLCVcl1rSPP/CLCVcl1rSPP.md
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RL for Latent MDPs: Regret Guarantees and a Lower Bound
|
| 2 |
+
|
| 3 |
+
Jeongyeol Kwon The University of Texas at Austin kwonchungli@utexas.edu
|
| 4 |
+
|
| 5 |
+
Yonathan Efroni Microsoft Research, NYC jonathan.efroni@gmail.com
|
| 6 |
+
|
| 7 |
+
Constantine Caramanis The University of Texas at Austin constantine@utexas.edu
|
| 8 |
+
|
| 9 |
+
Shie Mannor Technion, NVIDIA shie@ee.technion.ac.il, smannor@nvidia.com
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
In this work, we consider the regret minimization problem for reinforcement learning in latent Markov Decision Processes (LMDP). In an LMDP, an MDP is randomly drawn from a set of $M$ possible MDPs at the beginning of the interaction, but the identity of the chosen MDP is not revealed to the agent. We first show that a general instance of LMDPs requires at least $\Omega ( ( S A ) ^ { M } )$ episodes to even approximate the optimal policy. Then, we consider sufficient assumptions under which learning good policies requires polynomial number of episodes. We show that the key link is a notion of separation between the MDP system dynamics. With sufficient separation, we provide an efficient algorithm with local guarantee, i.e., providing a sublinear regret guarantee when we are given a good initialization. Finally, if we are given standard statistical sufficiency assumptions common in the Predictive State Representation (PSR) literature (e.g., [6]) and a reachability assumption, we show that the need for initialization can be removed.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Partially observable Markov decision processes (POMDPs) [42] give a general framework to describe partially observable sequential decision problems. In POMDPs, the underlying dynamics satisfy the Markovian property, but the observations give only partial information on the identity of the underlying states. With the generality of this framework comes a high computational and statistical price to pay: POMDPs are hard, primarily because optimal policies depend on the entire history of the process. But for many important problems, this full generality can be overkill, and in particular, does not have a way to leverage special structure. We are interested in settings where the hidden or latent (unobserved) variables have slow dynamics or are even static in each episode. This model is important for diverse applications, from serving a user in a dynamic web application [18], to medical decision making [45], to transfer learning in different RL tasks [8]. Yet, as we explain below, even this area remains little understood, and challenges abound.
|
| 18 |
+
|
| 19 |
+
Thus, in this work, we consider reinforcement learning (RL) for a special type of POMDP which we call a latent Markov decision process (LMDP). LMDPs consist of some (perhaps large) number $M$ of MDPs with joint state space $s$ and actions $\mathcal { A }$ . In episodic LMDPs with finite time-horizon $H$ , the static latent (hidden) variable that selects one of $M$ MDPs is randomly chosen at the beginning of each episode, yet is not revealed to the agent. The agent then interacts with the chosen MDP throughout the episode (see Definition 1 for the formal description).
|
| 20 |
+
|
| 21 |
+
Related Work. The LMDP framework has previously been introduced under many different names, e.g., hidden-model MDP [11], Multitask RL [8], Contextual MDP [18], Multi-modal Markov decision process [45] and Concurrent MDP [9].
|
| 22 |
+
|
| 23 |
+
Learning in LMDPs is a challenging problem due to the unobservability of latent contexts. For instance, the exact planning problem is P-SPACE hard [45], inheriting the hardness of planning from the general POMDP framework. Nevertheless, the lack of dynamics of the latent variables, offers some hope. As an example, if the number of contexts $M$ is bounded, then the planning problem can be at least approximately solved (e.g., by point-based value iteration (PBVI) [39], or mixed integer programming (MIP) [45]).
|
| 24 |
+
|
| 25 |
+
The most closely related work studying LMDPs is in the context of multitask RL [47, 8, 34, 18]. In this line of work, a common approach is to cluster trajectories according to different contexts, an approach that guided us in designing the algorithms in Section 3.4. However, previous work requires very long time-horizon $H \gg S A$ in order to guarantee that every state-action pair can be visited multiple times in a single episode. In contrast, we consider a significantly shorter time-horizon that scales poly-logarithmic with the number of states, i.e., $H = p o l y \bar { \log ( M S \dot { A } ) }$ . This short time-horizon results in a significant difference in learning strategy even when we get a feedback on the true context at the end of episode. We refer the readers to Appendix A for additional discussion on related work.
|
| 26 |
+
|
| 27 |
+
Main Results. To the best of our knowledge, none of the previous literature has obtained sample complexity guarantees or studied regret bounds in the LMDP setting. This paper addresses precisely this problem. We ask the following:
|
| 28 |
+
|
| 29 |
+
Is there a sample efficient RL algorithm for LMDPs, with sublinear regret?
|
| 30 |
+
|
| 31 |
+
The answer turns out to be not so simple. Our results comprise a first impossibility result, followed by positive algorithmic results under additional assumptions. Specifically:
|
| 32 |
+
|
| 33 |
+
• First, we find that for a general LMDP, polynomial sample complexity cannot be attained without further assumptions. That is, to find an approximately optimal policy we need at least $\Omega \left( ( S A ) ^ { M } \right)$ samples, i.e., at least exponential in the number of contexts $M$ (Section 3.1). This lower bound even applies to instances with deterministic MDPs.
|
| 34 |
+
• We find that there are several natural assumptions under which optimal policies can be learned with polynomial sample complexity. Similarly to mixture problems without dynamics, the key link is a notion of separation between the MDPs. With sufficient separation, we show that there is a planning-oracle efficient RL algorithm with polynomial sample complexity. A critical development is adapting the principle of optimism as in UCB, but to the partially observed setting where value-iteration cannot be directly applied, and thus neither can the UCRL algorithm for MDPs.
|
| 35 |
+
• Finally, under additional statistical sufficiency assumptions that are common in the Predictive State Representation (PSR) literature (e.g., [6]) and a reachability assumption, we show that the need for initialization can be entirely removed.
|
| 36 |
+
• Finally, we perform an empirical evaluation of the suggested algorithms on toy problems (Section 4), while focusing on the importance of the made assumptions.
|
| 37 |
+
|
| 38 |
+
# 2 Preliminaries
|
| 39 |
+
|
| 40 |
+
# 2.1 Problem Setup: Latent MDPs
|
| 41 |
+
|
| 42 |
+
We start with the definition of episodic reinforcement learning in latent Markov decision process:
|
| 43 |
+
|
| 44 |
+
Definition 1 (Latent Markov Decision Process (LMDP)) Consider a set of MDPs $\mathcal { M }$ with joint state space $s$ and joint action space $\mathcal { A }$ in a finite time horizon $H$ . Let $M = | { \mathcal { M } } |$ , $S = | S |$ and $A = | { \mathcal { A } } |$ . Each MDP $\mathcal { M } _ { m } \in \mathcal { M }$ is a tuple $( \mathcal { S } , \mathcal { A } , T _ { m } , R _ { m } , \nu _ { m } )$ where $T _ { m } : S \times A \times S [ 0 , 1 ]$ a transition probability maps a state-action pair and a next state to a probability, ${ R _ { m } } : S \times A \times \{ 0 , 1 \} \to [ 0 , 1 ]$ a probability measure for rewards that maps a state-action pair and a binary reward to a probability, and $\nu _ { m }$ is an initial state distribution. Let $w _ { 1 } , . . . , w _ { M }$ be the mixing weights of LMDPs such that at the start of every episode, one MDP $\mathcal { M } _ { m } \in \mathcal { M }$ is randomly chosen with probability $w _ { m }$ .
|
| 45 |
+
|
| 46 |
+
We assume the mixing weights are uniform and known a priori, i.e., $w _ { 1 } = . . . = w _ { M } = 1 / M$ . This is only for the ease of presentation, and does not affect any algorithmic idea or main results in this paper. The goal of the problem is to Π that maximizes the expected return: $\pi$ n a pol ,where ssis $\begin{array} { r } { V _ { { \mathcal { M } } } ^ { * } : = \operatorname* { m a x } _ { \pi \in \Pi } \sum _ { m = 1 } ^ { M } w _ { m } \mathbb { E } _ { m } ^ { \pi } \left[ \sum _ { t = 1 } ^ { H } r _ { t } \right] } \end{array}$ $\mathbb { E } _ { m } ^ { \pi } [ \cdot ]$ expectation taken over the $m ^ { t h }$ MDP with a policy $\pi$ . If not specified otherwise, we find the best policy in a set of history-dependent policies $\bar { \pi } : ( \bar { S } , \mathcal { A } , \{ 0 , 1 \} ) ^ { * } \times \mathcal { S } \Delta ( A )$ that map an entire history to a probability distribution over actions.
|
| 47 |
+
|
| 48 |
+
We define the notion of regret relative to a (possibly approximate) planning oracle. Thus, suppose we have a planning-oracle with the following approximation guarantee: $V _ { \mathcal { M } } ^ { \pi } \geq \rho _ { 1 } V _ { \mathcal { M } } ^ { * } - \rho _ { 2 }$ , where $\pi$ is a returned policy when $\mathcal { M }$ is given to the planning-oracle, and $\rho _ { 1 } , \rho _ { 2 }$ are multiplicative and additive approximation constants respectively. We then define the regret as the comparison to the best approximation guarantee that the planning-oracle can achieve:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
R e g r e t ( K ) = \sum _ { k = 1 } ^ { K } ( \rho _ { 1 } V _ { \mathcal { M } } ^ { * } - \rho _ { 2 } ) - V _ { \mathcal { M } } ^ { \pi _ { k } } ,
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $\pi _ { k }$ is a policy executed in the $k ^ { t h }$ episode. For example, we can use point-based value-iteration (PBVI) [39] as a planning-oracle:
|
| 55 |
+
|
| 56 |
+
Example 1 PBVI [39] with discretization level $\epsilon _ { d } > 0$ in the belief space (over $\mathbb { R } ^ { M }$ ) returns an $\epsilon _ { d } H ^ { 2 }$ additive approximate policy. That is, equation (1) holds with $\rho _ { 1 } = 1$ and $\rho _ { 2 } = \epsilon _ { d } H ^ { 2 }$ .
|
| 57 |
+
|
| 58 |
+
# 2.2 Predictive State Representation (PSR)
|
| 59 |
+
|
| 60 |
+
A partially observable dynamical system can be viewed as a model that generates a sequence of observations from observation space $\mathcal { O }$ with (controlled) actions from action space $\mathcal { A }$ . A predictive state representation (PSR) is a compact description of a dynamical system with a set of observable experiments, or tests [41]. Specifically, a test of length $t$ is a sequence of action-observation pairs given as $\tau = { a _ { 1 } ^ { \tau } o _ { 1 } ^ { \tau } o _ { 2 } ^ { \tau } . . . a _ { t } ^ { \tau } o _ { t } ^ { \tau } }$ . A history $h = a _ { 1 } ^ { h } o _ { 1 } ^ { h } a _ { 2 } ^ { \tilde { h _ { } } } o _ { 2 } ^ { h } . . . a _ { t } ^ { h } o _ { t } ^ { h }$ is a sequence of action-observation pairs that has been generated prior to a given time. A prediction $\mathbb { P } ( \tau | h ) { \overset { - } { = } } \mathbb { P } ( o _ { 1 : t } ^ { \tau } | h | | d o a _ { 1 : t } ^ { \tau } )$ denotes the probability of seeing the test sequence from a given history, given that we intervene to take actions $a _ { 1 } ^ { \tau } a _ { 2 } ^ { \tau } . . . a _ { t } ^ { \tau }$ . In latent MDPs, the observation space can be considered as a pair of next-states and rewards, i.e., ${ \mathcal { O } } = { \mathcal { S } } \times \{ 0 , 1 \}$ and $o _ { t } = \left( s _ { t + 1 } , r _ { t } \right)$ .
|
| 61 |
+
|
| 62 |
+
As we work with a special class of POMDPs, we customize the formulation for LMDPs. The set of histories consists of a subset of histories that end with different states, i.e., $\textstyle { \mathcal { H } } = \bigcup _ { s } { \mathcal { H } } _ { s }$ , where each element $h \in \mathcal { H } _ { s }$ is a short sequence of state-action-rewards of length $l$ ending with state $s$ :
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
h = s _ { 1 } ^ { h } a _ { 1 } ^ { h } r _ { 1 } ^ { h } s _ { 2 } ^ { h } . . . s _ { l - 1 } ^ { h } a _ { l - 1 } ^ { h } r _ { l - 1 } ^ { h } s = ( s , a , r ) _ { 1 : l - 1 } ^ { h } s .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
We define $\mathbb { P } _ { m } ^ { \pi } ( \mathcal { H } _ { s } )$ a vector of probabilities where each coordinate is a probability of sampling each history in $\mathcal { H } _ { s }$ in the $m ^ { t h }$ MDP with a policy $\pi$ . Likewise, each element in tests $\tau \in \mathcal { T }$ is a short sequence of action-reward-next states of length at most $l$ :
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\tau = a _ { 1 } ^ { \tau } r _ { 1 } ^ { \tau } s _ { 2 } ^ { \tau } . . . a _ { l } ^ { \tau } r _ { l } ^ { \tau } s _ { l + 1 } ^ { \tau } = ( a , r , s ^ { \prime } ) _ { 1 : l } ^ { \tau } .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
We denote $\mathbb { P } _ { m } ( \mathcal { T } | s )$ as a vector of probability where each coordinate is a success probability of each test in the $m ^ { t h }$ MDP starting from a state $s$ . That is,
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\mathbb { P } _ { m } ( \mathcal { T } | s ) _ { i } = \mathbb { P } _ { m } \big ( r _ { 1 } ^ { \tau _ { i } } s _ { 2 } ^ { \tau _ { i } } . . . r _ { l } ^ { \tau _ { i } } s _ { l + 1 } ^ { \tau _ { i } } | s | \big | d o a _ { 1 } ^ { \tau _ { i } } . . . a _ { l } ^ { \tau _ { i } } \big ) .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
# 2.2.1 Spectral Learning of PSRs in LMDPs
|
| 81 |
+
|
| 82 |
+
In spectral learning, we build a set of observable matrices that contains the (joint) probabilities of histories and tests, and then we can extract parameters from these matrices by performing singular value decomposition (SVD) and regressions [7]. In order to apply spectral learning techniques, we require the following technical conditions on statistical sufficiency of tests:
|
| 83 |
+
|
| 84 |
+
Condition 1 (Sufficient Tests) For all $ { \mathcal { S } } _ { s } \in { \mathcal { S } } _ { }$ , for the test set $\tau$ , let $\begin{array} { r l } { L _ { s } } & { { } = } \end{array}$ $[ \mathbb { P } _ { 1 } ( \pmb { \mathscr { T } } | s ) | \mathbb { P } _ { 2 } ( \pmb { \mathscr { T } } | s ) | . . . | \mathbb { P } _ { M } ( \pmb { \mathscr { T } } | s ) ]$ . Then $\sigma _ { M } ( L _ { s } ) \geq \sigma _ { \tau }$ for all $s \in S$ with some $\sigma _ { \tau } > 0$ .
|
| 85 |
+
|
| 86 |
+
Here, $\sigma _ { M } ( \cdot )$ is the minimum $( M ^ { t h } )$ singular value of a matrix. Another technical condition for spectral learning method is a rank non-degeneracy condition for sufficient histories:
|
| 87 |
+
|
| 88 |
+
Condition 2 (Sufficient Histories) For all $s \in \mathcal { S }$ , for the history set $\mathcal { H } _ { s }$ ending with a state $s$ , let $H _ { s } \ = \ [ \mathbb { P } _ { 1 } ^ { \pi } ( \mathcal { H } _ { s } ) | \mathbb { P } _ { 2 } ^ { \pi } ( \mathcal { H } _ { s } ) | . . . | \mathbb { P } _ { M } ^ { \pi } ( \mathcal { H } _ { s } ) ] ^ { \intercal }$ with a sampling policy $\pi$ . Then $\sigma _ { M } ( L _ { s } H _ { s } ) \geq $ $\mathbb { P } ^ { \pi } ( e n d s t a t e = s ) \cdot \sigma _ { h }$ with some $\sigma _ { h } > 0$ .
|
| 89 |
+
|
| 90 |
+
Here $\mathbb { P } ^ { \pi }$ (end state $= s$ ) is a probability of sampling a history ending with $s$ . Along with the rank condition for tests, pairs of histories and tests can be thought as many short snap-shots of long trajectories obtained by external experts or some exploration policy (e.g., random policy in uniformly ergodic MDPs). Following the notations in [7], let $P _ { \tau , \mathcal { H } _ { s } } = L _ { s } H _ { s }$ . Conditions 1 and 2 ensure $\bar { \sigma _ { M } } ( P _ { T , \mathcal { H } _ { s } } ) > 0$ . Under these conditions, the goal of spectral learning algorithm is to output PSR parameters which are used to compute ${ \hat { \mathbb { P } } } ( \tau | h )$ , the estimated probability of any future observations (or tests $\tau$ ) given any sampled histories $h$ . We refer to Appendix E.1 for a detailed procedure.
|
| 91 |
+
|
| 92 |
+
# 2.3 Notations
|
| 93 |
+
|
| 94 |
+
We denote the underlying LMDP with true parameters as $\mathcal { M } ^ { * }$ . With slight abuse of notation, we denote the $l _ { 1 }$ distance between two probability distributions $\mathcal { D } _ { 1 }$ and $\mathcal { D } _ { 2 }$ on a random variable $X$ conditioned on event $E$ as $\begin{array} { r } { \| ( \mathbb { P } _ { X \sim \mathcal { D } _ { 1 } } - \mathbb { P } _ { X \sim \mathcal { D } _ { 2 } } ) ( X | E ) \| _ { 1 } = \sum _ { X \in \mathcal { X } } | \mathbb { P } _ { X \sim \mathcal { D } _ { 1 } } ( X | E ) - \mathbb { P } _ { X \sim \mathcal { D } _ { 2 } } ( X | E ) | } \end{array}$ , where $\mathcal { X }$ is a support of $X$ . When we do not condition on any event, we omit the conditioning on $E$ . When we measure a transition or reward probability at a state-action pair $( s , a )$ , we use $T$ or $R$ instead of $\mathbb { P }$ . We use $\mathbb { P } _ { m }$ to refer to the probability of any event measured in the $m ^ { t h }$ context (or in $m ^ { t h }$ MDP). In particular, $\mathbb { P } _ { m } ( s ^ { \prime } , r | s , \bar { a } ) = T _ { m } \bar { ( } s ^ { \prime } | s , a ) R _ { m } ( r | s , a )$ . If we use $\mathbb { P }$ without any subscript, it is a probability of an event measured outsidethe probability of an event depends on a policy f the context, i.e., , we add superscri $\begin{array} { r } { \mathbb { P } ( \cdot ) = \sum _ { m = 1 } ^ { M } w _ { m } \mathbb { P } _ { m } ( \cdot ) } \end{array}$ Ifis $\pi$ $\pi$ $\mathbb { P }$ $\mathbb { E } _ { m } [ \cdot ]$ expectation taken over the $m ^ { t h }$ context and $\pi$ is added as superscript if the expectation depends on $\pi$ . We use ˆ· to denote any estimated quantities. $a \lesssim b$ implies $a$ is less than $b$ up to some constant and logarithmic factors. $p o l y ( \cdot )$ means the order of polynomial complexity (up to logarithmic factors) in referenced parameters. We interchangeably use $o$ , an observation, to replace a pair of next-state and immediate reward $( s ^ { \prime } , r )$ to simplify the notation. We occasionally express a length $t > 0$ history $( s _ { 1 } , a _ { 1 } , r _ { 1 } , . . . , s _ { t } , a _ { t } , r _ { t } )$ compactly as $( s , a , r ) _ { 1 : t }$ .
|
| 95 |
+
|
| 96 |
+
# 3 Main Results
|
| 97 |
+
|
| 98 |
+
In this section, we first obtain a hardness result for the general case. We then consider sample- and computationally efficient algorithms under additional assumptions.
|
| 99 |
+
|
| 100 |
+
# 3.1 Fundamental Limits of Learning General LMDPs
|
| 101 |
+
|
| 102 |
+
We first study the fundamental limits of the problem. In particular, we are interested in whether we can learn the optimal policy after interacting with the LMDP for a number of episodes polynomial in the problem parameters. We prove a worst-case lower bound, exhibiting an instance of LMDP that requires at least $\Omega \left( ( S A ) ^ { M } \right)$ episodes:
|
| 103 |
+
|
| 104 |
+
Theorem 3.1 (Lower Bound) There exists an LMDP such that for finding an -optimal policy $\pi _ { \epsilon }$ for which $V _ { \mathcal { M } } ^ { \pi _ { \epsilon } } \geq V _ { \mathcal { M } } ^ { * } - \epsilon$ , we need at least $\Omega \left( ( S A / M ) ^ { M } / \epsilon ^ { 2 } \right)$ episodes.
|
| 105 |
+
|
| 106 |
+
The hard instance consists of fully deterministic MDPs with possibly stochastic rewards, indicating an exponential lower bound in the number of contexts even for the easiest types of LMDPs. The example is constructed such that, in the absence of knowing true contexts, all wrong action sequences of length $M$ cannot provide any information with zero reward, whereas the only correct action sequence gets a total reward of 1 under one specific context. The construction is given in Appendix B.
|
| 107 |
+
|
| 108 |
+
Theorem 3.1 prevents a design of efficient algorithms with growing number of contexts. We note here that Theorem 3.1 holds even for restricted classes of policies, e.g., memoryless policies. Furthermore, our construction of hard instances does not allow to find any approximate policy with $\rho _ { 1 } = \omega ( ( S A ) ^ { - M } )$ within a polynomial number of episodes either. To the best of our knowledge, this
|
| 109 |
+
|
| 110 |
+
Initialize visit counts $N _ { m } ( s , a ) , N ( m )$ and parameters $( \hat { T } _ { m } , \hat { R } _ { m } , \hat { \nu } _ { m } )$ properly
|
| 111 |
+
|
| 112 |
+
1: for each $k ^ { t h }$ episode do
|
| 113 |
+
2: Get a policy $\pi _ { k }$ for $\widetilde { \mathcal { M } } _ { k }$ in Lemma 3.2
|
| 114 |
+
3: Play policy $\pi _ { k }$ and get the trajectory $\tau = ( s , a , r ) _ { 1 : H }$
|
| 115 |
+
4: Get an estimated belief over contexts $\hat { b }$ with either Algorithm 2 (when contexts are given), or
|
| 116 |
+
Algorithm 3 (when we infer contexts)
|
| 117 |
+
5: for $m = 1 , . . . , M$ and $t = 1 , . . . , H$ do
|
| 118 |
+
6: $N _ { m } ( s _ { t + 1 } | a _ { t } , s _ { t } ) \gets N _ { m } ( s _ { t + 1 } | a _ { t } , s _ { t } ) + \hat { b } ( m )$
|
| 119 |
+
7: $N _ { m } ( r _ { t } | s _ { t } , a _ { t } ) \gets N _ { m } ( r _ { t } | s _ { t } , a _ { t } ) + \hat { b } ( m )$
|
| 120 |
+
8: $N _ { m } ( s _ { 1 } ) \gets N _ { m } ( s _ { 1 } ) + \hat { b } ( m )$
|
| 121 |
+
9: Update empirical parameters $\hat { T } _ { m } , \hat { R } _ { m } , \hat { \nu } _ { m }$
|
| 122 |
+
10: end for
|
| 123 |
+
11: end for
|
| 124 |
+
|
| 125 |
+
is the first lower bound of its kind for LMDPs. Next, we investigate natural assumptions which help us to develop an efficient algorithm when only polynomial number of episodes are available.
|
| 126 |
+
|
| 127 |
+
# 3.2 The Critical First Step: Contexts in Hindsight
|
| 128 |
+
|
| 129 |
+
Suppose the true context of the underlying MDP is revealed to the agent at the end of each episode. We do not require any assumptions on the environments in this scenario. Note that this scenario is different from fully observable settings (i.e., knowing the true context at the beginning of an episode). In the latter scenario, we would simply have $M$ -decoupled RL problems in standard MDPs. While this can be considered as a “warm-up” for the sequel, it is motivated by real-world examples. Moreover, the key technical insight here will prove important for the sequel as well.
|
| 130 |
+
|
| 131 |
+
Knowing contexts in hindsight allows us to construct a confidence set for parameters:
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\begin{array} { r } { \mathcal { C } = \{ \mathcal { M } \ | \| ( \nu _ { m } - \hat { \nu } _ { m } ) ( s ) \| _ { 1 } \leq \sqrt { c _ { \nu } / N ( m ) } , \ \| ( T _ { m } - \hat { T } _ { m } ) ( s ^ { \prime } | s , a ) \| _ { 1 } \leq \sqrt { c _ { T } / N _ { m } ( s , a ) } , } \\ { \| ( R _ { m } - \hat { R } _ { m } ) ( r | s , a ) \| _ { 1 } \leq \sqrt { c _ { R } / N _ { m } ( s , a ) } , \quad \forall m , s , a \} , } \end{array}
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
where $N _ { m } ( s , a )$ is the number of times each state-action pair $( s , a )$ in $m ^ { t h } ~ \mathrm { { M D P } }$ is visited, and $N ( m )$ is the number of episodes we interact with the $m ^ { t h }$ MDP. With properly set parameters $\dot { c _ { T } } = { \cal O } ( S \log ( K / \eta ) ) , c _ { R } \dot { = } { \cal O } ( \log ( K / \eta ) )$ and $c _ { \nu } = O ( S \log ( K / \eta ) )$ for the confidence intervals, $\mathcal { M } ^ { \ast } \in \mathcal { C }$ with high probability for all $K$ episodes.
|
| 138 |
+
|
| 139 |
+
With the construction of confidence sets, it is then natural to try to design an optimistic RL algorithm, as in UCRL [22]. An obvious optimistic value in light of (2) is $\operatorname* { m a x } _ { \pi } { } , \mathcal { M } \in \mathcal { C } \ : V _ { \mathcal { M } } ^ { \pi }$ . However, solving this optimization problem is more general than solving an LMDP. In fully observable settings, we could replace the complex optimization problem by adding a proper exploration bonus to obtain an optimistic value function [4].
|
| 140 |
+
|
| 141 |
+
In partially observable environments, value iteration is only defined in terms of belief-states and not the observed states. For this reason, existing techniques solely based on the value-iteration cannot be directly applied for LMDPs. Yet, we find that proper analysis of the Bellman update rule over the belief state reveals that an empirical LMDP with properly adjusted hidden rewards is optimistic:
|
| 142 |
+
|
| 143 |
+
Proposition 3.2 We construct an optimistic LMDP $\widetilde { \mathcal { M } }$ whose parameters are given such that:
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\begin{array} { r l } & { \widetilde { T } _ { m } ( s ^ { \prime } | s , a ) = \hat { T } _ { m } ( s ^ { \prime } | s , a ) , \ \widetilde { R } _ { m } ^ { o b s } ( r | s , a ) = \hat { R } _ { m } ( r | s , a ) , \ \widetilde { \nu } _ { m } ( s ) = \hat { \nu } _ { m } ( s ) , } \\ & { \widetilde { R } _ { i n i t } ^ { h i d } ( m ) = \operatorname* { m i n } \left( 1 , \sqrt { c _ { \nu } / N ( m ) } \right) \ \widetilde { R } _ { m } ^ { h i d } ( s , a ) = H \operatorname* { m i n } \left( 1 , \sqrt { 5 \left( c _ { R } + c _ { T } \right) / N _ { m } ( s , a ) } \right) , } \end{array}
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
where $\widetilde { R } _ { i n i t } ^ { h i d } ( m )$ is an initial hidden reward given when starting an episode with a context $m$ , and $\widetilde { R } _ { m } ^ { o b s } ( \cdot | s , a )$ is a probability measure of an observable immediate reward $r$ whereas $\widetilde { R } _ { m } ^ { h i d } ( s , a )$ is $a$ hidden immediate reward (that is not visible to the agent) for a state-action pair $( s , a )$ in a context $m$ . Then for any policy $\pi$ , the expected long-term reward is optimistic, i.e., $V _ { \widehat { \mathcal { M } } } ^ { \pi } \geq V _ { \mathcal { M } ^ { \ast } } ^ { \pi }$ .
|
| 150 |
+
|
| 151 |
+
Algorithm 2 Access to True Contexts
|
| 152 |
+
|
| 153 |
+
Input: Receive true context $m ^ { * }$ in hindsight
|
| 154 |
+
|
| 155 |
+
Output : Belief over hidden contexts:
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
\hat { b } ( m ) = \left\{ \begin{array} { l l } { { 1 , } } & { { \mathrm { f o r } m = m ^ { * } } } \\ { { 0 , } } & { { \mathrm { f o r } m \ne m ^ { * } } } \end{array} \right.
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
# Algorithm 3 Inference of Contexts
|
| 162 |
+
|
| 163 |
+
Input: Trajectory $\tau = ( s _ { 1 } , a _ { 1 } , r _ { 1 } , . . . , s _ { H } , a _ { H } , r _ { H } )$ Output: Return an estimate of belief over contexts $\hat { b }$ :
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\begin{array} { l } { \hat { p } _ { m } ( \tau ) = \Pi _ { t = 1 } ^ { H } ( \alpha + ( 1 - 2 \alpha S ) \hat { \mathbb { P } } _ { m } ( s _ { t + 1 } , r _ { t } | s _ { t } , a _ { t } ) ) , } \\ { \hat { b } ( m ) = \frac { \hat { p } _ { m } ( \tau ) } { \sum _ { m = 1 } ^ { M } \hat { p } _ { m } ( \tau ) } . } \end{array}
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
Here, hidden reward is a deterministic reward that happens for every state-action pair, but does not appear in any observation history during the episode. We note that most existing planning algorithms can incorporate the hidden-reward structure without changes to maximize the long-term observed $^ +$ hidden rewards. For instance, the PBVI algorithm [39] can be executed as it is in the planning step. Hence in each episode, we can build one optimistic model from Proposition 3.2, and call the planning-oracle to get a policy to execute for the episode. Then we simply run the policy and update model parameters in a straight-forward manner. The algorithm can be efficiently implemented as long as some efficient (approximate) planning algorithms are available.
|
| 170 |
+
|
| 171 |
+
To establish Proposition 3.2, we make use of the ‘alpha vector’ representation [42] of the value function of general POMDPs. Detailed analysis is deferred to Appendix C.1. With the optimistic model constructed in Proposition 3.2, planning-oracle efficient implementation is straightforward. The resulting latent upper confidence reinforcement learning (L-UCRL) algorithm is summarized in Algorithm 1. Based on the established optimism in Proposition 3.2 and by carefully bounding the on-policy errors we arrive to the following regret guarantee of L-UCRL.
|
| 172 |
+
|
| 173 |
+
Theorem 3.3 Let $N = H K$ . The regret of the Algorithm 1 is bounded by:
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
R e g r e t ( K ) \leq \sum _ { k = 1 } ^ { K } ( V _ { \widehat { \mathcal { M } } _ { k } } ^ { \pi _ { k } } - V _ { \mathcal { M } ^ { * } } ^ { \pi _ { k } } ) \lesssim H S \sqrt { M A N } .
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
Proof of Theorem 3.3 is given in Appendix C.4. The central result of this section, Theorem 3.3 leads to the following observation: a polynomial sample complexity is possible for the LMDP model assuming the context of the underlying MDP is supplied at the end of each episode. Next, we explore ways to relax this assumption, while keep supplying with a polynomial sample complexity guarantee.
|
| 180 |
+
|
| 181 |
+
# 3.3 When we can Infer Contexts?
|
| 182 |
+
|
| 183 |
+
Without explicit access to the true context at the end of an episode, it is natural to estimate the context from the sampled trajectory. One sufficient condition to infer the context is the following:
|
| 184 |
+
|
| 185 |
+
Assumption 1 $\boldsymbol { \delta }$ -Strongly Separated MDPs) For all $m$ , $m _ { 1 } , m _ { 2 } \in [ M ]$ such that $m _ { 1 } \neq m _ { 2 }$ , for all $( s , a ) \in \mathcal { S } \times \mathcal { A } , l$ $l _ { 1 }$ distance between probability of observations $o = \bar { ( \boldsymbol { s } ^ { \prime } , \boldsymbol { r } ) }$ of two different $M D P s$ in $L M D P$ is at least $\delta > 0$ , i.e., $\| ( \mathbb { P } _ { m _ { 1 } } - \mathbb { P } _ { m _ { 2 } } ) ( o | s , a ) \| _ { 1 } \geq \delta$ for some constant $\delta > 0$ .
|
| 186 |
+
|
| 187 |
+
In order to reliably infer the true contexts the seperatedness between MDPs alone is not sufficient, since we need to estimate the contexts from the current empirical estimates of LMDPs. In order to reliably estimate the context from empirical estimate of LMDPs, we need a well-initialized empirical transition model of the LMDP:
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
\| ( \hat { T } _ { m } - T _ { m } ) ( s ^ { \prime } | s , a ) \| _ { 1 } , \ \| ( \hat { \nu } _ { m } - \nu _ { m } ) ( s ) \| _ { 1 } , \ \| ( \hat { R } _ { m } - R _ { m } ) ( r | s , a ) \| _ { 1 } \leq \epsilon _ { i n i t } , \qquad \forall ( s , a ) ,
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
for some initialization error $\epsilon _ { i n i t } > 0$ . Note that while the initialization error is relatively small, it can be still not good enough to obtain a near-optimal policy (i.e., it will result in a linear regret). We can consider as if the state-action pairs are already visit at least $N _ { 0 } = c _ { T } / \epsilon _ { i n i t } ^ { 2 }$ times in each context.
|
| 194 |
+
|
| 195 |
+
Once the initialization is given along with separation between MDPs, we can modify Algorithm 1 to update the empirical estimate of LMDP using the estimated belief over contexts computed in Algorithm 3. Note that when we update the model parameters, we increase the visit count of stateaction pair $( s , a )$ at $m ^ { t h }$ MDP by $\hat { b } ( m )$ . With Assumption 1, it approximately adds a count for the correctly estimated context, but even without Assumption 1, the update steps can still be applied. In fact, this is equivalent to an implementation of the so-called (online) expectation-maximization (EM) algorithm [10] for latent MDPs. Thus Algorithm 1 with Algorithm 3 essentially results in combining L-UCRL and the EM algorithm.
|
| 196 |
+
|
| 197 |
+
<table><tr><td colspan="2">Learn PSR parameters up to precision o(δ)</td></tr><tr><td colspan="2">Get clusters {Tm(*|s,a), Rm(-|s,a)}(s,a)∈S× A,m∈[M] with learned PSR parameters Build each MDP model by correctly assigning contexts to estimated model parameters Return Well-initialized model {Tm, Rm}m∈[M]</td></tr></table>
|
| 198 |
+
|
| 199 |
+
In terms of performance guarantees, using Algorithm 3 as a sub-routine for L-UCRL gives the same order of regret as in Theorem 3.3 as long as the true context can be almost reliably inferred:
|
| 200 |
+
|
| 201 |
+
Theorem 3.4 Suppose Assumption 1 holds with $H > C \cdot \delta ^ { - 4 } \log ^ { 2 } ( 1 / \alpha ) \log ( N / \eta ) .$ for some absolute constants $C , \delta > 0$ , and a parameter $\alpha > 0$ such that $\alpha \ln ( 1 / \alpha ) \leq \delta ^ { 2 } / ( 2 0 0 S )$ . If the initialization parameters satisfy equation (3) with some initialization error $\epsilon _ { i n i t } \leq \delta ^ { 2 } / ( 2 0 0 \ln ( 1 / \alpha ) )$ , then with probability at least $1 - \eta$ , the regret of Algorithm $^ { l }$ is bounded by:
|
| 202 |
+
|
| 203 |
+
$$
|
| 204 |
+
R e g r e t ( K ) \lesssim H S \sqrt { M A N } .
|
| 205 |
+
$$
|
| 206 |
+
|
| 207 |
+
The proof of Theorem 3.4 is given in Appendix D.3. The provable guarantees are only given for wellseparated LMDPs. Nevertheless, we empirically evaluate Algorithm 1 as a function of separations and initialization (see Figure 1).
|
| 208 |
+
|
| 209 |
+
An interesting consequence of Assumption 1 is that the length of episode can be logarithmic in the number of state and actions. With much longer time-horizons $H \overset { \cdot } { \geq } \Omega ( S ^ { 2 } A / \delta ^ { 2 } )$ , [8, 18] assumed similar $\delta$ -separation only for some $( s , a )$ pairs. While Assumption 1 requires a stronger assumption of $\delta$ -separation for all state-actions, the requirement on the time-horizon can be significantly weaker with large state and action spaces. For a more discussion on the separation condition, we refer the readers to Appendix D.1.
|
| 210 |
+
|
| 211 |
+
# 3.4 Learning LMDPs without Initialization
|
| 212 |
+
|
| 213 |
+
Finally, we discuss efficient initialization with some additional assumptions. Clustering trajectories is the cornerstone of all our technical results, as this allows us to estimate the parameters of each hidden MDP and then apply the techniques of Section 3.2. The challenge is how to cluster when we have short trajectories, and no good initialization.
|
| 214 |
+
|
| 215 |
+
The key is again in Assumption 1. In Section 3.3, we use a good initialization to obtain accurate estimates of the belief states. These can then be clustered, thanks to Assumption 1, allowing us to obtain the true label in hindsight. Without initialization, we cannot accurately compute the belief state, so this avenue is blocked. Instead, our key idea is to leverage a predictive state representation (PSR) of the POMDP dynamics, and then show that Assumption 1 allows us to cluster in this space.
|
| 216 |
+
|
| 217 |
+
Algorithm 4 gives our approach. We first explain the high-level idea, and subsequently detail some of the more subtle points. Suppose we have PSR parameters allowing us to estimate ${ \dot { \mathbb { P } } } ( o | h | | \mathbf { d o } a )$ , (the probabilities of any future observations $o = \left( s ^ { \prime } , r \right)$ given a history $h$ and intervening action $a$ ) to within accuracy $o ( \delta )$ . We then show that we can again apply Assumption 1, to (almost) perfectly cluster the MDPs by true context at the end of the episode. After we collect transition probabilities at all states near the end of episode, we can construct a full transition model for each MDP.
|
| 218 |
+
|
| 219 |
+
Learning the PSR to sufficient accuracy requires an additional assumption. We show that the following standard assumption on statistical sufficiency of histories and tests, is sufficient for our purposes (see also Section 2.2.1 and Appendix E.1):
|
| 220 |
+
|
| 221 |
+
Assumption 2 (Sufficient Tests/Histories) Let $\tau$ and $\mathcal { H }$ be the set of all possible tests and histories of length $l = O ( 1 )$ respectively, with a given sampling policy $\boldsymbol { \mathscr { u } }$ (e.g., uniformly random policy) for histories H. $\tau$ and $\mathcal { H }$ satisfy Condition 1 and 2 respectively.
|
| 222 |
+
|
| 223 |
+

|
| 224 |
+
Figure 1: (a) L-UCRL when true contexts are revealed in hindsight and when we run with the EM algorithm. (b) $\mathrm { E M } + \mathrm { L }$ -UCRL (Algorithm 1) under different levels of separation and horizon length.
|
| 225 |
+
|
| 226 |
+
While the worst-case instance may require $l \geq M$ to satisfy the full-rank conditions, we assume that the length of sufficient tests/histories is $l = O ( 1 )$ . In fact, $l = 1$ has been (implicitly) the common assumption in the literature on learning POMDPs [20, 5, 17, 25]. Empirically, we observe that the more MDPs differ, the more easily they satisfy Assumption 2. See Figure 2. At this point, we are not aware whether sample-efficient learning is possible with only Assumption 1.
|
| 227 |
+
|
| 228 |
+
Though the main idea and key assumption are above, a few important details and technical assumptions remain to complete this story. The primary guarantee still required is that we have access to an exploration policy with sufficient mixing, to guarantee we can collect all required information to perform the PSR-based clustering. The following assumption ensures that additional ${ \tilde { O } } ( M / \alpha _ { 2 } )$ sample trajectories obtained with the exploration policy $\pi$ can provide $M$ clusters of estimated one-step predictions $\mathbb { P } _ { m } ( o | s , a )$ for every state $s$ and intervening action $a$ .
|
| 229 |
+
|
| 230 |
+
Assumption 3 (Reachability of States) There exists a priori known exploration policy $\pi$ such that, for all $m \in [ M ]$ and $s \in S$ , we have $\mathbb { P } _ { m } ^ { \pi } ( s _ { H - 1 } = s ) \geq \alpha _ { 2 }$ for some $\alpha _ { 2 } > 0$ .
|
| 231 |
+
|
| 232 |
+
A subtle point here is that we still have an ambiguity issue in the ordering of contexts (or labels) assigned in different states, which prevents us from recovering the full model for each context. We resolve this issues ambiguity assuming the MDP is connected, and give the full description of Algorithm 4 in Appendix E.2. We conclude this section with an (informal) end-to-end guarantee:
|
| 233 |
+
|
| 234 |
+
Theorem 3.5 (Informal) Let Assumption 2 hold for an LMDP instance with a sampling policy $\pi$ . Furthermore, assume the LMDP satisfies Assumptions 1 and 3. Then there exists an algorithm such that with probability at least $2 / 3$ , it returns a good initialization of LMDP parameters that satisfies (3) in time $p o l y ( A ^ { l } , S , H , M , \sigma _ { h } ^ { - 1 } , \sigma _ { \tau } ^ { - 1 } , \alpha _ { 2 } ^ { - 1 } , \delta , \epsilon _ { i n i t } ) .$ .
|
| 235 |
+
|
| 236 |
+
Theorem 3.5 completes the pipeline for learning in latent MDPs: we initialize the parameters by the estimated PSR and clustering (see Appendix E) up to some accuracy, and then we run L-UCRL to refine the model and policy up to arbitrary accuracy (Algorithm 1). Full version of Theorem 3.5 can be found in Theorem E.3.
|
| 237 |
+
|
| 238 |
+
# 4 Experiments
|
| 239 |
+
|
| 240 |
+
In this section, we evaluate the proposed algorithm on synthetic data. Our first two experiments illustrate the performance of L-UCRL (Algorithm 1) for various levels of separation and quality of initialization. Then, we empirically study the performance of the PSR-Clustering algorithm for randomly generated LMDPs for different levels of separation and time-horizon.
|
| 241 |
+
|
| 242 |
+
# 4.1 The Value of True Contexts in Hindsight
|
| 243 |
+
|
| 244 |
+
We first study the importance of receiving the true contexts in hindsight for the approach analyzed in this work, by comparing the performance of Algorithm 1 when instantiating it with Algorithm 2 or 3 as a sub-routine. We generate random instances of LMDPs of size $M = 7 , S = 1 5 , A = 3$ and set the time-horizon $H = 3 0$ . The reward distribution is set to be 0 for most state-action pairs. We compare when we give a true context to the algorithm (Algorithm 2) and when we infer a context with random initialization or good initialization (Algorithm 3). In the latter, it is equivalent to running the EM algorithm for the model estimation. For the planning algorithm, we use Q-MDP heuristic [32] which shows good empirical performance. We measure the model estimation error as $\begin{array} { r } { \begin{array} { r } { e r r o r : = \operatorname* { m i n } _ { \sigma \in { \mathrm { P e r m } } _ { M } } \sum _ { ( m , s , a ) } \| \big ( { \mathbb { P } } _ { m } - \hat { { \mathbb { P } } } _ { \sigma ( m ) } \big ) \big ( s ^ { \prime } , r | s , a \big ) \| _ { 1 } , } \end{array} } \end{array}$ where $ { \mathrm { P e r m } } _ { M }$ denotes all length $M$ permutation sequences. The measured errors are averaged over 10 independent experiments.
|
| 245 |
+
|
| 246 |
+

|
| 247 |
+
Figure 2: PSR learning and Clustering (Algorithm 4). Left: Convergence of belief state. Middle: $M ^ { t h }$ singular value of sufficient histories/tests matrix $P _ { \mathcal { T } , \mathcal { H } }$ . Right: Accuracy of the estimated model.
|
| 248 |
+
|
| 249 |
+
The experimental results are given in Figure 1(a). When the true context is given at the end of episode (with Algorithm 2), L-UCRL converges to the optimal policy as our theory suggests. On the other hand, if the true context is not given (with Algorithm 3), the quality of initialization becomes crucial; when the model is poorly initialized, the estimated model converges to a local optimum which leads to a sub-optimal policy. When the model is well-initialized, L-UCRL performs as well as when true contexts are given in hindsight.
|
| 250 |
+
|
| 251 |
+
# 4.2 Performance of L-UCRL with Good Initialization
|
| 252 |
+
|
| 253 |
+
In our second experiment, we focus on the performance of L-UCRL (Algorithm 1) along with Algorithm 3 under different levels of separation $\delta$ in Assumption 1) when approximately good model parameters are given. For various levels of $\delta$ , we generate the parameters for transition probabilities randomly while keeping the distance between different MDPs to satisfy $\delta \leq \| ( T _ { m _ { 1 } } -$ $\bar { T } _ { m _ { 2 } } ) ( s ^ { \prime } | s , a ) \| _ { 1 } \leq 2 \delta$ for $m _ { 1 } \neq m _ { 2 }$ .
|
| 254 |
+
|
| 255 |
+
We show the error in the estimated model and average long-term rewards in Figure 1(b). When the separation is sufficient (larger $\delta$ or $H$ ), the estimated model converges fast to the true parameters. When the separation gets small (smaller $\delta$ or $H$ ), the convergence speed gets slower. This type of transition in the convergence speed of EM (the update of model parameters with Algorithm 3) is observed both in theory and practice when the overlap between mixture components gets larger (e.g., [29]). On the other hand, the policy steadily improves regardless of the level of separation. We conjecture that this is because the optimal policy would only need the model to be accurate in the total-variation distance, not in the actual estimated parameters.
|
| 256 |
+
|
| 257 |
+
# 4.3 Initialization with PSR and Clustering
|
| 258 |
+
|
| 259 |
+
In the third experiment, we evaluate the initialization algorithm (Algorithm 4) for randomly generated LMDP instances. Since PSR learning requires a (relatively) large number of short sample trajectories, we evaluate this step on smaller instances with $S = 7 , A = 2 , M = 3$ . The LMDP instances are generated similarly as in the second experiment with different levels of $\delta$ and $H$ . The reward and initial distributions are set the same across all MDPs. To learn the parameters of PSR, we run $1 0 ^ { 6 }$ episodes with $H = 4$ . We assume histories and tests of length 1 are statistically sufficient with the uniformly random policy. In the clustering step, we run an additional $5 \cdot 1 0 ^ { 3 }$ episodes to obtain longer trajectories of length $H = 2 0 , 4 0$ and 80. We report the experimental results in Figure 2.
|
| 260 |
+
|
| 261 |
+
We first observe how the level of separation $\delta$ between MDPs impacts trajectory separation, i.e., belief state vs true label (left). Recall that this separation property is the key for clustering trajectories. We then examine the performance of Algorithm 4 (see full Algorithm 5) for various levels of separation. Empirically, it succeeds to get a good initialization of an LMDP model when we have sufficient separation. As the separation level decreases, the algorithm starts to fail (Right). There are two possible sources of the failure: (1) the belief state is far from the true context, and (2) the similarity between MDPs drops the $M ^ { t h }$ singular value of $P _ { \mathcal { T } , \mathcal { H } }$ (Middle). We can compensate for (1) if we have a longer time-horizon to infer true contexts, as in the leftmost graph. For (2), if the $M ^ { t h }$ singular value drops, we require more samples for the estimation of PSR parameters. In our experiments, as we decreased $\delta$ we found that failure in the spectral learning step was the more significant of the two.
|
| 262 |
+
|
| 263 |
+
# 5 Future Work
|
| 264 |
+
|
| 265 |
+
There are several interesting research avenues in continuation of this work. An interesting direction is to study RL algorithms for LMDPs with no underlying assumptions. Although our lower bound suggests such an algorithm necessarily suffers an exponential dependence in the number of contexts, if this number is small, such dependence might be acceptable. Specifically, we conjecture that general LMDPs can be learned with sample complexity of poly $\left( \dot { ( } H S A ) ^ { M } , \epsilon ^ { - 1 } \right)$ . For a special case when MDPs are deterministic, we show that the exponential dependence in $\dot { M }$ is sufficient In Appendix G. The case for general LMDPs is an interesting open question. Furthermore, a needed empirical advancement is to design efficient ways to learn the set of sufficient histories/tests for learning predictive state representation of LMDPs. This can dramatically improve the performance of our algorithms when a sufficiently good initial model needs to be learned.
|
| 266 |
+
|
| 267 |
+
# Acknowledgement
|
| 268 |
+
|
| 269 |
+
The research was funded by NSF grant 2019844, and by the Army Research Office and was accomplished under Cooperative Agreement Number W911NF-19-2-0333. The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of the Army Research Office or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation herein.
|
| 270 |
+
|
| 271 |
+
# References
|
| 272 |
+
|
| 273 |
+
[1] A. Anandkumar, R. Ge, D. Hsu, S. M. Kakade, and M. Telgarsky. Tensor decompositions for learning latent variable models. Journal of Machine Learning Research, 15:2773–2832, 2014.
|
| 274 |
+
[2] A. Anandkumar, D. Hsu, and S. M. Kakade. A method of moments for mixture models and hidden markov models. In Conference on Learning Theory, pages 33–1, 2012.
|
| 275 |
+
[3] D. Arthur and S. Vassilvitskii. k-means $^ { + + }$ the advantages of careful seeding. In Proceedings of the eighteenth annual ACM-SIAM symposium on Discrete algorithms, pages 1027–1035, 2007.
|
| 276 |
+
[4] M. G. Azar, I. Osband, and R. Munos. Minimax regret bounds for reinforcement learning. arXiv preprint arXiv:1703.05449, 2017.
|
| 277 |
+
[5] K. Azizzadenesheli, A. Lazaric, and A. Anandkumar. Reinforcement learning of POMDPs using spectral methods. In Conference on Learning Theory, pages 193–256, 2016.
|
| 278 |
+
[6] B. Boots and G. J. Gordon. An online spectral learning algorithm for partially observable nonlinear dynamical systems. In Twenty-Fifth AAAI Conference on Artificial Intelligence, 2011.
|
| 279 |
+
[7] B. Boots, S. M. Siddiqi, and G. J. Gordon. Closing the learning-planning loop with predictive state representations. The International Journal of Robotics Research, 30(7):954–966, 2011.
|
| 280 |
+
[8] E. Brunskill and L. Li. Sample complexity of multi-task reinforcement learning. In Uncertainty in Artificial Intelligence, page 122. Citeseer, 2013.
|
| 281 |
+
[9] P. Buchholz and D. Scheftelowitsch. Computation of weighted sums of rewards for concurrent MDPs. Mathematical Methods of Operations Research, 89(1):1–42, 2019.
|
| 282 |
+
[10] O. Cappé and E. Moulines. On-line expectation–maximization algorithm for latent data models. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 71(3):593–613, 2009.
|
| 283 |
+
[11] I. Chadès, J. Carwardine, T. Martin, S. Nicol, R. Sabbadin, and O. Buffet. Momdps: a solution for modelling adaptive management problems. In Twenty-Sixth AAAI Conference on Artificial Intelligence (AAAI-12), 2012.
|
| 284 |
+
[12] C. Dann, N. Jiang, A. Krishnamurthy, A. Agarwal, J. Langford, and R. E. Schapire. On oracleefficient PAC RL with rich observations. In Advances in neural information processing systems, pages 1422–1432, 2018.
|
| 285 |
+
[13] S. Du, A. Krishnamurthy, N. Jiang, A. Agarwal, M. Dudik, and J. Langford. Provably efficient rl with rich observations via latent state decoding. In International Conference on Machine Learning, pages 1665–1674, 2019.
|
| 286 |
+
[14] A. Garivier, P. Ménard, and G. Stoltz. Explore first, exploit next: The true shape of regret in bandit problems. Mathematics of Operations Research, 44(2):377–399, 2019.
|
| 287 |
+
[15] C. Gentile, S. Li, P. Kar, A. Karatzoglou, G. Zappella, and E. Etrue. On context-dependent clustering of bandits. In International Conference on Machine Learning, pages 1253–1262. PMLR, 2017.
|
| 288 |
+
[16] C. Gentile, S. Li, and G. Zappella. Online clustering of bandits. In International Conference on Machine Learning, pages 757–765, 2014.
|
| 289 |
+
[17] Z. D. Guo, S. Doroudi, and E. Brunskill. A PAC RL algorithm for episodic POMDPs. In Artificial Intelligence and Statistics, pages 510–518, 2016.
|
| 290 |
+
[18] A. Hallak, D. Di Castro, and S. Mannor. Contextual markov decision processes. arXiv preprint arXiv:1502.02259, 2015.
|
| 291 |
+
[19] A. Hefny, C. Downey, and G. J. Gordon. Supervised learning for dynamical system learning. In Advances in neural information processing systems, pages 1963–1971, 2015.
|
| 292 |
+
[20] D. Hsu, S. M. Kakade, and T. Zhang. A spectral algorithm for learning hidden markov models. Journal of Computer and System Sciences, 78(5):1460–1480, 2012.
|
| 293 |
+
[21] T. Jaakkola, S. P. Singh, and M. I. Jordan. Reinforcement learning algorithm for partially observable markov decision problems. In Advances in neural information processing systems, pages 345–352, 1995.
|
| 294 |
+
[22] T. Jaksch, R. Ortner, and P. Auer. Near-optimal regret bounds for reinforcement learning. Journal of Machine Learning Research, 11:1563–1600, 2010.
|
| 295 |
+
[23] N. Jiang, A. Krishnamurthy, A. Agarwal, J. Langford, and R. E. Schapire. Contextual decision processes with low bellman rank are PAC-learnable. In International Conference on Machine Learning, pages 1704–1713. PMLR, 2017.
|
| 296 |
+
[24] N. Jiang, A. Kulesza, and S. Singh. Improving predictive state representations via gradient descent. In Thirtieth AAAI Conference on Artificial Intelligence, 2016.
|
| 297 |
+
[25] C. Jin, S. M. Kakade, A. Krishnamurthy, and Q. Liu. Sample-efficient reinforcement learning of undercomplete POMDPs. arXiv preprint arXiv:2006.12484, 2020.
|
| 298 |
+
[26] A. Krishnamurthy, A. Agarwal, and J. Langford. PAC reinforcement learning with rich observations. In Advances in Neural Information Processing Systems, pages 1840–1848, 2016.
|
| 299 |
+
[27] J. Kwon and C. Caramanis. The EM algorithm gives sample-optimality for learning mixtures of well-separated gaussians. In Conference on Learning Theory, pages 2425–2487, 2020.
|
| 300 |
+
[28] J. Kwon and C. Caramanis. EM converges for a mixture of many linear regressions. In International Conference on Artificial Intelligence and Statistics, pages 1727–1736, 2020.
|
| 301 |
+
[29] J. Kwon, N. Ho, and C. Caramanis. On the minimax optimality of the EM algorithm for learning two-component mixed linear regression. arXiv preprint arXiv:2006.02601, 2020.
|
| 302 |
+
[30] Y. Li, B. Yin, and H. Xi. Finding optimal memoryless policies of POMDPs under the expected average reward criterion. European Journal of Operational Research, 211(3):556–567, 2011.
|
| 303 |
+
[31] M. L. Littman. Memoryless policies: Theoretical limitations and practical results. In From Animals to Animats 3: Proceedings of the third international conference on simulation of adaptive behavior, volume 3, page 238. Cambridge, MA, 1994.
|
| 304 |
+
[32] M. L. Littman, A. R. Cassandra, and L. P. Kaelbling. Learning policies for partially observable environments: Scaling up. In Machine Learning Proceedings 1995, pages 362–370. Elsevier, 1995.
|
| 305 |
+
[33] M. L. Littman and R. S. Sutton. Predictive representations of state. In Advances in neural information processing systems, pages 1555–1561, 2002.
|
| 306 |
+
[34] Y. Liu, Z. Guo, and E. Brunskill. PAC continuous state online multitask reinforcement learning with identification. In Proceedings of the 2016 International Conference on Autonomous Agents & Multiagent Systems, pages 438–446, 2016.
|
| 307 |
+
[35] O.-A. Maillard and S. Mannor. Latent bandits. In International Conference on Machine Learning, pages 136–144, 2014.
|
| 308 |
+
[36] A. Modi, N. Jiang, S. Singh, and A. Tewari. Markov decision processes with continuous side information. In Algorithmic Learning Theory, pages 597–618, 2018.
|
| 309 |
+
[37] A. Y. Ng and M. Jordan. PEGASUS: a policy search method for large MDPs and POMDPs. In Proceedings of the Sixteenth conference on Uncertainty in artificial intelligence, pages 406–415, 2000.
|
| 310 |
+
[38] C. H. Papadimitriou and J. N. Tsitsiklis. The complexity of Markov decision processes. Mathematics of operations research, 12(3):441–450, 1987.
|
| 311 |
+
[39] J. Pineau, G. Gordon, and S. Thrun. Anytime point-based approximations for large POMDPs. Journal of Artificial Intelligence Research, 27:335–380, 2006.
|
| 312 |
+
[40] S. Ross, M. Izadi, M. Mercer, and D. Buckeridge. Sensitivity analysis of POMDP value functions. In 2009 International Conference on Machine Learning and Applications, pages 317–323. IEEE, 2009.
|
| 313 |
+
[41] S. Singh, M. R. James, and M. R. Rudary. Predictive state representations: a new theory for modeling dynamical systems. In Proceedings of the 20th conference on Uncertainty in artificial intelligence, pages 512–519, 2004.
|
| 314 |
+
[42] R. D. Smallwood and E. J. Sondik. The optimal control of partially observable markov processes over a finite horizon. Operations research, 21(5):1071–1088, 1973.
|
| 315 |
+
[43] T. Smith and R. Simmons. Heuristic search value iteration for POMDPs. In Proceedings of the 20th conference on Uncertainty in artificial intelligence, pages 520–527, 2004.
|
| 316 |
+
[44] M. T. Spaan and N. Vlassis. Perseus: Randomized point-based value iteration for POMDPs. Journal of artificial intelligence research, 24:195–220, 2005.
|
| 317 |
+
[45] L. N. Steimle, D. L. Kaufman, and B. T. Denton. Multi-model markov decision processes. Optimization Online URL http://www. optimization-online. org/DB_FILE/2018/01/6434. pdf, 2018.
|
| 318 |
+
[46] G. W. Stewart. Matrix perturbation theory. 1990.
|
| 319 |
+
[47] M. E. Taylor and P. Stone. Transfer learning for reinforcement learning domains: A survey. Journal of Machine Learning Research, 10(7), 2009.
|
| 320 |
+
[48] R. Vershynin. Introduction to the non-asymptotic analysis of random matrices. arXiv preprint arXiv:1011.3027, 2010.
|
md/train/CzVPfeqPOBu/CzVPfeqPOBu.md
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Transfer Learning of Graph Neural Networks with Ego-graph Information Maximization
|
| 2 |
+
|
| 3 |
+
Qi Zhu1∗, Carl Yang2∗, Yidan $\mathbf { X } \mathbf { u } ^ { 3 }$ , Haonan Wang1, Chao Zhang4, Jiawei Han1
|
| 4 |
+
|
| 5 |
+
1University of Illinois Urbana-Champaign, 2Emory University, 3University of Washington, 4Georgia Institute of Technology 1{qiz3,haonan3,hanj}@illinois.edu, 2j.carlyang@emory.edu, 3yx2516@uw.edu, 4chaozhang@gatech.edu
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Graph neural networks (GNNs) have achieved superior performance in various applications, but training dedicated GNNs can be costly for large-scale graphs. Some recent work started to study the pre-training of GNNs. However, none of them provide theoretical insights into the design of their frameworks, or clear requirements and guarantees towards their transferability. In this work, we establish a theoretically grounded and practically useful framework for the transfer learning of GNNs. Firstly, we propose a novel view towards the essential graph information and advocate the capturing of it as the goal of transferable GNN training, which motivates the design of EGI (Ego-Graph Information maximization) to analytically achieve this goal. Secondly, when node features are structure-relevant, we conduct an analysis of EGI transferability regarding the difference between the local graph Laplacians of the source and target graphs. We conduct controlled synthetic experiments to directly justify our theoretical conclusions. Comprehensive experiments on two real-world network datasets show consistent results in the analyzed setting of direct-transfering, while those on large-scale knowledge graphs show promising results in the more practical setting of transfering with fine-tuning.1
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Graph neural networks (GNNs) have been intensively studied recently [29, 26, 39, 68], due to their established performance towards various real-world tasks [15, 69, 53], as well as close connections to spectral graph theory [12, 9, 16]. While most GNN architectures are not very complicated, the training of GNNs can still be costly regarding both memory and computation resources on real-world large-scale graphs [10, 63]. Moreover, it is intriguing to transfer learned structural information across different graphs and even domains in settings like few-shot learning [56, 44, 25]. Therefore, several very recent studies have been conducted on the transferability of GNNs [21, 23, 22, 59, 31, 3, 47]. However, it is unclear in what situations the models will excel or fail especially when the pre-training and fine-tuning tasks are different. To provide rigorous analysis and guarantee on the transferability of GNNs, we focus on the setting of direct-transfering between the source and target graphs, under an analogous setting of “domain adaptation” [7, 59].
|
| 14 |
+
|
| 15 |
+
In this work, we establish a theoretically grounded framework for the transfer learning of GNNs, and leverage it to design a practically transferable GNN model. Figure 1 gives an overview of our framework. It is based on a novel view of a graph as samples from the joint distribution of its $\mathbf { k }$ -hop ego-graph structures and node features, which allows us to define graph information and similarity, so as to analyze GNN transferability (§3). This view motivates us to design EGI, a novel GNN training objective based on ego-graph information maximization, which is effective in capturing the graph information as we define (§3.1). Then we further specify the requirement on transferable node features and analyze the transferability of EGI that is dependent on the local graph Laplacians of source and target graphs (§3.2).
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Overview of our GNN transfer learning framework: (1) we represent the toy graph as a combination of its 1-hop ego-graph and node feature distributions; (2) we design a transferable GNN regarding the capturing of such essential graph information; (3) we establish a rigorous guarantee of GNN transferability based on the node feature requirement and graph structure difference.
|
| 19 |
+
|
| 20 |
+
All of our theoretical conclusions have been directly validated through controlled synthetic experiments (Table 1), where we use structural-equivalent role identification in an direct-transfering setting to analyze the impacts of different model designs, node features and source-target structure similarities on GNN transferability. In $\ S 4$ , we conduct real-world experiments on multiple publicly available network datasets. On the Airport and Gene graphs (§4.1), we closely follow the settings of our synthetic experiments and observe consistent but more detailed results supporting the design of EGI and the utility of our theoretical analysis. On the YAGO graphs (§4.2), we further evaluate EGI on the more generalized and practical setting of transfer learning with task-specific fine-tuning. We find our theoretical insights still indicative in such scenarios, where EGI consistently outperforms state-of-the-art GNN representation and transfer learning frameworks with significant margins.
|
| 21 |
+
|
| 22 |
+
# 2 Related Work
|
| 23 |
+
|
| 24 |
+
Representation learning on graphs has been studied for decades, with earlier spectral-based methods [6, 46, 52] theoretically grounded but hardly scaling up to graphs with over a thousand of nodes. With the emergence of neural networks, unsupervised network embedding methods based on the Skip-gram objective [37] have replenished the field [51, 14, 42, 45, 66, 62, 65]. Equipped with efficient structural sampling (random walk, neighborhood, etc.) and negative sampling schemes, these methods are easily parallelizable and scalable to graphs with thousands to millions of nodes. However, these models are essentially transductive as they compute fully parameterized embeddings only for nodes seen during training, which are impossible to be transfered to unseen graphs.
|
| 25 |
+
|
| 26 |
+
More recently, researchers introduce the family of graph neural networks (GNNs) that are capable of inductive learning and generalizing to unseen nodes given meaningful node features [29, 12, 15, 67]. Yet, most existing GNNs require task-specific labels for training in a semi-supervised fashion to achieve satisfactory performance [29, 15, 53, 64], and their usage is limited to single graphs where the downstream task is fixed. To this end, several unsupervised GNNs are presented, such as the auto-encoder-based ones like VGAE [28] and GNFs [35], as well as the deep-infomax-based ones like DGI [54] and InfoGraph [50]. Their potential in the transfer learning of GNN remains unclear when the node features and link structures vary across different graphs.
|
| 27 |
+
|
| 28 |
+
Although the architectures of popular GNNs such as GCN [29] may not be very complicated compared with heavy vision and language models, training a dedicated GNN for each graph can still be cumbersome [10, 63]. Moreover, as pre-training neural networks are proven to be successful in other domains [13, 18], the idea is intriguing to transfer well-trained GNNs from relevant source graphs to improve the modeling of target graphs or enable few-shot learning [59, 31, 3] when labeled data are scarce. In light of this, pioneering works have studied both generative [22] and discriminative [21, 23] GNN pre-training schemes. Though Graph Contrastive Coding [43] shares the most similar view towards graph structures as us, it utilizes contrastive learning across all graphs instead of focusing on the transfer learning between any specific pairs. On the other hand, unsupervised domain adaptive GCNs [59] study the domain adaption problem only when the source and target tasks are homogeneous.
|
| 29 |
+
|
| 30 |
+
Most previous pre-training and self-supervised GNNs lack a rigorous analysis towards their transferability and thus have unpredictable effectiveness. The only existing theoretical work on GNN transferability studies the performance of GNNs across different permutations of a single original graph [33, 34] and the tradeoff between discriminability and transferability of GNNs [47]. We, instead, are the first to rigorously study the more practical setting of transferring GNNs across pairs of different source and target graphs.
|
| 31 |
+
|
| 32 |
+
# 3 Transferable Graph Neural Networks
|
| 33 |
+
|
| 34 |
+
In this paper, we design a more transferable training objective for GNN (EGI) based on our novel view of essential graph information (§3.1). We then analyze its transferability as the gap between its abilities to model the source and target graphs, based on their local graph Laplacians (§3.2).
|
| 35 |
+
|
| 36 |
+
Based on the connection between GNN and spectral graph theory [29], we describe the output of a GNN as a combination of its input node features $X$ , fixed graph Laplacian $L$ and learnable graph filters $\Psi$ . The goal of training a GNN is then to improve its utility by learning the graph filters that are compatible with the other two components towards specific tasks.
|
| 37 |
+
|
| 38 |
+
In the graph transfer learning setting where downstream tasks are often unknown during pre-training, we argue that the general utility of a GNN should be optimized and quantified w.r.t. its ability of capturing the essential graph information in terms of the joint distribution of its topology structures and node features, which motivates us to design a novel ego-graph information maximization model (EGI) (§3.1). The general transferability of a GNN is then quantified by the gap between its abilities to model the source and target graphs. Under reasonable requirements such as using structurerespecting node features as the GNN input, we analyze this gap for EGI based on the structural difference between two graphs w.r.t. their local graph Laplacians (§3.2).
|
| 39 |
+
|
| 40 |
+
# 3.1 Transferable GNN via Ego-graph Information Maximization
|
| 41 |
+
|
| 42 |
+
In this work, we focus on the direct-transfering setting where a GNN is pre-trained on a source graph $G _ { a }$ in an unsupervised fashion and applied on a target graph $G _ { b }$ without fine-tuning.2 Consider a graph $G = \{ V , E \}$ , where the set of nodes $V$ are associated with certain features $X$ and the set of edges $E$ form graph structures. Intuitively, the transfer learning will be successful only if both the features and structures of $G _ { a }$ and $G _ { b }$ are similar in some ways, so that the graph filters of a GNN learned on $G _ { a }$ are compatible with the features and structures of $G _ { b }$ .
|
| 43 |
+
|
| 44 |
+
Graph kernels [57, 8, 30, 38] are well-known for their capability of measuring similarity between pair of graphs. Motivated by $\mathrm { k }$ -hop subgraph kernels [4], we introduce a novel view of a graph as samples from the joint distribution of its $k$ -hop ego-graph structures and node features. Since GNN essentially encodes such $\mathbf { k }$ -hop ego graph samples, this view allows us to give concrete definitions towards structural information of graphs in the transfer learning setting, which facilitates the measuring of similarity (difference) among graphs. Yet, none of the existing GNN training objectives are capable of recovering such distributional signals of ego graphs. To this end, we design $E g o$ -Graph Information maximization (EGI), which alternatively reconstructs the $\mathbf { k }$ -hop ego-graph of each center node via mutual information maximization [20].
|
| 45 |
+
|
| 46 |
+
Definition 3.1 (K-hop ego-graph). We call a graph $g _ { i } = \{ V ( g _ { i } ) , E ( g _ { i } ) \}$ a $k$ -hop ego-graph centered at node $v _ { i }$ if it has a $k$ -layer centroid expansion [4] such that the greatest distance between $v _ { i }$ and any other nodes in the ego-graph is $k ,$ i.e. $\forall v _ { j } \in V ( g _ { i } ) , | d ( v _ { i } , v _ { j } ) | \leq k$ , where $d ( v _ { i } , v _ { j } )$ is the graph distance between $v _ { i }$ and $v _ { j }$ .
|
| 47 |
+
|
| 48 |
+
In this paper, we use directed $\mathrm { k }$ -hop ego-graph and its direction is decided by whether it is composed of incoming or outgoing edges to the center node, i.e., $g _ { i }$ and $\tilde { g _ { i } }$ . The results apply trivially to undirected graphs with $g _ { i } = { \tilde { g } } _ { i }$ .
|
| 49 |
+
|
| 50 |
+
Definition 3.2 (Structural information). Let $\mathcal { G }$ be a topological space of sub-graphs, we view a graph $G$ as samples of $k$ -hop ego-graphs $\{ g _ { i } \} _ { i = 1 } ^ { n }$ drawn i.i.d. from $\mathcal { G }$ with probability $\mu _ { ; }$ , i.e., $g _ { i } \stackrel { \scriptscriptstyle 1 . 1 . 0 . } { \sim } \mu \forall i = 1 , \cdot \cdot \cdot , n$ . The structural information of $G$ is then defined to be the set of $k$ -hop ego-graphs of $\{ g _ { i } \} _ { i = 1 } ^ { n }$ and their empirical distribution.
|
| 51 |
+
|
| 52 |
+
As shown in Figure 1, three graphs $G _ { 0 }$ , $G _ { 1 }$ and $G _ { 2 }$ are characterized by a set of 1-hop ego-graphs and their empirical distributions, which allows us to quantify the structural similarity among graphs as shown in $\ S 3 . 2$ (i.e., $G _ { 0 }$ is more similar to $G _ { 1 }$ than $G _ { 2 }$ under such characterization). In practice, the nodes in a graph $G$ are characterized not only by their $\mathbf { k }$ -hop ego-graph structures but also their associated node features. Therefore, $G$ should be regarded as samples $\{ ( g _ { i } , x _ { i } ) \}$ drawn from the joint distribution $\mathbb { P }$ on the product space of $\mathcal { G }$ and a node feature space $\mathcal { X }$ .
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 2: The overall EGI training framework.
|
| 56 |
+
|
| 57 |
+
Ego-Graph Information Maximization. Given a set of ego-graphs $\{ ( g _ { i } , x _ { i } ) \} _ { i }$ drawn from an empirical joint distribution $( g _ { i } , x _ { i } ) \sim \mathbb { P }$ . We aim to train an GNN encoder $\Psi$ to maximize the mutual informaion (MI $( g _ { i } , \Psi ( g _ { i } , x _ { i } ) )$ ) between the defined structural information $g _ { i } { } ^ { 3 }$ (i.e. k-hop ego-graph) and node embedding $z _ { i } ~ = ~ \Psi ( g _ { i } , x _ { i } )$ . To maximize the MI, another discriminator $\mathcal { D } ( g _ { i } , z _ { i } ) : E ( g _ { i } ) \times z _ { i } \mathbb { R } ^ { + }$ is introduced to compute the probability of an edge $e$ belongs to the given ego-graph $g _ { i }$ . We use the Jensen-Shannon MI estimator [20] in the EGI objective,
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\mathcal { L } _ { \mathrm { E G I } } = - \mathbf { M } \mathbf { I } ^ { \mathrm { ( J S D ) } } \left( \boldsymbol { \mathcal { G } } , \boldsymbol { \Psi } \right) = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \left[ \mathsf { s p } \left( \mathcal { D } ( g _ { i } , z _ { i } ^ { \prime } ) \right) + \mathsf { s p } \left( - \mathcal { D } ( g _ { i } , z _ { i } ) \right) \right] ,
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where $\operatorname { s p } ( x ) = \log ( 1 + e ^ { x } )$ is the softplus function and $( g _ { i } , z _ { i } ^ { \prime } )$ is randomly drawn from the product of marginal distributions, i.e. $z _ { i } ^ { \prime } = \Psi ( g _ { i ^ { \prime } } , x _ { i ^ { \prime } } ) , ( g _ { i ^ { \prime } } , x _ { i ^ { \prime } } ) \sim \mathbb { P } , i ^ { \prime } \neq i$ . In general, we can also randomly draw negative $g _ { i } ^ { \prime }$ in the topological space, while enumerating all possible graphs $g _ { i ^ { \prime } }$ leads to high computation cost.
|
| 64 |
+
|
| 65 |
+
In Eq. 1, the computation of $\mathcal { D }$ on $E ( g _ { i } )$ depends on the node orders. Following the common practice in graph generation [70], we characterize the decision process of $\mathcal { D }$ with a fixed graph ordering, i.e., the BFS-ordering $\pi$ over edges $E ( g _ { i } )$ . $\mathcal { D } = f \circ \Phi$ is composed by another GNN encoder $\Phi$ and scoring function $f$ over an edge sequence $E ^ { \pi } : \{ e _ { 1 } , e _ { 2 } , . . . , e _ { n } \}$ , which makes predictions on the BFS-ordered edges.
|
| 66 |
+
|
| 67 |
+
Recall our previous definition on the direction of $\mathrm { k }$ -hop ego-graph, the center node encoder $\Psi$ receives pairs of $( g _ { i } , x _ { i } )$ while the neighbor node encoder $\Phi$ in discriminator $\mathcal { D }$ receives $( \tilde { g } _ { i } , x _ { i } )$ . Both encoders are parameterized as GNNs,
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\Psi ( g _ { i } , x _ { i } ) = { \bf G } { \bf N } \mathrm { N } _ { \Psi } ( A _ { i } , X _ { i } ) , \Phi ( \tilde { g _ { i } } , x _ { i } ) = { \bf G } { \bf N } \mathrm { N } _ { \Phi } ( A _ { i } ^ { \prime } , X _ { i } ) ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $A _ { i } , A _ { i } ^ { \prime }$ is the adjacency matrix with self-loops of $g _ { i }$ and $\tilde { g _ { i } }$ , respectively. The self-loops are added following the common design of GNNs, which allows the convolutional node embeddings to always incorporate the influence of the center node. $A _ { i } = A _ { i } ^ { \prime \intercal }$ . The output of $\Psi$ , i.e., $z _ { i } \in \mathbb { R } ^ { n }$ , is the center node embedding, while $\Phi$ outputs representation $H \in \mathbb { R } ^ { | g _ { i } | \times n }$ for neighbor nodes in the ego-graph.
|
| 74 |
+
|
| 75 |
+
Once node representation $H$ is computed, we now describe the scoring function $f$ . For each of the node pair $\bar { ( } p , q ) \in E ^ { \pi }$ , $h _ { p }$ is the source node representation from $\Phi$ , $x _ { q }$ is the destination node features. The scoring function is,
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\begin{array} { r } { f ( h _ { p } , x _ { q } , z _ { i } ) = \sigma \left( U ^ { T } \cdot \tau \left( W ^ { T } [ h _ { p } | | x _ { q } | | z _ { i } ] \right) \right) , } \end{array}
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\sigma$ and $\tau$ are Sigmoid and ReLU activation functions. Thus, the discriminator $\mathcal { D }$ is asked to distinguish a positive $\left( ( p , q ) , z _ { i } \right)$ and negative pair $( ( p , q ) , z _ { i } ^ { \prime } ) )$ for each edge in $g _ { i }$ .
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\mathcal { D } ( g _ { i } , z _ { i } ) = \sum _ { ( p , q ) \in E ^ { \pi } } \log f ( h _ { p } , x _ { q } , z _ { i } ) , \mathcal { D } ( g _ { i } , z _ { i } ^ { \prime } ) = \sum _ { ( p , q ) } ^ { E ^ { \pi } } \log f ( h _ { p } , x _ { q } , z _ { i } ^ { \prime } ) .
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
There are two types of edges $( p , q )$ in our consideration of node orders, type-a - the edges across different hops (from the center node), and type- $^ { b }$ - the edges within the same hop (from the center node). The aforementioned BFS-based node ordering guarantees that Eq. 3 is sensitive to the ordering of type-a edges, and invariant to the ordering of type- $\mathbf { \delta } .$ edges, which is consistent with the requirement of our theoretical analysis on $\Delta _ { \mathcal { D } }$ . Due to the fact that the output of a $\mathbf { k }$ -layer GNN only depends on a $\mathbf { k }$ -hop ego-graph for both encoders $\Psi$ and $\Phi$ , EGI can be trained in parallel by sampling batches of $g _ { i }$ ’s. Besides, the training objective of EGI is transferable as long as $( g _ { i } , x _ { i } )$ across source graph $G _ { a }$ and $G _ { b }$ satisfies the conditions given in $\ S 3 . 2$ . More model details in Appendix $\ S _ { \mathbf { B } }$ and source code in the Supplementary Materials.
|
| 88 |
+
|
| 89 |
+
Connection with existing work. To provide more insights into the EGI objective, we also present it as a dual problem of ego-graph reconstruction. Recall our definition of ego-graph mutual information $\mathbf { M I } ( g _ { i } , \Psi ( g _ { i } , x _ { i } ) )$ . It can be related to an ego-graph reconstruction loss $R { \big ( } g _ { i } | \Psi { \big ( } g _ { i } , x _ { i } ) { \big ) }$ as
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\operatorname* { m a x } \mathbf { M } [ ( g _ { i } , \Psi ( g _ { i } , x _ { i } ) ) = H ( g _ { i } ) - H ( g _ { i } | \Psi ( g _ { i } , x _ { i } ) ) \leq H ( g _ { i } ) - R ( g _ { i } | \Psi ( g _ { i } , x _ { i } ) ) .
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
When EGI is maximizing the mutual information, it simultaneously minimizes the upper error bound of reconstructing an ego-graph $g _ { i }$ . In this view, the key difference between EGI and VGAE [28] is they assume each edge in a graph to be observed independently during the reconstruction. While in EGI, edges in an ego-graph are observed jointly during the GNN decoding. Moreover, existing mutual information based GNNs such as DGI [54] and GMI [41] explicitly measure the mutual information between node features $x$ and GNN output $\Psi$ . In this way, they tend to capture node features instead of graph structures, which we deem more essential in graph transfer learning as discussed in $\ S 3 . 2$ .
|
| 96 |
+
|
| 97 |
+
Use cases of EGI framework. In this paper, we focus on the classical domain adaption (directtransferring) setting [7], where no target domain labels are available and transferability is measured by the performance discrepancy without fine-tuning. In this setting, the transferability of EGI is theoretically guaranteed by Theorem 3.1. In $\ S 4 . 1$ , we validated this with the airport datasets. Beyond direct-transferring, EGI is also useful in the more generalized and practical setting of transfer learning with fine-tuning, which we introduced in $\ S 4 . 2$ and validated with the YAGO datasets. In this setting, the transferability of EGI is not rigorously studied yet, but is empirically shown promising.
|
| 98 |
+
|
| 99 |
+
Supportive observations. In the first three columns of our synthetic experimental results (Table 1), in both cases of transfering GNNs between similar graphs (F-F) and dissimilar graphs (B-F), EGI significantly outperforms all competitors when using node degree one-hot encoding as transferable node features. In particular, the performance gains over the untrained GIN show the effectiveness of training and transfering, and our gains are always larger than the two state-of-the-art unsupervised GNNs. Such results clearly indicate advantageous structure preserving capability and transferability of EGI.
|
| 100 |
+
|
| 101 |
+
# 3.2 Transferability analysis based on local graph Laplacians
|
| 102 |
+
|
| 103 |
+
We now study the transferability of a GNN (in particular, with the training objective of ${ \mathcal { L } } _ { \mathrm { E G I } } ,$ ) between the source graph $G _ { a }$ and target graph $G _ { b }$ based on their graph similarity. We firstly establish the requirement towards node features, under which we then focus on analyzing the transferability of EGI w.r.t. the structural information of $G _ { a }$ and $G _ { b }$ .
|
| 104 |
+
|
| 105 |
+
Recall our view of the GNN output as a combination of its input node features, fixed graph Laplacian and learnable graph filters. The utility of a GNN is determined by the compatibility among the three. In order to fulfill such compatibility, we require the node features to be structure-respecting:
|
| 106 |
+
|
| 107 |
+
Definnode Then ion 3.3 (Structure-respectwith a set of node featuree say the node features on es). , where respect $g _ { i }$ -th hop of or any no $v _ { i }$ $\bar { \{ x _ { p , q } ^ { i } \} } _ { p = 0 , q = 1 } ^ { k , | V _ { p } ( g _ { i } ) | }$ $V _ { p } ( g _ { i } )$ $p$ $g _ { i }$ $g _ { i }$ $\cdot x _ { p , q } ^ { i } = [ f ( g _ { i } ) ] _ { p , q } \in \mathbb { R } ^ { d }$ $v _ { q } \in V _ { p } ( g _ { i } )$ , where $f : \mathcal { G } \mathbb { R } ^ { d \times \lvert V ( g _ { i } ) \rvert }$ is a function. In the strict case, $f$ should be injective.
|
| 108 |
+
|
| 109 |
+
In its essence, Def 3.3 requires the node features to be a function of the graph structures, which is sensitive to changes in the graph structures, and in an ideal case, injective to the graph structures (i.e., mapping different graphs to different features). In this way, when the learned graph filters of a transfered GNN is compatible to the structure of $G$ , they are also compatible to the node features of $G$ . As we will explain in Remark 2 of Theorem 3.1, this requirement is also essential for the analysis of EGI transferability which eventually only depends on the structural difference between two graphs.
|
| 110 |
+
|
| 111 |
+
In practice, commonly used node features like node degrees, PageRank scores [40], spectral embeddings [11], and many pre-computed unsupervised network embeddings [42, 51, 14] are all structure-respecting in nature. However, other commonly used node features like random vectors [68] or uniform vectors [60] are not and thus non-transferable. When raw node attributes are available, they are transferable as long as the concept of homophily [36] applies, which also implies Def 3.3, but we do not have a rigorous analysis on it yet.
|
| 112 |
+
|
| 113 |
+
Supportive observations. In the fifth and sixth columns in Table 1, where we use same fixed vectors as non-transferable node features to contrast with the first three columns, there is almost no transferability (see $\delta ( a c c . ) )$ for all compared methods when non-transferable features are used, as the performance of trained GNNs are similar to or worse than their untrained baselines. More detailed experiments on different transferable and non-transferable features can be found in Appendix $\ S { \bf C } . 1$ .
|
| 114 |
+
|
| 115 |
+
With our view of graphs and requirement on node features both established, now we derive the following theorem by characterizing the performance difference of EGI on two graphs based on Eq. 1.
|
| 116 |
+
|
| 117 |
+
Theorem 3.1 (GNN transferability). Let ${ \cal G } _ { a } = \{ ( g _ { i } , x _ { i } ) \} _ { i = 1 } ^ { n }$ and $G _ { b } = \{ ( g _ { i ^ { \prime } } , x _ { i ^ { \prime } } ) \} _ { i ^ { \prime } = 1 } ^ { m }$ be two graphs, and assume node features are structure-relevant. Consider GCN $\Psi _ { \theta }$ with $k$ layers and $a$ $I$ -hop polynomial filter $\phi$ . With reasonable assumptions on the local spectrum of $G _ { a }$ and $G _ { b }$ , the empirical performance difference of $\Psi _ { \theta }$ evaluated on $\mathcal { L } _ { \mathrm { E G I } }$ satisfies
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
| \mathcal { L } _ { \mathrm { E G I } } ( G _ { a } ) - \mathcal { L } _ { \mathrm { E G I } } ( G _ { b } ) | \leq \mathcal { O } \left( \Delta _ { \mathcal { D } } ( G _ { a } , G _ { b } ) + C \right) .
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
On the RHS, $C$ is only dependent on the graph encoders and node features, while $\Delta _ { \mathcal { D } } ( G _ { a } , G _ { b } )$ measures the structural difference between the source and target graphs as follows,
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\Delta _ { \mathcal { D } } ( G _ { a } , G _ { b } ) = \tilde { C } \frac { 1 } { n m } \sum _ { i = 1 } ^ { n } \sum _ { i ^ { \prime } = 1 } ^ { m } \lambda _ { \mathrm { m a x } } ( \tilde { L } _ { g _ { i } } - \tilde { L } _ { g _ { i ^ { \prime } } } )
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
where $\lambda _ { \operatorname* { m a x } } ( A ) : = \lambda _ { \operatorname* { m a x } } ( A ^ { T } A ) ^ { 1 / 2 }$ , and ${ \tilde { L } } _ { g _ { i } }$ denotes the normalised graph Laplacian of $\tilde { g } _ { i }$ by its in-degree. $\tilde { C }$ is a constant dependant on $\lambda _ { \operatorname* { m a x } } ( \tilde { L } _ { g _ { i } } )$ and $\mathcal { D }$ .
|
| 130 |
+
|
| 131 |
+
Proof. The full proof is detailed in Appendix $\ S \mathrm { A }$ .
|
| 132 |
+
|
| 133 |
+
The analysis in Theorem 3.1 naturally instantiates our insight about the correspondence between structural similarity and GNN transferability. It allows us to tell how well an EGI trained on $G _ { a }$ can work on $G _ { b }$ by only checking the local graph Laplacians of $G _ { a }$ and $G _ { b }$ without actually training any model. In particular, we define the EGI gap as $\Delta _ { \mathcal { D } }$ in Eq. 6, as other term $C$ is the same for different methods using same GNN encoder. It can be computed to bound the transferability of EGI regarding its loss difference on the source and target graphs.
|
| 134 |
+
|
| 135 |
+
Remark 1. Our view of a graph $G$ as samples of $k$ -hop ego-graphs is important, as it allows us to obtain node-wise characterization of GNN similarly as in [55]. It also allows us to set the depth of ego-graphs in the analysis to be the same as the number of GNN layers (k), since the GNN embedding of each node mostly depends on its $k$ -hop ego-graph instead of the whole graph.
|
| 136 |
+
|
| 137 |
+
Remark 2. For Eq. 1, Def 3.3 ensures the sampling of GNN embedding at a node always corresponds to sampling an ego-graph from $\mathcal { G }$ , which reduces to uniformly sampling from $G = \{ g _ { i } \} _ { i = 1 } ^ { n }$ under the setting of Theorem 3.1. Therefore, the requirement of Def 3.3 in the context of Theorem 3.1 guarantees the analysis to be only depending on the structural information of the graph.
|
| 138 |
+
|
| 139 |
+
Supportive observations. In Table 1, in the $\bar { d }$ columns, we compute the average structural difference between two Forest-fire graphs $( \Delta _ { \mathcal { D } } ( \mathrm { F } , \mathrm { F } ) )$ and between Barabasi and Forest-fire graphs $\scriptstyle ( \Delta _ { \mathcal { D } } ( \mathbf { B } , \mathrm { F } ) )$ , based on the RHS of Eq. 5. The results validate the topological difference between graphs generated by different random-graph models, while also verifying our view of graph as $\mathbf { k }$ -hop ego-graph samples and the way we propose based on it to characterize structural information of graphs. We further highlight in the $\delta ( \mathrm { a c c } )$ columns the accuracy difference between the GNNs transfered from Forest-fire graphs and Barabasi graphs to Forest-fire graphs. Since Forest-fire graphs are more similar to Forest-fire graphs than Barabasi graphs (as verified in the $\Delta _ { \mathcal { D } }$ columns), we expect $\delta ( \mathrm { a c c . } )$ to be positive and large, indicating more positive transfer between the more similar graphs. Indeed, the behaviors of EGI align well with the expectation, which indicates its well-understood transferability and the utility of our theoretical analysis.
|
| 140 |
+
|
| 141 |
+
Use cases of Theorem 3.1. Our Theorem 3.1 naturally allows for two practical use cases among many others: point-wise pre-judge and pair-wise pre-selection for EGI pre-training. Suppose we have a target graph $G _ { b }$ which does not have sufficient training labels. In the first setting, we have a single source graph $G _ { a }$ which might be useful for pre-training a GNN to be used on $G _ { b }$ . The EGI gap $\Delta _ { \mathcal { D } } ( G _ { a } , G _ { b } )$ in Eq. 6 can then be computed between $G _ { a }$ and $G _ { b }$ to pre-judge whether such transfer learning would be successful before any actual GNN training (i.e., yes if $\Delta _ { \mathcal { D } } ( G _ { a } , G _ { b } )$ is empirically much smaller than 1.0; no otherwise). In the second setting, we have two or more source graphs $\{ G _ { a } ^ { 1 } , G _ { a } ^ { 2 } , . . . \}$ which might be useful for pre-training the GNN. The EGI gap can then be computed between every pair of $G _ { a } ^ { i }$ and $G _ { b }$ to pre-select the best source graph (i.e., select the one with the least EGI gap).
|
| 142 |
+
|
| 143 |
+
In practice, the computation of eigenvalues on the small ego-graphs can be rather efficient [2], and we do not need to enumerate all pairs of ego-graphs on two compared graphs especially if the graphs are really large (e.g., with more than a thousand nodes). Instead, we can randomly sample pairs of ego-graphs from the two graphs, update the average difference on-the-fly, and stop when it converges. Suppose we need to sample $M$ pairs of $\mathbf { k }$ -hop ego-graphs to compare two large graphs, and the average size of ego-graphs are $L$ , then the overall complexity of computing Eq. 5 is $\bar { \mathcal { O } } ( \bar { M } L ^ { 2 } )$ , where $M$ is often less than 1K and $L$ less than 50. In Appendix $\ S { \bf C . 4 }$ , we report the approximated $\Delta _ { \mathcal { D } }$ ’s w.r.t. different sampling frequencies, and they are indeed pretty close to the actual value even with smaller sample frequencies, showing the feasible efficiency of computing $\Delta _ { \mathcal { D } }$ through sampling.
|
| 144 |
+
|
| 145 |
+
Limitations. EGI is designed to account for the structural difference captured by GNNs (i.e., khop ego-graphs). The effectiveness of EGI could be limited if the tasks on target graphs depend on different structural signals. For example, as Eq. 6 is computing the average pairwise distances between the graph Laplacians of local ego-graphs, $\Delta _ { \mathcal { D } }$ is possibly less effective in explicitly capturing global graph properties such as numbers of connected components (CCs). In some specific tasks (such as counting CCs or community detection) where such properties become the key factors, $\Delta _ { \mathcal { D } }$ may fail to predict the transferability of GNNs.
|
| 146 |
+
|
| 147 |
+
# 4 Real Data Experiments
|
| 148 |
+
|
| 149 |
+
Baselines. We compare the proposed model against existing self-supervised GNNs and pre-training GNN algorithms. To exclude the impact of different GNN encoders $\Psi$ on transferability, we always use the same encoder architecture for all compared methods (i.e., GIN [60] for direct-transfering experiments, GCN [29] for transfering with fine-tuning).
|
| 150 |
+
|
| 151 |
+
The self-supervised GNN baselines are GVAE [28], DGI [54] and two latest mutual information estimation methods GMI [41] and MVC [17]. As for pre-training GNN algorithms, MaskGNN and ContextPredGNN are two node-level pre-training models proposed in [21] Besides, Structural Pre-train [23] also conducts unsupervised node-level pre-training with structural features like node degrees and clustering coefficients.
|
| 152 |
+
|
| 153 |
+
Table 1: Synthetic experiments of identifying structural equivalent nodes. We randomly generate 40 graphs with the Forest-fire model (F) [32] and 40 graphs with the Barabasi model (B) [1], The GNN model is GIN [60] with random parameters (baseline with only the neighborhood aggregation function), VGAE[28], DGI [54], and EGI with GIN encoder. We train VGAE, DGI and EGI on one graph from either set (F and B), and test them on the rest of Forest-fire graphs (F). Transferable feature is node degree one-hot encoding and non-transferable feature is uniform vectors. More details about the results and dataset can be found in Appendix $\ S { \bf C } . 1$
|
| 154 |
+
|
| 155 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">transferable features</td><td colspan="3">non-transferable feature</td><td rowspan="2">structural difference △D(F,F)</td><td rowspan="2">△D(B,F)</td></tr><tr><td>F-F</td><td>B-F</td><td>8(acc.)</td><td>F-F</td><td>B-F</td><td>8(acc.)</td></tr><tr><td>GIN (untrained)</td><td>0.572</td><td>0.572</td><td>/</td><td>0.358</td><td>0.358</td><td>/</td><td></td><td></td></tr><tr><td>VGAE (GIN)</td><td>0.498</td><td>0.432</td><td>+0.066</td><td>0.240</td><td>0.239</td><td>0.001</td><td></td><td></td></tr><tr><td>DGI (GIN)</td><td>0.578</td><td>0.591</td><td>-0.013</td><td>0.394</td><td>0.213</td><td>+0.181</td><td>0.752</td><td>0.883</td></tr><tr><td>EGI (GIN)</td><td>0.710</td><td>0.616</td><td>+0.094</td><td>0.376</td><td>0.346</td><td>+0.03</td><td></td><td></td></tr></table>
|
| 156 |
+
|
| 157 |
+
Experimental Settings. The main hyperparameter $k$ is set 2 in EGI as a common practice. We use Adam [27] as optimizer and learning rate is 0.01. We provide the experimental result with varying $k$ in the Appendix $\ S { \bf C . 4 }$ . All baselines are set with the default parameters. Our experiments were run on an AWS g4dn.2xlarge machine with 1 Nvidia T4 GPU. By default, we use node degree one-hot encoding as the transferable feature across all different graphs. As stated before, other transferable features like spectral and other pre-computed node embeddings are also applicable. We focus on the setting where the downstream tasks on target graphs are unspecified but assumed to be structure-relevant, and thus pre-train the GNNs on source graphs in an unsupervised fashion.4 In terms of evaluation, we design two realistic experimental settings: (1) Direct-transfering on the more structure-relevant task of role identification without given node features to directly evaluate the utility and transferability of EGI. (2) Few-shot learning on relation prediction with task-specific node features to evaluate the generalization ability of EGI.
|
| 158 |
+
|
| 159 |
+
# 4.1 Direct-transfering on role identification
|
| 160 |
+
|
| 161 |
+
First, we use the role identification without node features in a direct-transfering setting as a reliable proxy to evaluate transfer learning performance regarding different pre-training objectives. Role in a network is defined as nodes with similar structural behaviors, such as clique members, hub and bridge [19]. Across graphs in the same domain, we assume the definition of role to be consistent, and the task of role identification is highly structure-relevant, which can directly reflect the transferability of different methods and allows us to conduct the analysis according to Theorem 3.1. Upon convergence of pre-training each model on the source graphs, we directly apply them to the target graphs and further train a multi-layer perceptron (MLP) upon their outputs. The GNN parameters are frozen during the MLP training. We refer to this strategy as direct-transfering since there is no fine-tuning of the models after transfering to the target graphs.
|
| 162 |
+
|
| 163 |
+
We use two real-world network datasets with role-based node labels: (1) Airport [45] contains three networks from different regions– Brazil, USA and Europe. Each node is an airport and each link is the flight between airports. The airports are assigned with external labels based on their level of popularity. (2) Gene [68] contains the gene interactions regarding 50 different cancers. Each gene has a binary label indicating whether it is a transcription factor. More details about the results and dataset can be found in Appendix C.2.
|
| 164 |
+
|
| 165 |
+
The experimental setup on the Airport dataset closely resembles that of our synthetic experiments in Table 1, but with real data and more detailed comparisons. We train all models (except for the untrained ones) on the Europe network, and test them on all three networks. The results are presented in Table 2. We notice that the node degree features themselves (with MLP) show reasonable performance in all three networks, which is not surprising since the popularity-based airport role labels are highly relevant to node degrees. The untrained GIN encoder yields a significant margin over just node features, as GNN encoder incorporates structural information to node representations.
|
| 166 |
+
|
| 167 |
+
While training of the DGI can further improve the performance on the source graph, EGI shows the best performance there with the structure-relevant node degree features, corroborating the claimed effectiveness of EGI in capturing the essential graph information (i.e. recover the $\mathbf { k }$ -hop ego-graph distributions) as we stress in $\ S 3$ .
|
| 168 |
+
|
| 169 |
+
When transfering the models to USA and Brazil networks, EGI further achieves the best performance compared with all baselines when structure relevant features are used (64.55 and 73.15), which reflects the most significant positive transfer. Interestingly, direct application of GVAE, DGI and MVC that do not capture the input k-hop graph jointly, leads to rather limited and even negative transferrability (through comparison against the untrained GIN encoders). The recently proposed transfer learning frameworks for GNN like MaskGNN and Structural Pre-train are able to mitigate negative transfer to some extent, but their performances are still inferior to EGI. We believe this is because their models are prone to learn the graph-specific information that is less transferable across different graphs. GMI is also known to capture the graph structure and node features, so it achieves second best result comparing with EGI.
|
| 170 |
+
|
| 171 |
+
Similarly as in Table 1, we also compute the structural differences among three networks w.r.t. the EGI gap in Eq. 6. The structural difference is 0.869 between the Europe and USA networks, and 0.851 between the Europe and Brazil datasets, which are pretty close. Consequently, the transferability of EGI regarding its performance gain over the untrained GIN baseline is $4 . 8 \%$ on the USA network and $4 . 4 \%$ on the Brazil network, which are also close. Such observations again align well with our conclusion in Theorem 3.1 that the transferability of EGI is closely related to the structural differences between source and target graphs.
|
| 172 |
+
|
| 173 |
+
Table 2: Results of role identification with direct-transfering on the Airport dataset. We report mean and standard deviation over 100 runs. The scores marked with ∗∗ passed t-test with $p < 0 . 0 1$ over the second runners.
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Method</td><td colspan="3">Airport [45]</td></tr><tr><td></td><td>Europe</td><td>USA</td><td>Brazil</td></tr><tr><td>features</td><td>0.528±0.052</td><td>0.557±0.028</td><td>0.671±0.089</td></tr><tr><td>GIN (random-init)</td><td>0.558±0.050</td><td>0.616±0.030</td><td>0.700±0.082</td></tr><tr><td>GVAE(GIN) [28]</td><td>0.539±0.053</td><td>0.555±0.029</td><td>0.663±0.089</td></tr><tr><td>DGI(GIN) [54]</td><td>0.578±0.050</td><td>0.549±0.028</td><td>0.673±0.084</td></tr><tr><td>Mask-GIN [21]</td><td>0.564±0.053</td><td>0.608±0.027</td><td>0.667±0.073</td></tr><tr><td>ContextPred-GIN [21]</td><td>0.527±0.048</td><td>0.504±0.030</td><td>0.621±0.078</td></tr><tr><td>Structural Pre-train [23]</td><td>0.560±0.050</td><td>0.622±0.030</td><td>0.688±0.082</td></tr><tr><td>MVC[17]</td><td>0.532±0.050</td><td>0.597±0.030</td><td>0.661±0.093</td></tr><tr><td>GMI [41]</td><td>0.581±0.054</td><td>0.593±0.031</td><td>0.731±0.107</td></tr><tr><td>EGI (GIN)</td><td>0.592±0.046**</td><td>0.646±0.029 **</td><td>0.732±0.078</td></tr></table>
|
| 176 |
+
|
| 177 |
+
On the Gene dataset, with more graphs available, we focus on EGI to further validate the utility of Eq. 5 in Theorem 3.1, regarding the connection between the EGI gap (Eq. 6) and the performance gap (micro-F1) of EGI on them. Due to severe label imbalance that removes the performance gaps, we only use the seven brain cancer networks that have a more consistent balance of labels. As shown in Figure 3, we train EGI on one graph and test it on the other graphs. The $x$ -axis shows the EGI gap, and $y$ -axis shows the improvement on micro-F1 compared with an untrained GIN. The negative correlation between two quantities is obvious. Specifically, when the structural difference is smaller than 1, positive transfer is observed (upper left area) as the performance of transferred EGI is better than untrained GIN, and when the structural difference becomes large $( > 1 )$ , negative transfer is observed. We also notice a similar graph pattern, i.e. single dense cluster, between source graph and positive transferred target graph $G _ { 2 }$ .
|
| 178 |
+
|
| 179 |
+
# 4.2 Few-shot learning on relation prediction
|
| 180 |
+
|
| 181 |
+
Here we evaluate EGI in the more generalized and practical setting of few-shot learning on the less structure-relevant task of relation prediction, with task-specific node features and fine-tuning. The source graph contains a cleaned full dump of 579K entities from YAGO [49], and we investigate 20- shot relation prediction on a target graph with 24 relation types, which is a sub-graph of 115K entities sampled from the same dump. In post-fine-tuning, the models are pre-trained with an unsupervised loss on the source graph and fine-tuned with the task-specific loss on the target graph. In joint-finetuning, the same pre-trained models are jointly optimized w.r.t. the unsupervised pre-training loss and task-specific fine-tuning loss on the target graph. In Table 3, we observe most of the existing models fail to transfer across pre-training and fine-tuning tasks, especially in the joint-fine-tuning setting. In particular, both Mask-GIN and ContextPred-GIN rely a lot on task-specific fine-tuning, while EGI focuses on the capturing of similar ego-graph structures that are transferable across graphs. The mutual information based method GMI also demonstrates considerable transferability and we believe the ability to capture the graph structure is the key to the transferability. As a consequence, EGI significantly outperforms all compared methods in both settings. More detailed statistics and running time are in Appendix $\ S { \bf C } . 3$ .
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
Figure 3: Transfer learning performance of role identification on the Gene dataset. We visualize the source graph $G _ { 0 }$ and two example target graphs that are relatively more different $\left( G _ { 4 } \right)$ or similar $\left( G _ { 2 } \right)$ with $G _ { 0 }$ .
|
| 185 |
+
|
| 186 |
+
Table 3: Performance of few-shot relation prediction on YAGO. The scores marked with ∗∗ passed t-test with $p < 0 . 0 1$ over the second best results.
|
| 187 |
+
|
| 188 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">post-fine-tuning</td><td colspan="2"> joint-fine-tuning</td></tr><tr><td>AUROC</td><td>MRR</td><td>AUROC</td><td>MRR</td></tr><tr><td>No pre-train</td><td>0.687±0.002</td><td>0.596±0.003</td><td>N.A.</td><td>N.A.</td></tr><tr><td>GVAE</td><td>0.701±0.003</td><td>0.601±0.007</td><td>0.679±0.004</td><td>0.568±0.008</td></tr><tr><td>DGI</td><td>0.689±0.011</td><td>0.586±0.025</td><td>0.688±0.012</td><td>0.537±0.023</td></tr><tr><td>MaskGNN</td><td>0.713±0.009</td><td>0.631±0.015</td><td>0.712±0.005</td><td>0.560±0.010</td></tr><tr><td>ContextPredGNN</td><td>0.692±0.030</td><td>0.662±0.030</td><td>0.705±0.011</td><td>0.575±0.021</td></tr><tr><td>GMI</td><td>0.728±0.005</td><td>0.625±0.009</td><td>0.721±0.007</td><td>0.643±0.011</td></tr><tr><td>Structural Pre-train</td><td>OOM</td><td>OOM</td><td>OOM</td><td>OOM</td></tr><tr><td>MVC</td><td>OOM</td><td>OOM</td><td>OOM</td><td>OOM</td></tr><tr><td>EGI</td><td>0.739± 0.009**</td><td>0.670±0.014</td><td>0.787 ± 0.011**</td><td>0.729 ± 0.016**</td></tr></table>
|
| 189 |
+
|
| 190 |
+
# 5 Conclusion
|
| 191 |
+
|
| 192 |
+
To the best of our knowledge, this is the first research effort towards establishing a theoretically grounded framework to analyze GNN transferability, which we also demonstrate to be practically useful for guiding the design and conduct of transfer learning with GNNs. For future work, it is intriguing to further strengthen the bound with relaxed assumptions, rigorously extend it to the more complicated and less restricted settings regarding node features and downstream tasks, as well as analyze and improve the proposed framework over more transfer learning scenarios and datasets. It is also important to protect the privacy of pre-training data to avoid potential negative societal impacts.
|
| 193 |
+
|
| 194 |
+
# Acknowledgments and Disclosure of Funding
|
| 195 |
+
|
| 196 |
+
Research was supported in part by US DARPA KAIROS Program No. FA8750-19-2-1004, SocialSim Program No. W911NF-17-C-0099, and INCAS Program No. HR001121C0165, National Science Foundation IIS-19-56151, IIS-17-41317, and IIS 17-04532, and the Molecule Maker Lab Institute: An AI Research Institutes program supported by NSF under Award No. 2019897. Chao Zhang is supported NSF IIS-2008334, IIS-2106961, and ONR MURI N00014-17-1-2656. We would like to thank AWS Machine Learning Research Awards program for providing computational resources for the experiments in this paper. This work is also partially supported by the internal funding and GPU servers provided by the Computer Science Department of Emory University. Any opinions, findings, and conclusions or recommendations expressed herein are those of the authors and do not necessarily represent the views, either expressed or implied, of DARPA or the U.S. Government.
|
| 197 |
+
|
| 198 |
+
# References
|
| 199 |
+
|
| 200 |
+
of modern physics, 74(1):47, 2002.
|
| 201 |
+
[2] Sanjeev Arora, Elad Hazan, and Satyen Kale. Fast algorithms for approximate semidefinite programming using the multiplicative weights update method. In FOCS, pages 339–348, 2005.
|
| 202 |
+
[3] Jinheon Baek, Dong Bok Lee, and Sung Ju Hwang. Learning to extrapolate knowledge: Transductive few-shot out-of-graph link prediction. Advances in Neural Information Processing Systems, 33, 2020.
|
| 203 |
+
[4] Lu Bai and Edwin R Hancock. Fast depth-based subgraph kernels for unattributed graphs. Pattern Recognition, 50:233–245, 2016.
|
| 204 |
+
[5] Albert-László Barabási and Réka Albert. Emergence of scaling in random networks. science, 286(5439):509–512, 1999.
|
| 205 |
+
[6] Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps and spectral techniques for embedding and clustering. In NIPS, pages 585–591, 2002.
|
| 206 |
+
[7] Shai Ben-David, John Blitzer, Koby Crammer, and Fernando Pereira. Analysis of representations for domain adaptation. In NIPS, pages 137–144, 2007.
|
| 207 |
+
[8] Karsten Borgwardt, Elisabetta Ghisu, Felipe Llinares-López, Leslie O’Bray, and Bastian Rieck. Graph kernels: State-of-the-art and future challenges. arXiv preprint arXiv:2011.03854, 2020.
|
| 208 |
+
[9] Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. In ICLR, 2014.
|
| 209 |
+
[10] Jie Chen, Tengfei Ma, and Cao Xiao. Fastgcn: fast learning with graph convolutional networks via importance sampling. In ICLR, 2018.
|
| 210 |
+
[11] Fan RK Chung and Fan Chung Graham. Spectral graph theory. Number 92. American Mathematical Soc., 1997.
|
| 211 |
+
[12] Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In NIPS, pages 3844–3852, 2016.
|
| 212 |
+
[13] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In ACL, pages 4171–4186, 2019.
|
| 213 |
+
[14] Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In KDD, pages 855–864, 2016.
|
| 214 |
+
[15] Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In NIPS, pages 1024–1034, 2017.
|
| 215 |
+
[16] David K Hammond, Pierre Vandergheynst, and Rémi Gribonval. Wavelets on graphs via spectral graph theory. ACHA, 30(2):129–150, 2011.
|
| 216 |
+
[17] Kaveh Hassani and Amir Hosein Khasahmadi. Contrastive multi-view representation learning on graphs. In International Conference on Machine Learning, pages 4116–4126. PMLR, 2020.
|
| 217 |
+
[18] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770–778, 2016.
|
| 218 |
+
[19] Keith Henderson, Brian Gallagher, Tina Eliassi-Rad, Hanghang Tong, Sugato Basu, Leman Akoglu, Danai Koutra, Christos Faloutsos, and Lei Li. Rolx: structural role extraction & mining in large graphs. In KDD, pages 1231–1239, 2012.
|
| 219 |
+
[20] R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. In ICLR, 2019.
|
| 220 |
+
[21] Weihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik, Percy Liang, Vijay Pande, and Jure Leskovec. Strategies for pre-training graph neural networks. In ICLR, 2019.
|
| 221 |
+
[22] Ziniu Hu, Yuxiao Dong, Kuansan Wang, Kai-Wei Chang, and Yizhou Sun. Gpt-gnn: Generative pre-training of graph neural networks. In KDD, pages 1857–1867, 2020.
|
| 222 |
+
[23] Ziniu Hu, Changjun Fan, Ting Chen, Kai-Wei Chang, and Yizhou Sun. Pre-training graph neural networks for generic structural feature extraction. arXiv preprint arXiv:1905.13728, 2019.
|
| 223 |
+
[24] Suk-Geun Hwang. Cauchy’s interlace theorem for eigenvalues of hermitian matrices. The American Mathematical Monthly, 111(2):157–159, 2004.
|
| 224 |
+
[25] Xuan Kan, Hejie Cui, and Carl Yang. Zero-shot scene graph relation prediction through commonsense knowledge integration. In ECML-PKDD, 2021.
|
| 225 |
+
[26] Nicolas Keriven and Gabriel Peyré. Universal invariant and equivariant graph neural networks. In NIPS, pages 7090–7099, 2019.
|
| 226 |
+
[27] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 227 |
+
[28] Thomas N Kipf and Max Welling. Variational graph auto-encoders. arXiv preprint arXiv:1611.07308, 2016.
|
| 228 |
+
[29] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
|
| 229 |
+
[30] Nils M Kriege, Fredrik D Johansson, and Christopher Morris. A survey on graph kernels. Applied Network Science, 5(1):1–42, 2020.
|
| 230 |
+
[31] Lin Lan, Pinghui Wang, Xuefeng Du, Kaikai Song, Jing Tao, and Xiaohong Guan. Node classification on graphs with few-shot novel labels via meta transformed network embedding. Advances in Neural Information Processing Systems, 33, 2020.
|
| 231 |
+
[32] Jure Leskovec, Jon Kleinberg, and Christos Faloutsos. Graphs over time: densification laws, shrinking diameters and possible explanations. In Proceedings of the eleventh ACM SIGKDD international conference on Knowledge discovery in data mining, pages 177–187, 2005.
|
| 232 |
+
[33] Ron Levie, Wei Huang, Lorenzo Bucci, Michael M Bronstein, and Gitta Kutyniok. Transferability of spectral graph convolutional neural networks. arXiv preprint arXiv:1907.12972, 2019.
|
| 233 |
+
[34] Ron Levie, Elvin Isufi, and Gitta Kutyniok. On the transferability of spectral graph filters. In 2019 13th International conference on Sampling Theory and Applications (SampTA), pages 1–5. IEEE, 2019.
|
| 234 |
+
[35] Jenny Liu, Aviral Kumar, Jimmy Ba, Jamie Kiros, and Kevin Swersky. Graph normalizing flows. In Advances in Neural Information Processing Systems, pages 13556–13566, 2019.
|
| 235 |
+
[36] Miller McPherson, Lynn Smith-Lovin, and James M Cook. Birds of a feather: Homophily in social networks. Annual review of sociology, 27(1):415–444, 2001.
|
| 236 |
+
[37] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, and Jeffrey Dean. Distributed representations of words and phrases and their compositionality. arXiv preprint arXiv:1310.4546, 2013.
|
| 237 |
+
[38] Giannis Nikolentzos, Giannis Siglidis, and Michalis Vazirgiannis. Graph kernels: A survey. arXiv preprint arXiv:1904.12218, 2019.
|
| 238 |
+
[39] Kenta Oono and Taiji Suzuki. Graph neural networks exponentially lose expressive power for node classification. In ICLR, 2020.
|
| 239 |
+
[40] Lawrence Page, Sergey Brin, Rajeev Motwani, and Terry Winograd. The pagerank citation ranking: Bringing order to the web. Technical report, Stanford InfoLab, 1999.
|
| 240 |
+
[41] Zhen Peng, Wenbing Huang, Minnan Luo, Qinghua Zheng, Yu Rong, Tingyang Xu, and Junzhou Huang. Graph representation learning via graphical mutual information maximization. In WWW, pages 259–270, 2020.
|
| 241 |
+
[42] Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representations. In KDD, pages 701–710, 2014.
|
| 242 |
+
[43] Jiezhong Qiu, Qibin Chen, Yuxiao Dong, Jing Zhang, Hongxia Yang, Ming Ding, Kuansan Wang, and Jie Tang. Gcc: Graph contrastive coding for graph neural network pre-training. In KDD, pages 1150–1160, 2020.
|
| 243 |
+
[44] Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In ICLR, 2017.
|
| 244 |
+
[45] Leonardo FR Ribeiro, Pedro HP Saverese, and Daniel R Figueiredo. struc2vec: Learning node representations from structural identity. In KDD, pages 385–394, 2017.
|
| 245 |
+
[46] Sam T Roweis and Lawrence K Saul. Nonlinear dimensionality reduction by locally linear embedding. Science, 290(5500):2323–2326, 2000.
|
| 246 |
+
[47] Luana Ruiz, Luiz Chamon, and Alejandro Ribeiro. Graphon neural networks and the transferability of graph neural networks. Advances in Neural Information Processing Systems, 33, 2020.
|
| 247 |
+
[48] Yu Shi, Qi Zhu, Fang Guo, Chao Zhang, and Jiawei Han. Easing embedding learning by comprehensive transcription of heterogeneous information networks. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 2190–2199, 2018.
|
| 248 |
+
[49] Fabian M Suchanek, Gjergji Kasneci, and Gerhard Weikum. Yago: a core of semantic knowledge. In WWW, pages 697–706, 2007.
|
| 249 |
+
[50] Fan-Yun Sun, Jordan Hoffman, Vikas Verma, and Jian Tang. Infograph: Unsupervised and semi-supervised graph-level representation learning via mutual information maximization. In ICLR, 2019.
|
| 250 |
+
[51] Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, and Qiaozhu Mei. Line: Largescale information network embedding. In WWW, pages 1067–1077, 2015.
|
| 251 |
+
[52] Joshua B Tenenbaum, Vin De Silva, and John C Langford. A global geometric framework for nonlinear dimensionality reduction. Science, 290(5500):2319–2323, 2000.
|
| 252 |
+
[53] Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. In ICLR, 2018.
|
| 253 |
+
[54] Petar Velickovic, William Fedus, William L Hamilton, Pietro Lio, Yoshua Bengio, and R Devon Hjelm. Deep graph infomax. In ICLR, 2019.
|
| 254 |
+
[55] Saurabh Verma and Zhi-Li Zhang. Stability and generalization of graph convolutional neural networks. In KDD, 2019.
|
| 255 |
+
[56] Oriol Vinyals, Charles Blundell, Tim Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In NIPS, pages 3630–3638, 2016.
|
| 256 |
+
[57] S Vichy N Vishwanathan, Nicol N Schraudolph, Risi Kondor, and Karsten M Borgwardt. Graph kernels. Journal of Machine Learning Research, 11:1201–1242, 2010.
|
| 257 |
+
[58] Boris Weisfeiler and Andrei A Lehman. A reduction of a graph to a canonical form and an algebra arising during this reduction. Nauchno-Technicheskaya Informatsia, 2(9):12–16, 1968.
|
| 258 |
+
[59] Man Wu, Shirui Pan, Chuan Zhou, Xiaojun Chang, and Xingquan Zhu. Unsupervised domain adaptive graph convolutional networks. In WWW, pages 1457–1467, 2020.
|
| 259 |
+
[60] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In ICLR, 2019.
|
| 260 |
+
[61] Bishan Yang, Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. Embedding entities and relations for learning and inference in knowledge bases. arXiv preprint arXiv:1412.6575, 2014.
|
| 261 |
+
[62] Carl Yang, Yichen Feng, Pan Li, Yu Shi, and Jiawei Han. Meta-graph based hin spectral embedding: Methods, analyses, and insights. In ICDM, 2018.
|
| 262 |
+
[63] Carl Yang, Aditya Pal, Andrew Zhai, Nikil Pancha, Jiawei Han, Chuck Rosenberg, and Jure Leskovec. Multisage: Empowering graphsage with contextualized multi-embedding on webscale multipartite networks. In KDD, 2020.
|
| 263 |
+
[64] Carl Yang, Yuxin Xiao, Yu Zhang, Yizhou Sun, and Jiawei Han. Heterogeneous network representation learning: A unified framework with survey and benchmark. In TKDE, 2020.
|
| 264 |
+
[65] Carl Yang, Chao Zhang, Xuewen Chen, Jieping Ye, and Jiawei Han. Did you enjoy the ride? understanding passenger experience via heterogeneous network embedding. In ICDE, 2018.
|
| 265 |
+
[66] Carl Yang, Jieyu Zhang, and Jiawei Han. Co-embedding network nodes and hierarchical labels with taxonomy based generative adversarial nets. In ICDM, 2020.
|
| 266 |
+
[67] Carl Yang, Jieyu Zhang, Haonan Wang, Sha Li, Myungwan Kim, Matt Walker, Yiou Xiao, and Jiawei Han. Relation learning on social networks with multi-modal graph edge variational autoencoders. In WSDM, 2020.
|
| 267 |
+
[68] Carl Yang, Peiye Zhuang, Wenhan Shi, Alan Luu, and Pan Li. Conditional structure generation through graph variational generative adversarial nets. In NIPS, pages 1338–1349, 2019.
|
| 268 |
+
[69] Zhitao Ying, Jiaxuan You, Christopher Morris, Xiang Ren, Will Hamilton, and Jure Leskovec. Hierarchical graph representation learning with differentiable pooling. In NIPS, 2018.
|
| 269 |
+
[70] Jiaxuan You, Rex Ying, Xiang Ren, William Hamilton, and Jure Leskovec. GraphRNN: Generating realistic graphs with deep auto-regressive models. In Proceedings of the 35th International Conference on Machine Learning, pages 5708–5717. PMLR, 2018.
|
md/train/H1g0Z3A9Fm/H1g0Z3A9Fm.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/H1g2NhC5KQ/H1g2NhC5KQ.md
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MULTIPLE-ATTRIBUTE TEXT REWRITING
|
| 2 |
+
|
| 3 |
+
Guillaume Lample∗1,3, Sandeep Subramanian∗1,2, Eric Michael Smith1, Ludovic Denoyer1,3, Marc’Aurelio Ranzato1, Y-Lan Boureau1
|
| 4 |
+
|
| 5 |
+
1Facebook AI Research, 2MILA, Universite de Montr ´ eal ´ 3Sorbonne Universites, UPMC Univ Paris 06´ sandeep.subramanian.1@umontreal.ca {glample,ems,denoyer,ranzato,ylan}@fb.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
The dominant approach to unsupervised “style transfer” in text is based on the idea of learning a latent representation, which is independent of the attributes specifying its “style”. In this paper, we show that this condition is not necessary and is not always met in practice, even with domain adversarial training that explicitly aims at learning such disentangled representations. We thus propose a new model that controls several factors of variation in textual data where this condition on disentanglement is replaced with a simpler mechanism based on back-translation. Our method allows control over multiple attributes, like gender, sentiment, product type, etc., and a more fine-grained control on the trade-off between content preservation and change of style with a pooling operator in the latent space. Our experiments demonstrate that the fully entangled model produces better generations, even when tested on new and more challenging benchmarks comprising reviews with multiple sentences and multiple attributes.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
One of the objectives of unsupervised learning is to learn representations of data that enable fine control over the underlying latent factors of variation, e.g., pose and viewpoint of objects in images, or writer style and sentiment of a product review. In conditional generative modeling, these latent factors are given (Sohn et al., 2015; Mirza & Osindero, 2014; Ficler & Goldberg, 2017), or automatically inferred via observation of samples from the data distribution (Chen et al., 2017; 2016; Higgins et al., 2017).
|
| 14 |
+
|
| 15 |
+
More recently, several studies have focused on learning unsupervised mappings between two data domains such as images (Taigman et al., 2016; Isola et al., 2017; Zhu et al., 2017), words or sentences from different languages (Conneau et al., 2017; Lample et al., 2018).
|
| 16 |
+
|
| 17 |
+
In this problem setting, the generative model is conditioned not only on the desired attribute values, but also on a initial input, which it must transform. Generations should retain as many of the original input characteristics as possible, provided the attribute constraint is not violated. This learning task is typically unsupervised because no example of an input and its corresponding output with the specified attribute is available during training. The model only sees random examples and their attribute values.
|
| 18 |
+
|
| 19 |
+
The dominant approach to learn such a mapping in text is via an explicit constraint on disentanglement (Hu et al., 2017; Fu et al., 2017; Shen et al., 2017): the learned representation should be invariant to the specified attribute, and retain only attribute-agnostic information about the “content”. Changing the style of an input at test time then amounts to generating an output based on the disentangled latent representation computed from the input and the desired attributes. Disentanglement is often achieved through an adversarial term in the training objective that aims at making the attribute value unrecoverable from the latent representation.
|
| 20 |
+
|
| 21 |
+
This paper aims to extend previous studies on “style transfer” along three axes. (i) First, we seek to gain a better understanding of what is necessary to make things work, and in particular, whether disentanglement is key, or even actually achieved by an adversarial loss in practice. In Sec. 3.1 we provide strong empirical evidence that disentanglement is not necessary to enable control over the factors of variation, and that even a method using adversarial loss to disentangle (Fu et al., 2017) does not actually learn representations that are disentangled. (ii) Second, we introduce a model which replaces the adversarial term with a back-translation (Sennrich et al., 2015a) objective which exposes the model to a pseudo-supervised setting, where the model’s outputs act as supervised training data for the ultimate task at hand. The resulting model is similar to recently proposed methods for unsupervised machine translation (Lample et al., 2017a; 2018; Artetxe et al., 2018; Zhang et al., 2018b), but with two major differences: (a) we use a pooling operator which is used to control the trade-off between style transfer and content preservation; and (b) we extend this model to support multiple attribute control. (iii) Finally, in Sec. 4.1 we point out that current style transfer benchmarks based on collections of user reviews have severe limitations, as they only consider a single attribute control (sentiment), and very small sentences in isolation with noisy labels. To address this issue, we propose a new set of benchmarks based on existing review datasets, which comprise full reviews, where multiple attributes are extracted from each review.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
|
| 25 |
+
The contributions of this paper are thus: (1) a deeper understanding of the necessary components of style transfer through extensive experiments, resulting in (2) a generic and simple learning framework based on mixing a denoising auto-encoding loss with an online back-translation technique and a novel neural architecture combining a pooling operator and support for multiple attributes, and (3) a new, more challenging and realistic version of existing benchmarks which uses full reviews and multiple attributes per review, as well as a comparison of our approach w.r.t. baselines using both new metrics and human evaluations. We will open-source our code and release the new benchmark datasets used in this work, as well as our pre-trained classifiers and language models for reproducibility. This will also enable fair empirical comparisons on automatic evaluation metrics in future work on this problem.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
There is substantial literature on the task of unsupervised image translation. While initial approaches required supervised data of the form (input, transformation, output), e.g., different images of the same object rendered with different viewpoints or/and different lighting conditions (Hinton et al., 2011; Yang et al., 2015; Kulkarni et al., 2015), current techniques are capable of learning completely unsupervised domain mappings. Given images from two different domains $\mathcal { X }$ and $\mathcal { V }$ (where $\mathcal { X }$ could be the domain of paintings and $\mathcal { V }$ the domain of realistic photographs), and the task is to learn two mappings $F : \mathcal { X } \mathcal { Y }$ and $G : \mathcal { y } \mathcal { x }$ , without supervision, i.e., just based on images sampled from the two domains (Liu & Tuzel, 2016; Taigman et al., 2016; Isola et al., 2017). For instance, Zhu et al. (2017) used a cycle consistency loss to enforce $F ( G ( y ) ) \approx y$ and $G ( F ( x ) ) \approx x$ . This loss is minimized along with an adversarial loss on the generated outputs to constrain the model to generate realistic images. In Fader Networks (Lample et al., 2017b), a discriminator is applied on the latent representation of an image autoencoder to remove the information about specific attributes. The attribute values are instead given explicitly to the decoder at training time, and can be tuned at inference to generate different realistic versions of an input image with varying attribute values.
|
| 30 |
+
|
| 31 |
+
Different approaches have been proposed for textual data, mainly aiming at controlling the writing style of sentences. Unfortunately, datasets of parallel sentences written in a different style are hard to come by. Carlson et al. (2017) collected a dataset of 33 English versions of the Bible written in different styles on which they trained a supervised style transfer model. Li et al. (2018) released a small crowdsourced subset of 1,000 Yelp reviews for evaluation purposes, where the sentiment had been swapped (between positive and negative) while preserving the content. Controlled text generation from unsupervised data is thus the focus of more and more research.
|
| 32 |
+
|
| 33 |
+
An theme that is common to most recent studies is that style transfer can be achieved by disentangling sentence representations in a shared latent space. Most solutions use an adversarial approach to learn latent representations agnostic to the style of input sentences (Fu et al., 2017; Hu et al., 2017; Shen et al., 2017; Zhang et al., 2018a; Xu et al., 2018; John et al., 2018; Zhao et al., 2018). A decoder is then fed with the latent representation along with attribute labels to generate a variation of the input sentence with different attributes.
|
| 34 |
+
|
| 35 |
+
Unfortunately, the discrete nature of the sentence generation process makes it difficult to apply to text techniques such as cycle consistency or adversarial training. For instance, the latter (Shen et al., 2017; dos Santos et al., 2018; Zhang et al., 2018c) requires methods such as REINFORCE (He et al., 2016) or approximating the output softmax layer with a tunable temperature (Hu et al., 2017; Prabhumoye et al., 2018; Yang et al., 2018), all of which tend to be slow, unstable and hard to tune in practice. Moreover, all these studies control a single attribute (e.g. swapping positive and negative sentiment).
|
| 36 |
+
|
| 37 |
+
The most relevant work to ours is Zhang et al. (2018b), which also builds on recent advances in unsupervised machine translation. Their approach first consists of learning cross-domain word embeddings in order to build an initial phrase-table. They use this phrase-table to bootstrap an iterative back-translation pipeline containing both phrase-based and neural machine translation systems. Overall, their approach is significantly more complicated than ours, which is end-to-end and does not require any pre-training. Moreover, this iterative back-translation approach has been shown to be less effective than on-the-fly back-translation which is end-to-end trainable (Lample et al., 2018).
|
| 38 |
+
|
| 39 |
+
# 3 CONTROLLABLE TEXT REWRITING
|
| 40 |
+
|
| 41 |
+
This section briefly introduces notation, the task, and our empirical procedure for evaluating disentanglement before presenting our approach.
|
| 42 |
+
|
| 43 |
+
We consider a training set $\mathcal { D } = \left( x ^ { i } , y ^ { i } \right) _ { i \in [ 1 , n ] }$ of $n$ sentences $x ^ { i } \in { \mathcal { X } }$ paired with attribute values $y ^ { i }$ . $y \in \mathcal { V }$ is a set of $m$ attribute values $y = ( y _ { 1 } , . . . , y _ { m } )$ . Each attribute value $y _ { k }$ is a discrete value in the set ${ \mathcal { V } } _ { k }$ of possible values for attribute $k$ , e.g. $\mathcal { V } _ { k } = \{ \mathrm { b a d } , \mathrm { n e u t r a l } , \mathrm { g o o d } \}$ if $y _ { k }$ represents the overall rating of a restaurant review.
|
| 44 |
+
|
| 45 |
+
Our task is to learn a model $F : \mathcal { X } \times \mathcal { Y } \mathcal { X }$ that maps any pair $( x , \tilde { y } )$ of an input sentence $x$ (whose actual set of attributes are $y$ ) and a new set of $m$ attribute values $\tilde { y }$ to a new sentence $\tilde { x }$ that has the specified attribute values $\tilde { y }$ , subject to retaining as much as possible of the original content from $x$ , where content is defined as anything in $x$ which does not depend on the attributes.
|
| 46 |
+
|
| 47 |
+
The architecture we consider performs this mapping through a sequence-to-sequence auto-encoder that first encodes $x$ into a latent representation $z = e ( x )$ , then decodes $( z , \tilde { y } )$ into $\tilde { x } = d ( z , \tilde { y } )$ , where $e$ and $d$ are functions parameterized by the vector of trainable parameters $\theta$ . Before giving more detail on the architecture, let us look at disentanglement.
|
| 48 |
+
|
| 49 |
+
# 3.1 ARE ADVERSARIAL MODELS REALLY DOING DISENTANGLEMENT?
|
| 50 |
+
|
| 51 |
+
Almost all the existing methods are based on the common idea to learn a latent representation $z$ that is disentangled from $y$ . We consider $z$ to be disentangled from $y$ if it is impossible to recover $y$ from $z$ . While failure to recover $y$ from $z$ could mean either that $z$ was disentangled or that the classifier
|
| 52 |
+
|
| 53 |
+
chosen to recover $y$ was either not powerful enough or poorly trained, success of any classifier in recovering $y$ demonstrates that $z$ was in fact not invariant to $y$ .
|
| 54 |
+
Table 2: Recovering the sentiment of the input from the encoder’s representations of a domain adversarially-trained Fader model $\mathrm { F u }$ et al., 2017). During training, the discriminator, which was trained adversarially and jointly with the model, gets worse at predicting the sentiment of the input when the coefficient of the adversarial loss $\lambda _ { a d v }$ increases. However, a classifier that is separately trained on the resulting encoder representations has an easy time recovering the sentiment. We also report the baseline accuracy of a fastText classifier trained on the actual inputs.
|
| 55 |
+
|
| 56 |
+
<table><tr><td>Xadu</td><td>Discriminator Acc (Train)</td><td>Post-fit Classifier Acc (Test)</td></tr><tr><td>0</td><td>89.45%</td><td>93.8%</td></tr><tr><td>0.001</td><td>85.04%</td><td>92.6%</td></tr><tr><td>0.01</td><td>75.47%</td><td>91.3%</td></tr><tr><td>0.03</td><td>61.16%</td><td>93.5%</td></tr><tr><td>0.1</td><td>57.63%</td><td>94.5%</td></tr><tr><td>1.0</td><td>52.75%</td><td>86.1%</td></tr><tr><td>10</td><td>51.89%</td><td>85.2%</td></tr><tr><td>fastText</td><td>1</td><td>97.7%</td></tr></table>
|
| 57 |
+
|
| 58 |
+
As a preliminary study, we gauge the degree of disentanglement of the latent representation. Table 2 shows that the value of the attribute can be well recovered from the latent representation of a Faderlike (Fu et al., 2017) model even when the model is trained adversarially. A classifier fit post-hoc and trained from scratch, parameterized identically to the discriminator(see paragraph on model architecture in Section 3.3 for details), is able to recover attribute information from the ”distengeled” content representation learned via adversarial training. This suggests that disentanglement may not be achieved in practice, even though the discriminator is unable to recover attribute information well during training. We do not assert that disentangled representations are undesirable but simply that it isn’t mandatory in the goal of controllable text rewriting. This is our focus in the following sections.
|
| 59 |
+
|
| 60 |
+
# 3.2 OUR APPROACH
|
| 61 |
+
|
| 62 |
+
Evaluation of controlled text generation can inform the design of a more streamlined approach: generated sentences should (1) be fluent, (2) make use of the specified attribute values, and (3) preserve the rest of the content of the input.
|
| 63 |
+
|
| 64 |
+
Denoising auto-encoding (DAE) $\mathrm { F u }$ et al., 2017) is a natural way to learn a generator that is both fluent and that can reconstruct the input, both the content and the attributes. Moreover, DAE is a weak way to learn about how to change the style, or in other words, it is a way to force the decoder to also leverage the externally provided attribute information. Since the noise applied to the encoder input $x$ may corrupt words conveying the values of the input attribute $y$ , the decoder has to learn to use the additional attribute input values in order to perform a better reconstruction. We use the noise function described in Lample et al. (2017a) that corrupts the input sentence by performing word drops and word order shuffling. We denote by $x _ { c }$ a corrupted version of the sentence $x$ .
|
| 65 |
+
|
| 66 |
+
As discussed in Sec. 3.1, disentanglement is not necessary nor easily achievable, and therefore, we do not seek disentanglement and do not include any adversarial term in the loss. Instead, we consider a more natural constraint which encourages the model to perform well at the task we are ultimately interested in - controlled generation via externally provided attributes. We take an input $( x , y )$ and encode $x$ it into $z$ , but then decode using another set of attribute values, $\tilde { y }$ , yielding the reconstruction $\tilde { x }$ . We now use $\tilde { x }$ as input of the encoder and decode it using the original $y$ to ideally obtain the original $x$ , and we train the model to map $( \tilde { x } , y )$ into $x$ . This technique, called back-translation (BT) (Sennrich et al., 2015a; Lample et al., 2017a; 2018; Artetxe et al., 2018), has a two-fold benefit. Initially when the DAE is not well trained and $\tilde { x }$ has lost most of the content present in $x$ , the only useful information provided to the decoder is the desired attribute $y$ . This encourages the decoder to leverage the provided attributes. Later on during training when DAE is better, BT helps training the sequence-to-sequence for the desired task. Overall, we minimize:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\mathcal { L } = \lambda _ { A E } \sum _ { ( x , y ) \sim \mathcal { D } } - \log p _ { d } \Big ( x | e ( x _ { c } ) , y \Big ) + \lambda _ { B T } \sum _ { ( x , y ) \sim \mathcal { D } , \tilde { y } \sim \mathcal { Y } } - \log p _ { d } \Big ( x | e \Big ( d \big ( e ( x ) , \tilde { y } ) \Big ) , y \Big )
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $p _ { d }$ is the probability distribution over sequences $x$ induced by the decoder, $e ( x _ { c } )$ is the encoder output when fed with a corrupted version $x _ { c }$ of the input $x$ , and $d ( e ( x ) , \tilde { y } )$ is a variation of the input sentence $x$ written with a randomly sampled set of attributes $\tilde { y }$ . In practice, we generate sentences during back-translation by sampling from the multinomial distribution over words defined by the decoder at each time step using a temperature $T$ .
|
| 73 |
+
|
| 74 |
+
# 3.3 IMPLEMENTATION
|
| 75 |
+
|
| 76 |
+
So far, the model is the same as the model used for unsupervised machine translation by Lample et al. (2018), albeit with a different interpretation of its inner workings, no longer based on disentanglement. Instead, the latent representation $z$ can very well be entangled, but we only require the decoder to eventually “overwrite” the original attribute information with the desired attributes. Unfortunately, this system may be limited to swapping a single binary attribute and may not give us enough control on the trade-off between content preservation and change of attributes. To address this limitations, we introduce the following components:
|
| 77 |
+
|
| 78 |
+
Attribute conditioning In order to handle multiple attributes, we separately embed each target attribute value and then average their embeddings. We then feed the averaged embeddings to the decoder as a start-of-sequence symbol.
|
| 79 |
+
|
| 80 |
+
We also tried an approach similar to Michel & Neubig (2018), where the output layer of the decoder uses a different bias for each attribute label. We observed that the learned biases tend to reflect the labels of the attributes they represent. Examples of learned biases can be found in Table 14. However, this approach alone did not work as well as using attribute-specific start symbols, nor did it improve results when combined with them.
|
| 81 |
+
|
| 82 |
+
Latent representation pooling To control the amount of content preservation, we use pooling. The motivating observation is that models that compute one latent vector representation per input word usually perform individual word replacement, while models without attention are much less literal and tend to lose content but have an easier time changing the input sentence with the desired set of attributes. Therefore, we propose to gain finer control by adding a temporal max-pooling layer on top of the encoder, with non-overlapping windows of width $w$ . Setting $w = 1$ results in a standard model with attention, while setting $w$ to the length of the input sequence boils down to a sequence-to-sequence model without attention. Intermediate values of $w$ allow for different tradeoffs between preserving information about the input sentence and making the decoder less prone to copying words one by one.
|
| 83 |
+
|
| 84 |
+
The hyper-parameters of our model are: $\lambda _ { A E }$ and $\lambda _ { B T }$ trading off the denoising auto-encoder term versus the back-translation term (the smaller the $\lambda _ { B T } / \lambda _ { A E }$ ratio the more the content is preserved and the less well the attributes are swapped), the temperature $T$ used to produce unbiased generations (Edunov et al., 2018) and to control the amount of content preservation, and the pooling window size $w$ . We optimize this loss by stochastic gradient descent without back-propagating through the back-translation generation process; back-translated sentences are generated on-the-fly once a new mini-batch arrives.
|
| 85 |
+
|
| 86 |
+
Model Architecture We use an encoder parameterized by a 2-layer bidirectional LSTM and a 2- layer decoder LSTM augmented with an attention mechanism (Bahdanau et al., 2014). Both LSTMs and our word embedding lookup tables, trained from scratch, have 512 hidden units. Another embedding lookup table with 512 hidden units is used to embed each attribute value. The decoder conditions on two different sources of information: 1) attribute embedding information that presented that it as the first token, similar to Lample et al. (2018) and at the softmax output as an attribute conditional bias following Michel & Neubig (2018). When controlling multiple attributes, we average the embeddings and bias vectors that correspond to the different attribute values. 2) The decoder also conditions on a temporally downsampled representation of the encoder via an attention mechanism. The representations are downsampled by temporal max-pooling with a non-overlapping window of size 5. Although our best models do not use adversarial training, in ablations and experiments that study disentanglement, we used a discriminator paramaeterized as 3 layer MLP with 128 hidden units and LeakyReLU acivations.
|
| 87 |
+
|
| 88 |
+
# 4 EXPERIMENTS
|
| 89 |
+
|
| 90 |
+
# 4.1 DATASETS
|
| 91 |
+
|
| 92 |
+
We use data from publicly available Yelp restaurant and Amazon product reviews following previous work in the area (Shen et al., 2017; Li et al., 2018) and build on them in three ways to make the task more challenging and realistic. Firstly, while previous approaches operate at the sentence level by assuming that every sentence of a review carries the same sentiment as the whole of review, we operate at the granularity of entire reviews. The sentiment, gender1 of the author and product/restaurant labels are therefore more reliable. Secondly, we relax constraints enforced in prior works that discard reviews with more than 15 words and only consider the $1 0 \mathrm { k }$ most frequent words. In our case, we consider full reviews with up to 100 words, and we consider byte-pair encodings (BPE) Sennrich et al. (2015b) with $6 0 \mathrm { k }$ BPE codes, eliminating the presence of unknown words. Finally, we leverage available meta-data about restaurant and product categories to collect annotations for two additional controllable factors: the gender of the review author and the category of the product or restaurant being reviewed. A small overview of the corresponding datasets is presented below with some statistics presented in Table 3. Following Li et al. (2018), we also collect human reference edits for sentiment and restaurant/product categories to serve as a reference for automatic metrics as well as an upper bound on human evaluations (examples in Appendix Table 12).
|
| 93 |
+
|
| 94 |
+
Yelp Reviews This dataset consists of restaurant and business reviews provided by the Yelp Dataset Challenge2. We pre-process this data to remove reviews that are either 1) not written in English according to a fastText (Joulin et al., 2016) classifier, 2) not about restaurants, 3) rated 3/5 stars as they tend to be neutral in sentiment (following Shen et al. (2017)), or 4) where the gender is not identifiable by the same method as in Reddy & Knight (2016); Prabhumoye et al. (2018). We then binarize both sentiment and gender labels. Five coarse-grained restaurant category labels, Asian, American, Mexican, Bars & Dessert, are obtained from the associated meta-data. Since a review can be written about a restaurant that has multiple categories (ex: an Asian restaurant that serves desserts), we train a multi-label fastText classifier to the original data that has multiple labels per example. We then re-label the entire dataset with this classifier to pick the most likely category to be able to model the category factor as a categorical random variable. (See Appendix section A.2 for more details.) Since there now exists two variants of the Yelp dataset, we refer to the one used by previous work (Shen et al., 2017; Fu et al., 2017; Li et al., 2018) as SYelp and our created version with full reviews along with gender and category information as FYelp henceforth.
|
| 95 |
+
|
| 96 |
+
Amazon Reviews The amazon product review dataset (He & McAuley, 2016) is comprised of reviews written by consumers of Amazon products. We followed the same pre-processing steps as in the Yelp dataset with the exception of collecting gender labels, since a very large fraction of amazon usernames were not present in a list of gender-annotated names. We labeled reviews with the following product categories based on the meta-data: Books, Clothing, Electronics, Movies, Music. We followed the same protocol as in $F Y e l p$ to re-label product categories. In this work, we do not experiment with the version of the Amazon dataset used by previous work, and so we refer to our created version with full reviews along with product category information as just Amazon henceforth. Statistics about the dataset can be found in Table 3.
|
| 97 |
+
|
| 98 |
+
Public social media content We also used an unreleased dataset of public social media content written by English speakers to illustrate the approach with examples from a more diverse set of categories3. We used 3 independent pieces of available information about that content: 1) gender (male or female) 2) age group (18-24 or $6 5 +$ ), and 3) writer-annotated feeling (relaxed or annoyed).
|
| 99 |
+
|
| 100 |
+
<table><tr><td></td><td colspan="2">Sentiment</td><td colspan="2">Gender</td><td colspan="5">Category</td></tr><tr><td>SYelp</td><td>Positive 266,041</td><td>Negative 177,218</td><td>Male -</td><td>Female -</td><td>American =</td><td>Asian -</td><td>Bar -</td><td>Dessert -</td><td>Mexican =</td></tr><tr><td>FYelp</td><td>Positive 2.056,132</td><td>Negative 639,272</td><td>Male 1,218,068</td><td>Female 1,477,336</td><td>American 904,026</td><td>Asian 518,370</td><td>Bar 595,681</td><td>Dessert 431,225</td><td>Mexican 246,102</td></tr><tr><td>Amazon</td><td>Positive 64,251,073</td><td>Negative 10,944,310</td><td>=</td><td>·</td><td>Book 26,208,872</td><td>Clothing 14,192,554</td><td>Electronics 25,894,877</td><td>Movies 4,324,913</td><td>Music 4,574,167</td></tr><tr><td>Social Media Content</td><td>Relaxed 7,682.688</td><td>Annoyed 17,823,468</td><td>Male</td><td>= Female 18,463,789</td><td>18-24 12,628,250</td><td>65+ 7,629,505</td><td></td><td></td><td></td></tr></table>
|
| 101 |
+
|
| 102 |
+
Table 3: The number of reviews for each attribute for different datasets. The SYelp, FYelp and the Amazon datasets are composed of $4 4 3 \mathrm { k \Omega }$ , 2.7M and $7 5 . 2 \mathbf { M }$ sentences respectively. Public social media content is collected from 3 different data sources with 25.5M, 33.0M and $2 0 . 2 \mathbf { M }$ sentences for the Feeling, Gender and $A g e$ attributes respectively.
|
| 103 |
+
|
| 104 |
+
To make the data less noisy, we trained a fastText classifier (Joulin et al., 2016) for each attribute and only kept the data above a certain confidence threshold.
|
| 105 |
+
|
| 106 |
+
# 4.2 EVALUATION
|
| 107 |
+
|
| 108 |
+
Automatic evaluation of generative models of text is still an open research problem. In this work, we use a combination of multiple automatic evaluation criteria informed by our desiderata. We would like our systems to simultaneously 1) produce sentences that conform to the set of pre-specified attribute(s), 2) preserve the structure and content of the input, and 3) generate fluent language. We therefore evaluate samples from different models along three different dimensions:
|
| 109 |
+
|
| 110 |
+
• Attribute control: We measure the extent to which attributes are controlled using fastText classifiers, trained on our datasets, to predict different attributes.
|
| 111 |
+
• Fluency: Fluency is measured by the perplexity assigned to generated text sequences by a pre-trained Kneser–Ney smooth 5-gram language model using KenLM (Heafield, 2011).
|
| 112 |
+
• Content preservation: We measure the extent to which a model preserves the content present of a given input using n-gram statistics, by measuring the BLEU score between generated text and the input itself, which we refer to as self-BLEU. When a human reference is provided instead, we compute the BLEU score with respect to it, instead of the input, which we will refer to as just BLEU (Papineni et al., 2002). “BLEU” scores in this paper correspond to the BLEU score with respect to human references averaged across generations conditioned on all possible attribute values except for that of the input. However, when reporting self-BLEU scores, we also average across cases where generations are also conditioned on the same attribute value as the input.
|
| 113 |
+
|
| 114 |
+
A combination of these metrics, however, only provides a rough understanding of the quality of a particular model. Ultimately, we rely on human evaluations collected via a public crowd-sourcing platform. We carried out two types of evaluations to compare different models. 1) Following a protocol similar to Li et al. (2018), we ask crowd workers to annotate generated sentences along the three dimensions above. Fluency and content preservation are measured on a likert-scale from 1 to 5 and attribute control is evaluated by asking the worker to predict the attribute present in the generated text. 2) We take a pair of generations from two different models, and ask workers to pick the generation they prefer on the overall task, accounting for all the dimensions simultaneously. They are also presented with a “no preference” option to discard equally good or bad generations from both models.
|
| 115 |
+
|
| 116 |
+
# 4.3 MODEL SELECTION
|
| 117 |
+
|
| 118 |
+
Since our automatic evaluation metrics are only weak proxies for the quality of a model, we set minimum thresholds on the content preservation and attribute control criteria and only consider models above a certain threshold.
|
| 119 |
+
|
| 120 |
+
The few models that met the specified threshold on the validation set were evaluated by humans on the same validation set and the best model was selected to be run on the test set.
|
| 121 |
+
|
| 122 |
+
Table 4: Automatic evaluation of models on the $S Y e l p$ test set from Li et al. (2018). The test set is composed of sentences that have been manually written by humans, which we use to compute the BLEU score. Samples for previous models were made available by Li et al. (2018). For our model, we report different results corresponding to different choices of hyper-parameters (pooling kernel width and back-translation temperature) to demonstrate our model’s ability to control the trade-off between attribute transfer and content preservation.
|
| 123 |
+
|
| 124 |
+
<table><tr><td>Model</td><td>Accuracy</td><td>BLEU</td><td>PPL</td></tr><tr><td>Fader/StyleEmbedding (Fu et al., 2017) MultiDecoder (Fu et al., 2017) ControllableText (Hu et al., 2017)</td><td>18% 52% 85%</td><td>16.7 11.3 20.6</td><td>56.1 90.1 232.0</td></tr><tr><td>CAE (Shen et al., 2017) Retrieval (Li et al., 2018) Rule-based (Li et al., 2018)</td><td>72% 81% 73%</td><td>6.8 1.3</td><td>53.0 7.4</td></tr><tr><td>DeleteOnly (Li et al., 2018) DeleteAndRetrieve (Li et al., 2018)</td><td>77%</td><td>22.3 14.5</td><td>118.7 67.1</td></tr><tr><td></td><td>79%</td><td>16.0</td><td>66.6</td></tr><tr><td>Fader(Ours w/o backtranslation & attention)</td><td>71%</td><td></td><td></td></tr><tr><td>Ours Ours</td><td>87% 85%</td><td>15.7 14.6</td><td>35.1 26.2</td></tr></table>
|
| 125 |
+
|
| 126 |
+
# 4.4 COMPARISONS TO PRIOR WORK
|
| 127 |
+
|
| 128 |
+
Our first set of experiments aims at comparing our approach with different models recently proposed, on the SYelp dataset. Results using automatic metrics are presented in Table 4. We compare the same set of models as in Li et al. (2018) with the addition of our model and our own implementation of the Fader network (Lample et al., 2017b), which corresponds to our model without back-translation and without attention mechanism, but uses domain adversarial training (Ganin et al., 2016) to remove information about sentiment from the encoder’s representation. This is also similar to the StyleEmbedding model presented by Fu et al. (2017). For our approach, we were able to control the trade-off between BLEU and accuracy based on different hyper-parameter choices. We demonstrate that our approach is able to outperform all previous approaches on the three desired criteria simultaneously, while our implementation of the fader is competitive with the previous best work.
|
| 129 |
+
|
| 130 |
+
Table 5: Top: Results from human evaluation to evaluate the fluency / content preservation and successful sentiment control on the Li et al. (2018) SYelp test set. The mean and standard deviation of Fluency and Content are measured on a likert scale from 1-5 while sentiment is measured by fraction of times that the controlled sentiment of model matches the judge’s evaluation of the sentiment (when also presented with a neutral option). Bottom: Results from human A/B testing of different pairs of models. Each cell indicates the fraction of times that a judge preferred one of the models or neither of them on the overall task.)
|
| 131 |
+
|
| 132 |
+
<table><tr><td></td><td>Fluency</td><td>Content</td><td>Sentiment</td></tr><tr><td>DAR (Li et al. (2018))</td><td>3.33 (1.39)</td><td>3.16 (1.43)</td><td>64.05%</td></tr><tr><td>Ours</td><td>4.07 (1.12)</td><td>3.67 (1.41)</td><td>69.66%</td></tr><tr><td>Human (Li et al. (2018))</td><td>4.56 (0.78)</td><td>4.01 (1.25)</td><td>81.35%</td></tr><tr><td></td><td>Our Model</td><td>No Preference</td><td>DAR</td></tr><tr><td>DAR vs Our Fader</td><td>37.6%</td><td>32.7%</td><td>29.7%</td></tr><tr><td>DAR vs Ours</td><td>54.4%</td><td>24.7%</td><td>20.8%</td></tr></table>
|
| 133 |
+
|
| 134 |
+
Since our automatic evaluation metrics are not ideal, we carried out human evaluations using the protocol described in Section 4.2. Table 5 (top) shows the fluency, content preservation and attribute control (sentiment) scores obtained by our model, DeleteAndRetrieve (DAR) and turkers from Li et al. (2018) 4 on the SYelp dataset. While humans clearly outperform both models, our model is better than DeleteAndRetrieve on all 3 dimensions. We further demonstrate our model’s strength over DeleteAndRetrieve in Table 5 (bottom) in an $\mathrm { A } / \mathrm { B }$ test between two the models, where crowd workers prefer our model $5 4 . 4 \%$ compared to theirs $2 0 . 8 \%$ . Interestingly, our baseline Fader model is also able to do better $( 3 7 . 6 \%$ vs $2 9 . 7 \%$ ), suggesting limitations in our automatic metrics, since Fader does not do as well in Table 4.
|
| 135 |
+
|
| 136 |
+
4.5 EVALUATING MULTIPLE ATTRIBUTE CONTROL
|
| 137 |
+
|
| 138 |
+
<table><tr><td rowspan="2">Dataset (Model)</td><td rowspan="2">Attributes</td><td colspan="2">Sentiment</td><td colspan="2">Category</td><td colspan="2">Gender</td></tr><tr><td>Accuracy</td><td>self-BLEU</td><td>Accuracy</td><td>self-BLEU</td><td>Accuracy</td><td>self-BLEU</td></tr><tr><td>Yelp (DAR)</td><td>Sentiment</td><td>78.7%</td><td>42.1</td><td>-</td><td>-</td><td>1</td><td>-</td></tr><tr><td rowspan="3">Yelp (Our Fader)</td><td>Sentiment</td><td>85.5%</td><td>31.3</td><td>=</td><td>=</td><td></td><td></td></tr><tr><td>Sentiment+ Category</td><td>85.1%</td><td>20.6</td><td>46.1%</td><td>22.6</td><td>-</td><td>-</td></tr><tr><td>Sentiment + Category +Gender</td><td>86.6%</td><td>20.4</td><td>47.7%</td><td>22.5</td><td>58.5%</td><td>23.3</td></tr><tr><td rowspan="4">Yelp (Ours)</td><td>Sentiment</td><td>87.4%</td><td>54.5</td><td>-</td><td>1</td><td>1</td><td>-</td></tr><tr><td>Sentiment + Category</td><td>87.1%</td><td>38.8</td><td>64.9%</td><td>44.0</td><td>1</td><td>-</td></tr><tr><td>Sentiment +Category +Gender</td><td>88.5%</td><td>31.6</td><td>64.1%</td><td>36.5</td><td>59.0%</td><td>37.4</td></tr><tr><td>Gender</td><td>-</td><td>1</td><td>-</td><td>1</td><td>59.1%</td><td>47.0</td></tr><tr><td rowspan="2">Amazon (Ours)</td><td>Sentiment</td><td>82.6%</td><td>54.8</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>Sentiment + Category</td><td>82.5%</td><td>48.9</td><td>81.4%</td><td>41.8</td><td>-</td><td>-</td></tr><tr><td>Input Copy</td><td>1</td><td>50.0%</td><td>100.0</td><td>20.0%</td><td>100.0</td><td>50.0%</td><td>100.0</td></tr></table>
|
| 139 |
+
|
| 140 |
+
Table 6: Results using automatic evaluation metrics on the FYelp and Amazon test sets. Different rows correspond to the set of attributes being controlled by the model.
|
| 141 |
+
|
| 142 |
+
Table 6 presents the quantitative results obtained by the $F Y e l p$ and Amazon datasets when controlling single and multiple attributes. For this table, unlike for Table 4, the DeleteAndRetrieve (DAR) results were obtained by re-training the model of Li et al. (2018). We use our implementation of the Fader model since we found it to be better than previous work, by human evaluation (Table 5). While we control all attributes simultaneously during training, at test time, for the sake of quantitative evaluations, we change the values only of a single attribute while keeping the others constant. Our model clearly outperforms the baseline Fader model. We also demonstrate that our model does not suffer significant drops in performance when controlling multiple attributes over a single one.
|
| 143 |
+
|
| 144 |
+
Demonstrations of our model’s ability to control single and multiple attributes are presented in Table 8 and Table 9 respectively. What is interesting to observe is that our model does not just alter single words in the input to control an attribute, but often changes larger fragments to maintain grammaticality and fluency. Examples of re-writes by our model on social media content in Table 1 show that our model tends to retain the overall structure of input sentences, including punctuation and emojis. Additional examples of re-writes can be found in Table 10 and Table 11 in Appendix.
|
| 145 |
+
|
| 146 |
+
# 4.6 ABLATION STUDY
|
| 147 |
+
|
| 148 |
+
Table 7: Model ablations on 5 model components on the FYelp dataset (Left) and SYelp (Right).
|
| 149 |
+
|
| 150 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Test (FYelp)</td><td colspan="2">Test (Li et al., 2018)</td></tr><tr><td>Accuracy</td><td>self-BLEU</td><td>Accuracy</td><td>BLEU</td></tr><tr><td>Our model</td><td>87%</td><td>54.5</td><td>80%</td><td>25.8</td></tr><tr><td>-pooling</td><td>89%</td><td>47.9</td><td>-</td><td>=</td></tr><tr><td>-temperature</td><td>86%</td><td>45.2</td><td>80%</td><td>21.3</td></tr><tr><td>-attention</td><td>93%</td><td>25.4</td><td>80%</td><td>22.1</td></tr><tr><td>-back-translation</td><td>86%</td><td>32.8</td><td>69%</td><td>16.4</td></tr><tr><td>+adversarial</td><td>86%</td><td>45.5</td><td>78%</td><td>25.1</td></tr><tr><td>-attention -back-translation</td><td>90%</td><td>26.0</td><td>71%</td><td>15.7</td></tr></table>
|
| 151 |
+
|
| 152 |
+
In Table 7, we report results from an ablation study on the SYelp and FYelp datasets to understand the impact of the different model components on overall performance. The different components are: 1) pooling, 2) temperature based multinomial sampling when back-translating, 3) attention, 4) back-translation, 5) the use of domain adversarial training and 6) attention and back-translation in conjunction. We find that a model with all of these components, except for domain adversarial training, performs the best, further validating our hypothesis in Section 3.1 that it is possible to control attributes of text without disentangled representations. The absence of pooling or softmax temperature when back-translating also has a small negative impact on performance, while the attention and back-translation have much bigger impacts.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 1: Accuracy and self-BLEU curves on the FYelp dataset for different pooling operator configurations. Without pooling, the model tends to converge to a copy mode very quickly, with a high self-BLEU score and a poor accuracy. The pooling operator alleviates this behaviour and provides models with a different trade-off accuracy / content preservation.
|
| 156 |
+
|
| 157 |
+
Table 13 shows examples of reviews re-written by different models at different checkpoints, showing the trade-off between properly modifying the attribute and preserving the original content. Figure 1 shows how the trade-off between content preservation (self-BLEU) and attribute control (accuracy) evolves over the course of training and as a function of the pooling kernel width.
|
| 158 |
+
|
| 159 |
+
# 5 CONCLUSION
|
| 160 |
+
|
| 161 |
+
We present a model that is capable of re-writing sentences conditioned on given attributes, that is not based on a disentanglement criterion as often used in the literature. We demonstrate our model’s ability to generalize to a realistic setting of restaurant/product reviews consisting of several sentences per review. We also present model components that allow fine-grained control over the trade-off between attribute control versus preserving the content in the input. Experiments with automatic and human-based metrics show that our model significantly outperforms the current state of the art not only on existing datasets, but also on the large-scale datasets we created. The source code and benchmarks will be made available to the research community after the reviewing process.
|
| 162 |
+
|
| 163 |
+
# REFERENCES
|
| 164 |
+
|
| 165 |
+
Mikel Artetxe, Gorka Labaka, Eneko Agirre, and Kyunghyun Cho. Unsupervised neural machine translation. In International Conference on Learning Representations (ICLR), 2018.
|
| 166 |
+
|
| 167 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 168 |
+
|
| 169 |
+
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 Advances in Neural Information Processing Systems, pp. 4349–4357, 2016.
|
| 170 |
+
|
| 171 |
+
Keith Carlson, Allen Riddell, and Daniel Rockmore. Zero-shot style transfer in text using recurrent neural networks. arXiv preprint arXiv:1711.04731, 2017.
|
| 172 |
+
|
| 173 |
+
Mickael Chen, Ludovic Denoyer, and Thierry Arti ¨ eres. Multi-view data generation without view \` supervision. In ICLR 2018, 2017.
|
| 174 |
+
|
| 175 |
+
Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In Advances in neural information processing systems, pp. 2172–2180, 2016.
|
| 176 |
+
|
| 177 |
+
Alexis Conneau, Guillaume Lample, Marc’Aurelio Ranzato, Ludovic Denoyer, and Herve J ´ egou.´ Word translation without parallel data. arXiv preprint arXiv:1710.04087, 2017.
|
| 178 |
+
|
| 179 |
+
Cicero Nogueira dos Santos, Igor Melnyk, and Inkit Padhi. Fighting offensive language on social media with unsupervised text style transfer. arXiv preprint arXiv:1805.07685, 2018.
|
| 180 |
+
|
| 181 |
+
Sergey Edunov, Myle Ott, Michael Auli, and David Grangier. Understanding back-translation at scale. arXiv preprint arXiv:1808.09381, 2018.
|
| 182 |
+
|
| 183 |
+
Jessica Ficler and Yoav Goldberg. Controlling linguistic style aspects in neural language generation. arXiv preprint arXiv:1707.02633, 2017.
|
| 184 |
+
|
| 185 |
+
Zhenxin Fu, Xiaoye Tan, Nanyun Peng, Dongyan Zhao, and Rui Yan. Style transfer in text: Exploration and evaluation. arXiv preprint arXiv:1711.06861, 2017.
|
| 186 |
+
|
| 187 |
+
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, Franc¸ois Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 17(1):2096–2030, 2016.
|
| 188 |
+
|
| 189 |
+
Di He, Yingce Xia, Tao Qin, Liwei Wang, Nenghai Yu, Tieyan Liu, and Wei-Ying Ma. Dual learning for machine translation. In Advances in Neural Information Processing Systems, pp. 820–828, 2016.
|
| 190 |
+
|
| 191 |
+
Ruining He and Julian McAuley. Ups and downs: Modeling the visual evolution of fashion trends with one-class collaborative filtering. In proceedings of the 25th international conference on world wide web, pp. 507–517. International World Wide Web Conferences Steering Committee, 2016.
|
| 192 |
+
|
| 193 |
+
Kenneth Heafield. Kenlm: Faster and smaller language model queries. In Proceedings of the Sixth Workshop on Statistical Machine Translation, pp. 187–197. Association for Computational Linguistics, 2011.
|
| 194 |
+
|
| 195 |
+
Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. In International Conference on Learning Representations (ICLR), 2017.
|
| 196 |
+
|
| 197 |
+
Geoffrey E Hinton, Alex Krizhevsky, and Sida D Wang. Transforming auto-encoders. In International Conference on Artificial Neural Networks, pp. 44–51. Springer, 2011.
|
| 198 |
+
|
| 199 |
+
Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P Xing. Toward controlled generation of text. arXiv preprint arXiv:1703.00955, 2017.
|
| 200 |
+
|
| 201 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. CVPR, 2017.
|
| 202 |
+
|
| 203 |
+
Vineet John, Lili Mou, Hareesh Bahuleyan, and Olga Vechtomova. Disentangled representation learning for non-parallel text style transfer. arXiv preprint arXiv:1808.04339, 2018.
|
| 204 |
+
|
| 205 |
+
Armand Joulin, Edouard Grave, Piotr Bojanowski, and Tomas Mikolov. Bag of tricks for efficient text classification. arXiv preprint arXiv:1607.01759, 2016.
|
| 206 |
+
|
| 207 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 208 |
+
|
| 209 |
+
Philipp Koehn, Hieu Hoang, Alexandra Birch, Chris Callison-Burch, Marcello Federico, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, Richard Zens, Ondrej Bojar Chris Dyer, Alexandra Constantin, and Evan Herbst. Moses: Open source toolkit for statistical machine translation. In Annual Meeting of the Association for Computational Linguistics (ACL), demo session, 2007.
|
| 210 |
+
|
| 211 |
+
Tejas D Kulkarni, William F Whitney, Pushmeet Kohli, and Josh Tenenbaum. Deep convolutional inverse graphics network. In Advances in neural information processing systems, pp. 2539–2547, 2015.
|
| 212 |
+
|
| 213 |
+
Guillaume Lample, Ludovic Denoyer, and Marc’Aurelio Ranzato. Unsupervised machine translation using monolingual corpora only. arXiv preprint arXiv:1711.00043, 2017a.
|
| 214 |
+
|
| 215 |
+
Guillaume Lample, Neil Zeghidour, Nicolas Usunier, Antoine Bordes, Ludovic Denoyer, et al. Fader networks: Manipulating images by sliding attributes. In Advances in Neural Information Processing Systems, pp. 5967–5976, 2017b.
|
| 216 |
+
|
| 217 |
+
Guillaume Lample, Myle Ott, Alexis Conneau, Ludovic Denoyer, and Marc’Aurelio Ranzato. Phrase-based & neural unsupervised machine translation. arXiv preprint arXiv:1804.07755, 2018.
|
| 218 |
+
|
| 219 |
+
Juncen Li, Robin Jia, He He, and Percy Liang. Delete, retrieve, generate: A simple approach to sentiment and style transfer. arXiv preprint arXiv:1804.06437, 2018.
|
| 220 |
+
|
| 221 |
+
Ming-Yu Liu and Oncel Tuzel. Coupled generative adversarial networks. In Advances in neural information processing systems, pp. 469–477, 2016.
|
| 222 |
+
|
| 223 |
+
Paul Michel and Graham Neubig. Extreme adaptation for personalized neural machine translation. arXiv preprint arXiv:1805.01817, 2018.
|
| 224 |
+
|
| 225 |
+
Alexander H Miller, Will Feng, Adam Fisch, Jiasen Lu, Dhruv Batra, Antoine Bordes, Devi Parikh, and Jason Weston. Parlai: A dialog research software platform. arXiv preprint arXiv:1705.06476, 2017.
|
| 226 |
+
|
| 227 |
+
Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014.
|
| 228 |
+
|
| 229 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, pp. 311–318. Association for Computational Linguistics, 2002.
|
| 230 |
+
|
| 231 |
+
Shrimai Prabhumoye, Yulia Tsvetkov, Ruslan Salakhutdinov, and Alan W Black. Style transfer through back-translation. arXiv preprint arXiv:1804.09000, 2018.
|
| 232 |
+
|
| 233 |
+
Sravana Reddy and Kevin Knight. Obfuscating gender in social media writing. In Proceedings of the First Workshop on NLP and Computational Social Science, pp. 17–26, 2016.
|
| 234 |
+
|
| 235 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Improving neural machine translation models with monolingual data. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, pp. 86–96, 2015a.
|
| 236 |
+
|
| 237 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, pp. 1715–1725, 2015b.
|
| 238 |
+
|
| 239 |
+
Tianxiao Shen, Tao Lei, Regina Barzilay, and Tommi Jaakkola. Style transfer from non-parallel text by cross-alignment. In Advances in Neural Information Processing Systems, pp. 6830–6841, 2017.
|
| 240 |
+
|
| 241 |
+
Kihyuk Sohn, Honglak Lee, and Xinchen Yan. Learning structured output representation using deep conditional generative models. In Advances in Neural Information Processing Systems, pp. 3483–3491, 2015.
|
| 242 |
+
|
| 243 |
+
Yaniv Taigman, Adam Polyak, and Lior Wolf. Unsupervised cross-domain image generation. arXiv preprint arXiv:1611.02200, 2016.
|
| 244 |
+
|
| 245 |
+
Jingjing Xu, Xu Sun, Qi Zeng, Xuancheng Ren, Xiaodong Zhang, Houfeng Wang, and Wenjie Li. Unpaired sentiment-to-sentiment translation: A cycled reinforcement learning approach. arXiv preprint arXiv:1805.05181, 2018.
|
| 246 |
+
|
| 247 |
+
Jimei Yang, Scott E Reed, Ming-Hsuan Yang, and Honglak Lee. Weakly-supervised disentangling with recurrent transformations for 3d view synthesis. In Advances in Neural Information Processing Systems, pp. 1099–1107, 2015.
|
| 248 |
+
|
| 249 |
+
Zichao Yang, Zhiting Hu, Chris Dyer, Eric P Xing, and Taylor Berg-Kirkpatrick. Unsupervised text style transfer using language models as discriminators. arXiv preprint arXiv:1805.11749, 2018.
|
| 250 |
+
|
| 251 |
+
Ye Zhang, Nan Ding, and Radu Soricut. Shaped: Shared-private encoder-decoder for text style adaptation. arXiv preprint arXiv:1804.04093, 2018a.
|
| 252 |
+
|
| 253 |
+
Zhirui Zhang, Shuo Ren, Shujie Liu, Jianyong Wang, Peng Chen, Mu Li, Ming Zhou, and Enhong Chen. Style transfer as unsupervised machine translation. arXiv preprint arXiv:1808.07894, 2018b.
|
| 254 |
+
|
| 255 |
+
Zhirui Zhang, Shuo Ren, Shujie Liu, Jianyong Wang, Peng Chen, Mu Li, Ming Zhou, and Enhong Chen. Style transfer as unsupervised machine translation. arXiv preprint arXiv:1808.07894, 2018c.
|
| 256 |
+
|
| 257 |
+
Yanpeng Zhao, Wei Bi, Deng Cai, Xiaojiang Liu, Kewei Tu, and Shuming Shi. Language style transfer from sentences with arbitrary unknown styles. arXiv preprint arXiv:1808.04071, 2018.
|
| 258 |
+
|
| 259 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. arXiv preprint, 2017.
|
| 260 |
+
|
| 261 |
+
# A SUPPLEMENTARY MATERIAL
|
| 262 |
+
|
| 263 |
+
# A.1 TRAINING DETAILS
|
| 264 |
+
|
| 265 |
+
We used the Adam optimizer (Kingma & Ba, 2014) with a learning rate of $1 0 ^ { - 4 }$ , $\beta _ { 1 } = 0 . 5$ , and a batch size of 32. As in Lample et al. (2018), we fix $\lambda _ { B T } = 1$ , and set $\lambda _ { A E }$ to 1 at the beginning of the experiment, and linearly decrease it to 0 over the first 300, 000 iterations. We use greedy decoding at inference. When generating pseudo-parallel data via back-translation, we found that increasing the temperature over the course of training from greedy generation to multinomial sampling with a temperature of 0.5 linearly over 300,000 steps was useful (Edunov et al., 2018). Since the class distribution for different attributes in both the Yelp and Amazon datasets are skewed, we train with balanced minibatches when there is only a single attribute being controlled and with independent and uniformly sampled attribute values otherwise. The synthetic target attributes during back-translation $\tilde { y }$ are also balanced by uniform sampling.
|
| 266 |
+
|
| 267 |
+
# A.2 DATASET CREATION DETAILS
|
| 268 |
+
|
| 269 |
+
In addition to the details presented in Section 4.1, we present additional details on the creation of the $F Y e l p$ and Amazon datasets.
|
| 270 |
+
|
| 271 |
+
FYelp: Reviews, their rating, user information and restaurant/business categories are obtained from the available metadata. We construct sentiment labels by grouping 1/2 star ratings into the negative category and 4/5 into the positive category while discarding 3 star reviews. To determine the gender of the person writing a review, we obtain their name from the available user information and then look it up in a list of gendered names5 following Prabhumoye et al. (2018); Reddy & Knight (2016). We discard reviews for which we were unable to obtain gender information with this technique. Restaurant/business category meta-data is available for each review, from which we discard all reviews that were not written about restaurants. Amongst restaurant reviews, we manually group restaurant categories into “parent” categories to cover a significant fraction of the dataset. The grouping is as follows:
|
| 272 |
+
|
| 273 |
+
• Asian - Japanese, Thai, Ramen, Sushi, Sushi Bar, Chinese, Asian Fusion, Vietnamese, Korean, Noodles, Dim Sum, Cantonese, Filipino, Taiwanese
|
| 274 |
+
• American - American (New), American (Traditional), Canadian (New), Southern
|
| 275 |
+
• Mexican/Latin American - New Mexican Cuisine, Mexican, Tacos, Tex-Mex, Tapas Bars, Latin American
|
| 276 |
+
• Bars - Brasseries, Nightlife, Bars, Pubs, Wine Bars, Sports Bars, Beer, Cocktail Bars
|
| 277 |
+
• Desserts - Desserts, Bakeries, Ice Cream & Frozen Yogurt, Juice Bars & Smoothies Donuts, Cupcakes, Chocolatiers & Shops
|
| 278 |
+
|
| 279 |
+
As described in Section 4.1, we train a classifier on these parent categories and relabel the entire dataset using this.
|
| 280 |
+
|
| 281 |
+
Amazon: Reviews, their rating, user information and restaurant/business categories are obtained from the metadata made available by He & McAuley (2016). We construct sentiment labels in the same manner as in FYelp. We did not experiment with gender labels, since we found that Amazon usernames seldom use real names. We group Amazon product categories into “parent categories” manually, similar to FYelp as follows:
|
| 282 |
+
|
| 283 |
+
• Books - Books, Books & Comics, Children’s Books, Literature & Fiction, Comic Books, Kindle eBooks etc.
|
| 284 |
+
• Electronics - Car Electronics, Cell Phones, Electrical & Electronics, Electronics, Electronics & Gadgets, Mobiles, Tablets, Headphones etc.
|
| 285 |
+
• Movies - Movies, Movies & TV, Movies & Video, TV & Film
|
| 286 |
+
• Clothing - Clothing, Shoes & Jewelry, Baby Clothing, Fashion
|
| 287 |
+
|
| 288 |
+
• Music - CDs & Vinyl, Music, Digital Music, Children’s Music, World Music, Electronic Music
|
| 289 |
+
|
| 290 |
+
We relabel reviews with a trained product category classifier similar to $F Y e l p$ .
|
| 291 |
+
|
| 292 |
+
For the FYelp and Amazon datasets, we normalize, lowercase and tokenize reviews using the moses (Koehn et al., 2007) tokenizer. With social media content, we do not lowercase data in order to exploit interesting capitalization patterns inherent in the data, but we still run other pre-processing steps. We use byte-pair encodings (BPE) (Sennrich et al., 2015b) with 60k replacements, on all 3 datasets, to deal with large vocabulary sizes.
|
| 293 |
+
|
| 294 |
+
Human Annotated References Li et al. (2018) released a set of human reference edits when controlling the sentiment of a review, on a test set of 500 examples on the SYelp dataset. We follow suit by collecting a similar dataset of 500 human reference edits, which will be made publicly available, for both sentiment and product categories on the FYelp and Amazon datasets. When collecting such data, we use pre-trained sentiment/category classifiers to interactively guide crowd workers using the ParlAI (Miller et al., 2017) platform, to produce edits with the desired attribute value as well as significant content overlap with the input.
|
| 295 |
+
|
| 296 |
+
# A.3 ADDITIONAL QUALITATIVE EXAMPLES
|
| 297 |
+
|
| 298 |
+
<table><tr><td rowspan=1 colspan=2>Positive ←Negative (Yelp)</td></tr><tr><td rowspan=1 colspan=2>Positive frozen hot chocolate with peanut butter cups = amazing.i'll be back for some food next time!Negative frozen hot chocolate with peanut butter ? horrible.i'll stick with the coffee shop next door!</td></tr><tr><td rowspan=1 colspan=2>Negative one Word: underwhelming.save your money and find the many restaurants in vegas that ofers areal experience.Positive one word: delicious.save room for the best and most authentic indian food in vegas.</td></tr><tr><td rowspan=1 colspan=2>Asian ←Mexican(Yelp)</td></tr><tr><td rowspan=1 colspan=2>Asian best thai food i've ever had in the us.great duck specials on monday.. best yellow curry fried rice..Mexican best mexican food i've ever had in my life.great guacamole on the side..best carnitas tacos i have ever had..</td></tr><tr><td rowspan=1 colspan=2>Mexican awesome carne asada! try the papa verde with steak! it's delicious and the portions are great!Asian awesome orange chicken!try the orange chicken with the spicy sauce! it's delicious and the portions are great!</td></tr><tr><td rowspan=1 colspan=2>MaleFemale (Yelp)</td></tr><tr><td rowspan=2 colspan=2>Male good food.my wife and i always enjoy coming here for dinner.irecommend india garden.Female good food.my husband and i always stop by here for lunch.irecommend the veggie burrito.</td></tr><tr><td rowspan=1 colspan=1>Female</td></tr><tr><td rowspan=1 colspan=1>Female</td><td rowspan=1 colspan=1>Female we are regulars here... me n my husband just gorge on these freaking amazing donuts!! loved itMale we are regulars here...every time we come here she loves the new york style pizza!!!!</td></tr><tr><td rowspan=1 colspan=2>Positive Negative (Amazon)</td></tr><tr><td rowspan=2 colspan=2>Positive ilovethis game.takes patience and strategy,goonlineand look forhints and cheats,they helpalot.great game!!!Negative idon'tlikethis game.ittakesalotoftimetofgureouthowtoplay,anditdoesn't work.iwouldnotrecommendthisgame.</td></tr><tr><td rowspan=1 colspan=1>Negative</td><td rowspan=1 colspan=1>veidor</td></tr><tr><td rowspan=1 colspan=1>Negative</td><td rowspan=1 colspan=1>Negative i did notlike theconflicting historical data.what was realand what was not.iprefer fiction with facts intact.Positive i enjoyed the historical references.what a great read and iloved it.i highly recommend this book.</td></tr><tr><td rowspan=1 colspan=2>Movies ←Books (Amazon)</td></tr><tr><td rowspan=1 colspan=2>Movies very good movie withoutstandingspecial efects irecommend this toallshifilovers.good acting great plotlotsof actionBooks very goodbook withoutstanding characterdevelopmentirecommend this toallthereaders.good jobgreatplottwistsandturns</td></tr><tr><td rowspan=1 colspan=2>Books definitely not a stone barrington book,but a story told that keeps you wanting more.great read!Movies definitely nota film noir,buta story that keeps youon theedge of your seat.great acting and a great story.</td></tr><tr><td rowspan=1 colspan=2>Clothing Electronics (Amazon)</td></tr><tr><td rowspan=1 colspan=2>Clothing gotthis cause it said it would help with tennis elbow and guess what my tennis elbow stillbothering meElectronicsgot this cause it said it would help with windows xp and guess what my windows xp still crashed</td></tr><tr><td rowspan=1 colspan=2>Electronicsi have no choice.this is the only black ink that works with my printer.Clothing i have no choice.this is the only black color that works with my dress.</td></tr></table>
|
| 299 |
+
|
| 300 |
+
Table 8: Example re-writes by our model on the FYelp and Amazon datasets when controlling a single attribute. The first line in every box is the pre-specified input with its attribute on the left, and the subsequent line is our model’s re-write conditioned on a different attribute value.
|
| 301 |
+
|
| 302 |
+
Table 9: Demonstrations of our model’s ability to control multiple attributes simultaneously on the Amazon dataset (top) and FYelp dataset (bottom). The first two columns indicate the combination of attributes that are being controlled, with the first row indicating a pre-specified input
|
| 303 |
+
|
| 304 |
+
<table><tr><td>Sentiment</td><td>Category</td><td>Input/Generations</td></tr><tr><td colspan="3">Amazon</td></tr><tr><td>Positive</td><td>Movies</td><td>exciting new show. john malkovich is superb as always.great supporting cast.hope it survives beyond season1</td></tr><tr><td>Positive</td><td>Books</td><td>exciting new book. john grisham is one of the best. great read. hope he continues to write more.</td></tr><tr><td>Negative</td><td>Books</td><td>nothing new. john grisham is not as good as his first book.not a good read.</td></tr><tr><td>Positive</td><td>Clothing</td><td>awesome new watch.fits perfectly. great price. great quality. hope it lasts for a long time.</td></tr><tr><td>Negative</td><td>Clothing</td><td>horrible. the color is not as pictured. not what i expected. it is not a good quality.</td></tr><tr><td>Positive</td><td>Electronics</td><td>works great. the price is unbeatable. great price. great price. hope it lasts for a long time.</td></tr><tr><td>Negative</td><td>Electronics</td><td>worthless.the picture is not as clear as the picture.not sure why it is not compatible with the samsung galaxy s2.</td></tr><tr><td>Positive</td><td>Movies</td><td>exciting new show. john goodman is great as always.great supporting cast. hope it continues to end.</td></tr><tr><td>Negative</td><td>Movies</td><td>horrible.the acting is terrible.not worth the time. it's not worth the time.</td></tr><tr><td>Positive</td><td>Music</td><td>awesome new album. john mayer is one of the best. great album. hope he continues to release this album.</td></tr><tr><td>Negative</td><td>Music</td><td>horrible. the songs are not as good as the original. not worth the price.</td></tr><tr><td colspan="3">Yelp</td></tr><tr><td>Negative</td><td>Dessert</td><td>the bread here is crummy,half baked and stale even when‘fresh.”i won't be back.</td></tr><tr><td>Positive</td><td>American</td><td>the burgers here are juicy, juicy and full of flavor!i highly recommend this place.</td></tr><tr><td>Negative</td><td>American</td><td>the bread here is stale,dry and over cooked even though the bread is hard.i won'tbe back.</td></tr><tr><td>Positive</td><td>Asian</td><td>the sushi here is fresh,tasty and even better than the last.i highly recommend this place.</td></tr><tr><td>Negative</td><td>Asian</td><td>the noodles here are dry,dry and over cooked even though they are supposed to be“fresh."i won't be back.</td></tr><tr><td>Positive</td><td>Bar</td><td>the pizza here is delicious,thin crust and even better cheese (in my opinion).i highly recommend it.</td></tr><tr><td>Negative</td><td>Bar</td><td>the pizza here is bland,thin crust and even worse than the pizza, so i won't be back.</td></tr><tr><td>Positive</td><td>Dessert Dessert</td><td>the ice cream here is delicious,soft and fluffy with all the toppings you want.i highly recommend it.</td></tr><tr><td>Negative Positive</td><td>Mexican</td><td>the bread here is stale,stale and old when you ask fora“fresh”sandwich.i won'tbe back. the tacos here are delicious,full of flavor and even beter hot sauce.i highly recommend this place.</td></tr><tr><td>Negative</td><td>Mexican</td><td></td></tr><tr><td></td><td></td><td>the beans here are dry,dry and over cooked even though they are supposed to be“fresh.’i won't be back.</td></tr></table>
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Table 10: Examples of our model’s ability to re-write sentences from public social media content when conditioned on information about the feeling expressed by the writer (Relaxed vs Annoyed)
|
| 308 |
+
|
| 309 |
+

|
| 310 |
+
Table 11: Model re-writes of sentences from public social media content when conditioned on the age-group of the writer (18-24 vs $^ { 6 5 + }$ )
|
| 311 |
+
|
| 312 |
+
Table 12: Examples of human edits from our FYelp and Amazon datasets. The first line in every box was the input presented to a crowd worker followed by their corresponding edit with the specified attribute.
|
| 313 |
+
|
| 314 |
+
<table><tr><td colspan="2">Positive ←→Negative(Yelp)</td></tr><tr><td>Positive Negative</td><td>happy to find this hidden gem near my office. great food and best of all, fast delivery. the restaurant near my office was such a dump.late delivery and gross,cold food.</td></tr><tr><td>Negative Positive</td><td>omfg no.iordered baklavaand they nuked itonastyrofoamdishforme.theisides were stillcoldand it tastedlikecancer:/ yes!iordered baklavaand it was the perfecttemperature onafancy plate.the inside was greatand ittasted excellent.</td></tr><tr><td colspan="2">Mexican ←→Asian (Yelp)</td></tr><tr><td>Mexican Asian</td><td>just wful.socalledasadaburrio'wascoldandbland..justalumpofplaincarnitasandsome iceberg lettce inacheaptrtila. reminiscent of taco bell in the 9Os but worse. just awful.socalled spring roll was cold and bland..jumpa lumpof meat and vegetables inan egg noodle wrapper. reminded me of frozen chinese food but worse.</td></tr><tr><td>Asian American(Yelp)</td><td></td></tr><tr><td colspan="2">Asian my newfavoritecuryhousedefinitelycomingback.chickenkatsuandtakoyakiissooogood!cant wait totrythepork katsu. American my new favorite american bistro house! we are definitely coming back.fried chicken and waffles is soooo good. cant wait to try the new bbq rib sandwich.</td></tr><tr><td>Mexican →Dessert (Yelp)</td><td></td></tr><tr><td>Mexican Dessert</td><td>tacos were delicious.triedthecarneasad,bqpork,andchorizo.came withonionand cilantro toppingandahouse madechoice of mild or hot salsa. cheesecake was delicious.tried the strawberryflavoredone with chocolate drizzle.came with afresh cherryontopanda house</td></tr><tr><td colspan="2">made choice of iced or hot coffee Positive ←→ Negative (Amazon)</td></tr><tr><td>Negative Positive</td><td>tooscif forme.charactersnotrealistic.situationbsurd.abandondithlfwaytroughunusualforme.implynotmytasteinyteri. ilove how scifithis was the characters arerelatable,and the plot was great.i just had to finish itinone siing, the story got me hooked. this is has to be one of my favorite mysteries.</td></tr><tr><td>Positive Negative</td><td>my mom love this case for heri-pod.she uses it a lot and she is one satisfied customer.she would recommended it. mymominitiallylikedthiscaseforheri-pod.sheuseditforawhileanditbroke.sinceit is notsolid she would notrecommendit.</td></tr><tr><td colspan="2">Clothing ←→Books (Amazon)</td></tr><tr><td>Clothing Books</td><td>nice suit but i wear a size 8 and ordered at 12 and it was just a bit too small. great book butican'treadsmall text with mybad eyesight,unfortunately,thisone happenedtobe printedrathersall.</td></tr><tr><td colspan="2">Books → Clothing(Amazon)</td></tr><tr><td>Books Clothing</td><td>greatbookabouttealitisoftemecandeamellwiteithgeathracterdevelopntiwoudefiitelyecomdisbk. great dress with american flags printed on it.wellmade with great materials.iwoulddefinitely recommend this dress.</td></tr><tr><td colspan="2">Books ←Music (Amazon)</td></tr><tr><td>Books Music</td><td>ilovedthebookancan'twaitoreadthesequelicouldn'tputthebookdownbecause theplotandcharacters weresointeresting. iloved the musicand can not wait for the next album!icouldn’t stop listening because the music was so interesting.</td></tr></table>
|
| 315 |
+
|
| 316 |
+
Table 13: Examples of controlling sentiment with different model checkpoints that exhibit different trade-offs between content preservation (self-BLEU) and attribute control (Accuracy). The first line in both examples is the input sentence, and subsequent lines are a model’s outputs with decreasing content preservation with rows corresponding to model checkpoints at different epochs during training.
|
| 317 |
+
|
| 318 |
+
<table><tr><td>Accuracy</td><td>Self-BLEU</td><td>Input/Swap</td></tr><tr><td></td><td></td><td>not a fan.food is not the best and the service was terrible the two times i have visited.</td></tr><tr><td>78.7%</td><td>73.8</td><td>great little place.food is great and the service was great the two times i have visited.</td></tr><tr><td>83.5%</td><td>51.5</td><td>best food in town.food is great and the service was the best two times i have visited.</td></tr><tr><td>92.8% 96.8%</td><td>27.7 13.1</td><td>best thai food in town.the food is great and the service is excellent as always. best chinese food in town. great service and the food is the besti have had in a long time.</td></tr><tr><td></td><td></td><td>overpriced specialty food.also very crowded.service is slow.would not recommend at any time.</td></tr><tr><td>78.7%</td><td>73.8</td><td>great homemade food.also very crowded.service is fast. would recommend at least once.</td></tr><tr><td>83.5%</td><td>51.5</td><td>great specialty food.also very crowded.service is friendly.would recommend any time at the time.</td></tr><tr><td>92.8%</td><td>27.7</td><td>great variety of food.also very friendly staff.good service.would recommend at least oncea week.</td></tr><tr><td>96.8%</td><td>13.1</td><td>great tasting food.very friendly staff. definitely recommend this place for a quick bite.</td></tr></table>
|
| 319 |
+
|
| 320 |
+
<table><tr><td>Positive</td><td>Negative</td><td>Male</td><td>Female</td><td>American</td><td>Asian</td><td>Bar</td><td>Dessert</td><td>Mexican</td></tr><tr><td>pampered</td><td>dishonest</td><td>ammo</td><td>manicure</td><td>primanti</td><td>guu</td><td>promoter</td><td>patisserie</td><td>tortas</td></tr><tr><td>relaxation</td><td>fraud</td><td>tenant</td><td>pedi</td><td>bobby</td><td>chashu</td><td>bouncers</td><td>froyo</td><td>fundido</td></tr><tr><td>delightfully</td><td>incompetence</td><td>bachelor</td><td>hubs</td><td>flay</td><td>izakaya</td><td>bouncer</td><td>buttercream</td><td>arepas</td></tr><tr><td>complemented</td><td>unethical</td><td>barbers</td><td>bridesmaids</td><td>lux</td><td>tonkotsu</td><td>hakkasan</td><td>dunkin</td><td>burritos</td></tr><tr><td>cutest</td><td>insulted</td><td>wife</td><td>bridal</td><td>nacho</td><td>khao</td><td>postino</td><td>groomers</td><td>tostada</td></tr><tr><td>plush</td><td>audacity</td><td>firestone</td><td>pedicure</td><td>bj</td><td>soju</td><td>bachi</td><td>bakeries</td><td>taquitos</td></tr><tr><td>punctual</td><td>confronted</td><td>provider</td><td>instructors</td><td>gown</td><td>tonkatsu</td><td>brio</td><td>bakery</td><td>nacho</td></tr><tr><td>housemade</td><td>cockroach</td><td>data</td><td>mattresses</td><td>applebee</td><td>banchan</td><td>cabanas</td><td>custard</td><td>fajita</td></tr><tr><td>precision</td><td>crooks</td><td>plumber</td><td>stylist</td><td>burgr</td><td>shabu</td><td>films</td><td>doughnuts</td><td>guac</td></tr><tr><td>masterpiece</td><td>disrespect</td><td>motor</td><td>jacuzzi</td><td>chilis</td><td>teppanyaki</td><td>trader</td><td>pastries</td><td>refried</td></tr><tr><td>restored</td><td>roaches</td><td>contractor</td><td>hubby</td><td>mesa</td><td>gai</td><td>hooters</td><td>gelato</td><td>mexico</td></tr><tr><td>comprehensive</td><td>refunds</td><td>hertz</td><td>pregnancy</td><td>bmw</td><td>kbbq</td><td>karaoke</td><td>cheesecakes</td><td>empanadas</td></tr><tr><td>sublime</td><td>shrugged</td><td>hvac</td><td>bachelorette</td><td>denny</td><td>pho</td><td>irish</td><td>donut</td><td>tapas</td></tr><tr><td>made</td><td>liars</td><td>qualified</td><td>husbands</td><td>mastro</td><td>hotpot</td><td>harry</td><td>croissants</td><td>queso</td></tr><tr><td>tastefully</td><td>rudest</td><td>incompetence</td><td>barre</td><td>cellar</td><td>soi</td><td>darts</td><td>doughnut</td><td>cantina</td></tr><tr><td>treasures</td><td>accused</td><td>transmission</td><td>cutest</td><td>bachi</td><td>karaage</td><td>nightclub</td><td>danish</td><td>salsas</td></tr><tr><td>addicting</td><td>inconsiderate</td><td>summary</td><td>lashes</td><td>rubbed</td><td>omakase</td><td>applebee</td><td>cheesecake</td><td>pollo</td></tr><tr><td>marvelous</td><td>roach</td><td>contractors</td><td>sephora</td><td>flatbread</td><td>saigon</td><td>whiskey</td><td>fritter</td><td>asada</td></tr><tr><td>handsome</td><td>rudely</td><td>automotive</td><td>bf</td><td>skins</td><td>panang</td><td>cereal</td><td>macarons</td><td>barrio</td></tr><tr><td>healing</td><td>cancellation</td><td>audio</td><td>boyfriends</td><td>grille</td><td>cantonese</td><td>perform</td><td>oreos</td><td>barbacoa</td></tr></table>
|
| 321 |
+
|
| 322 |
+
Table 14: Examples of the learned attribute biases for sentiment and restaurant categories on $F Y e l p$
|
md/train/H1lmyRNFvr/H1lmyRNFvr.md
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AUGMENTING GENETIC ALGORITHMS WITH DEEP NEURAL NETWORKS FOR EXPLORING THE CHEMICAL SPACE
|
| 2 |
+
|
| 3 |
+
AkshatKumar Nigam1,†, Pascal Friederich1,2,† Mario Krenn, 1,3,4, Alan Aspuru-Guzik ´ 1,3,4,5, $^ *$
|
| 4 |
+
|
| 5 |
+
1Department of Computer Science, University of Toronto, Canada.
|
| 6 |
+
2Institute of Nanotechnology, Karlsruhe Institute of Technology, Germany.
|
| 7 |
+
3Department of Chemistry, University of Toronto, Canada.
|
| 8 |
+
4Vector Institute for Artificial Intelligence, Toronto, Canada.
|
| 9 |
+
5Canadian Institute for Advanced Research (CIFAR) Senior Fellow, Toronto, Canada
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Challenges in natural sciences can often be phrased as optimization problems. Machine learning techniques have recently been applied to solve such problems. One example in chemistry is the design of tailor-made organic materials and molecules, which requires efficient methods to explore the chemical space. We present a genetic algorithm (GA) that is enhanced with a neural network (DNN) based discriminator model to improve the diversity of generated molecules and at the same time steer the GA. We show that our algorithm outperforms other generative models in optimization tasks. We furthermore present a way to increase interpretability of genetic algorithms, which helped us to derive design principles.
|
| 14 |
+
|
| 15 |
+
Our open source implementation: https://github.com/aspuru-guzik-group/GA
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
The design of optimal structures under constraints is an important problem spanning multiple domains in the physical sciences. Specifically, in chemistry, the design of tailor-made organic materials and molecules requires efficient methods to explore the chemical space. Purely experimental approaches are often time consuming and expensive. Reliable computational tools can accelerate and guide experimental efforts to find new materials faster.
|
| 20 |
+
|
| 21 |
+
We present a genetic algorithm (GA) (Davis, 1991; Devillers, 1996; Sheridan & Kearsley, 1995; Parrill, 1996) for molecular design that is enhanced with two features:
|
| 22 |
+
|
| 23 |
+
1. A neural network based adaptive penalty. This promotes exploratory behaviour of the GA and thus improve the diversity of generated molecules.
|
| 24 |
+
2. Exploiting the robustness of SELFIES (Krenn et al., 2019), we do not need to incorporate any expert based mutation or cross-over rules.
|
| 25 |
+
|
| 26 |
+
Starting from only simple methane molecules, our algorithm outperforms other generative models in optimization tasks for molecular design. By introducing machine learning (ML) techniques, the long term behaviour is not subject to stagnation, thus solving a significant problem in genetic algorithms (Paszkowicz, 2009).
|
| 27 |
+
|
| 28 |
+
No domain knowledge is required; thus, our approach is not limited to chemistry-specific questions but can be applied to a wide range of optimization problems.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORKS
|
| 31 |
+
|
| 32 |
+
Inverse design is the systematic development of structures with desired properties. In chemistry (Sanchez-Lengeling & Aspuru-Guzik, 2018), the challenge of inverse design has been tackled as an optimization problem, among others in the form of variational autoencoders (VAEs), generative adversarial networks (GANs) and genetic algorithms.
|
| 33 |
+
|
| 34 |
+
Variational autoencoders and generative adversarial networks VAEs (Kingma & Welling, 2013) are a widely used method for direct generation of molecular string or graph representations (Gomez- ´ Bombarelli et al., 2018). They encode discrete representations into a continuous (latent) space. Molecules resembling a known structure can be found by searching around the region of the encoded point. Making using of the continuous latent representation, it is possible to search via gradients or Bayesian Optimization (BO). However, the generation of semantically and syntactically valid molecules is a challenging task. Thus, several follow up works to the VAE have been proposed for inverse design in chemistry. Among them, CVAE (Gomez-Bombarelli et al., 2018), GVAE (Kusner ´ et al., 2017) and SD-VAE (Dai et al., 2018) work directly on string molecular representations. Alternatively, JT-VAE (Jin et al., 2018a) as well as CGVAE Liu et al. (2018) work on molecular graphs. Unlike latent space property optimization, the policy network (PN) based GCPN model (You et al., 2018) proposes a reinforcement learning (RL)-based method for direct optimization on molecular graphs. ORGAN (Guimaraes et al., 2017) demonstrate training string-based generative adversarial networks (GANs) (Goodfellow et al., 2014) via RL. Another method based on adversarial training is VJTNN (Jin et al., 2018b). Segler et al. (2017) first introduced molecule generating models based on language models and reinforcement learning, where actions in an environment are taken to construct a molecule, receiving reward from an external scoring function. This model has also shown strong performance in the GuacaMol benchmark (Brown et al. (2019)).
|
| 35 |
+
|
| 36 |
+
In all the approaches mentioned above, generative models are trained to mimic the reference data set distributions, thus limiting the exploration ability of VAEs and GANs.
|
| 37 |
+
|
| 38 |
+
Genetic algorithms & related methods There exist several examples of GA based molecule optimization algorithms in literature (O’Boyle et al., 2011; Virshup et al., 2013; Rupakheti et al., 2015; Jensen, 2019; Sheridan & Kearsley, 1995; Parrill, 1996)). While some of these examples pre-define mutations on a SMILES level to ensure validity of the molecules, other approaches use fragmentbased assembly of molecules. GAs are likely to get trapped in regions of local optima (Paszkowicz, 2009). Thus, for selection of the best molecules, (Rupakheti et al., 2015; Jensen, 2019) report multiple restarts upon stagnation.
|
| 39 |
+
|
| 40 |
+
We include the aforementioned models as baselines for numerical comparison.
|
| 41 |
+
|
| 42 |
+
# 3 GA-D ARCHITECTURE
|
| 43 |
+
|
| 44 |
+
# 3.1 OVERVIEW
|
| 45 |
+
|
| 46 |
+
Our approach is illustrated in Figure 1. Our generator is a genetic algorithm with a population of molecules $m$ . In each generation, the fitness of all molecules is evaluated as a linear combination of molecular properties $J ( m )$ and the discriminator score $D ( m )$ :
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
F ( m ) = J ( m ) + \beta \cdot D ( m ) .
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
Random mutations of high fitness (best performing) molecules replace inferior members, while bestperforming molecules continue to a subsequent generation. The probability of replacing a molecule is evaluated using a smooth logistic function based on a ranking of fitness among the molecules of a generation. At the end of each generation, a neural network based discriminator is trained jointly on molecules generated by the GA and a reference data set. The fitness evaluation accounts for the discriminator predictions for each molecule. Therefore, the discriminator plays a role in the selection of the subsequent population.
|
| 53 |
+
|
| 54 |
+
# 3.2 MUTATION & CROSS-OVER RULES
|
| 55 |
+
|
| 56 |
+
Mutation of molecules to populate subsequent generations is an important element of the GA. A low degree of mutation can lead to a slow exploration of the chemical space, causing stagnation of the fitness function. Robustness of SELFIES allows us to do random mutations to molecular strings while preserving their validity. Thus, our mutations only include $50 \%$ insertions or $50 \%$ replacements of single SELFIES characters. To accelerate the exploration of the GA, we add one domain-specific mutation rule – the direct addition of phenyl groups in approximately $4 \%$ of cases. Character deletion is implicitly taken into account in SELFIES mutations, and we do not use crossover rules.
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 1: Overview of our hybrid structure, which augments genetic algorithms with ML based neural networks.
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
Figure 2: Reducing Fitness of $o$ -terphenyl, initially possessing the largest fitness in generation 5 $( R a n k = O )$ ). Due to decreasing discriminator predictions $D ( m )$ , fitness decreases with an increased probability of getting killed (Kill Prob.). The molecule is completely replaced in generation 16. Rank denotes the position of the molecule in an increasing fitness list of generation molecules.
|
| 63 |
+
|
| 64 |
+
# 3.3 ROLE OF THE DISCRIMINATOR
|
| 65 |
+
|
| 66 |
+
The fundamental role of the discriminator is to increase molecular diversity by removing longsurviving molecules. Consider the realistic scenario in which a GA has found a molecule close to a local optimum, where all mutations are lowering the fitness. As a result, this molecule survives for multiple generations while occupying a large fraction of the population. During such periods, the GA has limited view of the chemical space as it repeatedly explores mutations of the same high-fitness molecule.
|
| 67 |
+
|
| 68 |
+
A straightforward solution would be the addition of a linear penalty (Nanakorn & Meesomklin, 2001) in the fitness function that accounts for the number of successive generations a molecule survives. However, this method assigns independent scores to similar-looking molecules, which again results in less variety.
|
| 69 |
+
|
| 70 |
+
Our solution is the addition of an adaptive penalty (in our case a neural network based discriminator), thus resolving the problem of stagnation. Molecules with similar representation receive similar classification scores. Furthermore, long-surviving molecules are trained longer and receive weaker scores, resulting in decreasing fitness - reducing the chance of long periods of stagnation (illustrated in Figure 2). The task of the discriminator thus is to memorize families of high performing molecules and penalize their fitness to force the GA to explore different regions in chemical space.
|
| 71 |
+
|
| 72 |
+
# 4 EXPERIMENTS
|
| 73 |
+
|
| 74 |
+
Comparing to the literature standard, we aim at maximizing the penalized logP objective $J ( m )$ proposed by (Gomez-Bombarelli et al., 2018). For molecule ´ $m$ , the penalized logP function is defined as
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
J ( m ) = \log \mathrm { P } ( m ) - \mathrm { S A } ( m ) - \mathrm { R i n g } \mathrm { P e n a l t y } ( m ) ,
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where logP indicates the water-octanol partition coefficient, SA (Ertl & Schuffenhauer, 2009) represents the synthetic accessibility and prevents the formation of chemically unfeasible molecules, and RingPenalty linearly penalizes the presence of rings of size larger than 6. Our reference data set consists of 250,000 commercially available molecules extracted from the ZINC database (Irwin et al., 2012). All three quantities in the above equation are normalized based on this data set.
|
| 81 |
+
|
| 82 |
+
Table 1: Comparison of our model with maximum penalized logP scores reported in literature. Models in the upper part are forced to optimize within the distributions of given reference data sets while the GA based approaches in the lower part can freely explore chemical space. Direct comparisons need to take into account these different objectives and scopes. The parameter $\beta$ in our GA can be used to balance exploration and exploitation (see Section 4.6).
|
| 83 |
+
|
| 84 |
+
<table><tr><td>Model</td><td>Max. Penalized logP</td><td>Model</td></tr><tr><td>GVAE + BO (Kusner et al.,2017) 1</td><td>2.87 ± 0.06</td><td>VAE</td></tr><tr><td>SD-VAE (Dai et al., 2018) 1</td><td>3.50 ± 0.44</td><td>VAE</td></tr><tr><td>CVAE + BO (G6mez-Bombarelli et al., 2018) 2</td><td>4.85 ± 0.17</td><td>VAE</td></tr><tr><td>ORGAN (Guimaraes et al., 2017) 1</td><td>3.52 ± 0.08</td><td>GAN</td></tr><tr><td>JT-VAE (Jin et al., 2018a) 1</td><td>4.90 ± 0.33</td><td>VAE</td></tr><tr><td>ChemTS (Yang et al., 2017)</td><td>5.6 ± 0.5</td><td>RNN</td></tr><tr><td>GCPN(You et al., 2018) 1</td><td>7.87 ± 0.07</td><td>PN + GAN</td></tr><tr><td>Random SELFIES</td><td>6.19 ± 0.63</td><td>Random Search</td></tr><tr><td>GB-GA (Jensen, 2019) 3</td><td>7.4±0.9</td><td>GA</td></tr><tr><td>GB-GA (Jensen, 2019) 4</td><td>15.76 ± 5.71</td><td>GA</td></tr><tr><td>GA (here)</td><td>12.61 ± 0.81</td><td>GA</td></tr><tr><td>GA + D (here)</td><td>13.31 ± 0.63</td><td>GA+DNN</td></tr><tr><td>(GA + D(t) (here) 5</td><td>20.72 ± 3.14)</td><td>GA +DNN</td></tr></table>
|
| 85 |
+
|
| 86 |
+
1 average of three best molecules after performing Bayesian optimization on the latent representation of a trained VAE 2 two best molecules of a single run 3 averaged over 10 runs with 20 molecules per generation with a molecular weight (excl. hydrogen) smaller than $3 9 . 1 5 \pm 3 . 5 0 \mathrm { g / m o l }$ run for 50 generations 4 averaged over 10 runs with 500 molecules up to 81 characters per generation and 100 generations averaged over 5 runs with 1000 generations each
|
| 87 |
+
|
| 88 |
+
# 4.1 UNCONSTRAINED OPTIMIZATION AND COMPARISON WITH OTHER GENERATIVE MODELS
|
| 89 |
+
|
| 90 |
+
We define our fitness function according to Eq. 1 and 2 with $\beta = 0$ and 10. The algorithm is run for 100 generations with a population size of 500. All generated molecules are constrained to a canonical smile length of 81 characters (as in (Yang et al., 2017; Jensen, 2019)). We train the discriminator (fully connected neural network with ReLU activation and sigmoid output layer, the input is a vector of chemical and geometrical properties characterizing the molecules) at the end of each generation for 10 epochs on 500 molecules proposed by the GA and 500 randomly drawn molecules from the ZINC data set. We report maximum $J ( m )$ scores, averaged over 10 independent runs. The highest $J ( m )$ achieved by our approach are $1 3 . 3 1 \pm 0 . 6 3$ $\beta = 1 0 $ ) and
|
| 91 |
+
|
| 92 |
+
$1 2 . 6 1 \pm 0 . 8 1$ $\beta = 0 ,$ ), respectively, which is almost twice as high es the highest literature value of $7 . 8 7 { \pm } 0 . 0 7$ (See Table 1). Furthermore, we compare to 50,000 random valid SELFIES strings, which surprisingly outperforms some existing generative models. The GA-D(t) results are explained in the next section.
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
4.2 LONG TERM EXPERIMENT WITH A TIME-DEPENDENT ADAPTIVE PENALTY
|
| 96 |
+
Figure 3: Maximum $J ( m )$ values found for 10 independent runs with no discriminator $\mathcal { B } = 0 ,$ ) and 5 independent runs with the introduction of a time-dependent adaptive penalty. The full line is the average of all runs, the shaded areas are the boundaries of all runs and the dashed lines denote the average of all maximal $J ( m )$ values found at any generation.
|
| 97 |
+
|
| 98 |
+
In Figure 3, we show the results of runs where we use a time-dependent adaptive penalty. During periods of saturation, the weight of the discriminator predictions is switched from 0 to 1000 until stagnation is overcome. The genetic algorithm is hence forced to propose new families of molecules to increase $J ( m )$ . As it can be observed in Figure 3, even after steep decreases in max $J ( m )$ , the scores recover and potentially reach values higher than in previous plateaus. We observe that this approach significantly outperforms all previous methods in maximizing the objective $J ( m )$ .
|
| 99 |
+
|
| 100 |
+
Visual inspection of the highest performing molecules shows that the GA is exploiting deficiencies of the (penalized) logP metric by generating chemically irrelevant motifs such as sulfur chains. While being of limited relevance for application, this nonetheless shows the that the GA is very efficient in exploring the chemical space and finding solutions for a given task. Analysis of these solutions will help us to better understand and eventually improve objective functions. At the same time, surprising solutions found by an unbiased algorithm can lead to unexpected discovery or boost human creativity (Lehman et al. (2018)). While exploitative tasks that follow some reference database are significant for questions involving drug design, more explorative behaviour could be beneficial in domains such as solar cell design (Yan et al. (2018)), flow battery design (Yang et al. (2018)), and in particular for questions where datas sets are not available, such as design of targets in molecular beam interferometry (Fein et al. (2019)).
|
| 101 |
+
|
| 102 |
+
# 4.3 ANALYSIS OF MOLECULE CLASSES EXPLORED BY THE GA
|
| 103 |
+
|
| 104 |
+
Figure 4 shows classes of molecules explored by the GA in a trajectory with 1000 generations and a generation size of 500 (see trajectories in Figure 3). A K-means clustering analysis based in the RDKit fingerprint bit-vectors with 20 clusters was used to automatically generate labels for the 50 best performing molecules (in terms of their properties $J ( m ) )$ in each generation. We find that the algorithm starts with a class of relatively small molecules $\approx 4 0$ generations, see class 10), after which the algorithm explores several different classes of large molecules with e.g. aromatic rings and conjugates carbon chains (see class 15) and long linear sulfur chains (see class 1). Class 1 includes the molecules with the highest $J ( m )$ scores found in this work, exceeding values of 20.
|
| 105 |
+
|
| 106 |
+
The clustering analysis furthermore helps to analyze the large number of generated molecules. This allows us to learn from the data and derive design rules to achieve high target properties. In case of the penalized logP score, we find that representative examples (short distance to the cluster center) of high performing classes contain aromatic rings, conjugated carbon chains and linear sulfur chains, which can act as design rules for molecules with high penalized logP scores. Using these design rules to construct molecules of the maximally allowed length consisting of only sulfur chains, conjugated carbon chains and chains of benzene rings with sulfur bridges yields $J ( m )$ scores of 31.79, 8.58 and 10.02, respectively. The $J ( m )$ score reached by the linear sulfur chain outperforms the best scores found by the GA and other generative models.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 4: Classes of molecules explored by the GA.
|
| 110 |
+
|
| 111 |
+
To visualize the explorative behaviour of the GA, we did a two-dimensional principal component analysis (PCA) of the molecular fingerprint vectors of all molecules generated by the GA-D(t) in the trajectory shown in Figure 4. Five snapshots of the trajectory are shown in Figure 5, colored according to their chemical family. The property score $J ( m )$ of the trajectory is visualized in the images. We find that the GA sequentially explores different parts of the 2D projection of the chemical space, finding different families of high performing molecules, while the discriminator prevents the algorithm from searching in the same space repeatedly.
|
| 112 |
+
|
| 113 |
+
# 4.4 CONSTRAINED OPTIMIZATION
|
| 114 |
+
|
| 115 |
+
In the previous sections, we aimed to maximize the penalized logP objective. Here, we consider two different tasks: firstly, generating molecules of specific chemical interest and secondly, modifying existing molecules to increase penalized logP scores. We used $\beta = 0$ throughout Section 4.4.
|
| 116 |
+
|
| 117 |
+
# 4.4.1 GENERATING MOLECULES WITH SPECIFIC PROPERTIES
|
| 118 |
+
|
| 119 |
+
We run 250 instances of randomly selected sets of target properties (logP in the interval from -5 to 10, SA scores in the range from 1 to 5 and ring penalty for 0 to 3). The fitness function is modified to minimize the summed squared difference between the actual and desired properties. We compute the number of experiments that successfully proposed molecules with a squared difference less than 1.0. Each run is constrained to run for 100 generations with a maximum canonical SMILES length of 81 characters. In $9 0 . 0 \%$ of the cases, our approach proposes the desired molecules.
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 5: Two-dimensional PCA of five time snapshots of the molecular space explored by the GA-D(t).
|
| 123 |
+
|
| 124 |
+
Table 2: Comparison on constrained improvement of penalized logP of specific molecules.
|
| 125 |
+
|
| 126 |
+
<table><tr><td rowspan="2"></td><td colspan="2">δ=0.4</td><td colspan="2">δ=0.6</td></tr><tr><td>Improvement</td><td>Success</td><td>Improvement</td><td> Success</td></tr><tr><td>JT-VAE (Jin et al., 2018a)</td><td>0.84± 1.45</td><td>83.6%</td><td>0.21 ± 0.71</td><td>46.4%</td></tr><tr><td>GCPN (You et al., 2018)</td><td>2.49 ± 1.30</td><td>100.0%</td><td>0.79 ± 0.63</td><td>100.0%</td></tr><tr><td>MMPA (Jin et al., 2018b)</td><td>3.29 ± 1.12</td><td>=</td><td>1.65 ± 1.44</td><td>=</td></tr><tr><td>DEFactor (Assouel et al., 2018)</td><td>3.41 ± 1.67</td><td>85.9%</td><td>1.55 ± 1.19</td><td>72.6%</td></tr><tr><td>VJTNN (Jin et al., 2018b)</td><td>3.55 ± 1.67</td><td></td><td>2.33 ± 1.17</td><td>=</td></tr><tr><td>GA (here)</td><td>5.93 ±1.41</td><td>100.0%</td><td>3.44 ±1.09</td><td>99.8%</td></tr></table>
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 6: Distributions of logP and QED for a) ZINC and b) GuacaMol data set compared to molecules generated using the GA. c) Examples of molecules generated by the GA with high logP and QED scores.
|
| 130 |
+
|
| 131 |
+
# 4.4.2 IMPROVING PENALIZED LOGP SCORES OF SPECIFIC MOLECULES
|
| 132 |
+
|
| 133 |
+
In this experiment, we follow the experimental setup proposed by You et al. (2018). We optimize the penalized logP score of 800 low-scoring molecules from the ZINC data set. Our genetic algorithm is initiated with a molecule from the data set, and we run each experiment for 20 generations and a population size of 500 without the discriminator. For each run, we report the molecule $m$ that increases the penalized logP the greatest, while possessing a similarity $s i m ( m , m ^ { \prime } ) > \delta$ with the respective reference molecules $m ^ { \prime }$ . We calculate molecular similarity based on Morgan Fingerprints of radius 2. To ensure generation of molecules possessing a certain similarity, for molecule $m$ we modify the fitness to:
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
F ( m ) = J ( m ) + \mathrm { S i m i l a r i t y P e n a l t y } ( m ) .
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
Here, SimilarityPenalty $( m )$ is 0 if $s i m ( m , m ^ { \prime } ) > \delta$ and $- 1 0 ^ { 6 }$ otherwise. In Table 2, we report the average improvement for each molecule. Success is determined when the GA successfully improve upon the penalized logP score, while not violating the similarity constraint. Figure S1 shows examples of improved molecular structures.
|
| 140 |
+
|
| 141 |
+
# 4.5 SIMULTANEOUS LOGP AND QED OPTIMIZATION
|
| 142 |
+
|
| 143 |
+
To show the performance of the GA on a drug-discovery task (Brown et al., 2019; Polykovskiy et al., 2018), we modified the objective function to include the drug-likeness score QED (Bickerton et al., 2012). Solubility metric logP and drug-likeness cannot be maximized at the same time, which is shown in Figure 6 at the example of the ZINC and the GuacaMol data set (Brown et al., 2019). The experiment shows that the GA is able to efficiently and densely sample the edge of the property distributions of both data sets. Example molecules that simultaneously maximize logP and QED are shown in Figure 6c.
|
| 144 |
+
|
| 145 |
+
# 4.6 MODIFICATION OF THE HYPERPARAMETER $\beta$
|
| 146 |
+
|
| 147 |
+
The definition of the fitness function used in this work (see Equation 1) has a free parameter $( \beta )$ , that balances the relative importance of molecular target properties $J ( m )$ and discriminator score
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 7: Variation of the model parameter $\beta$ that weights the discriminator score in the overall fitness function. a) Average $J ( m )$ as a function of the generation. b) Average discriminator score as a function of the generation. c) Distributions of $J ( m )$ and discriminator score $D$ for multiple values of $\beta$ . d) Examples of molecules generated with $\beta = 0$ and $\beta = 5 0$ .
|
| 151 |
+
|
| 152 |
+
$D ( m )$ . Large values of $\beta$ promote the generation of molecules that resemble the molecules from the reference data set, while small values of $\beta$ let the GA explore molecules outside of the distribution of the reference data set. To systematically explore this behaviour, we varied the $\beta$ parameter and analyzed the resulting values of $J ( m )$ , $D ( m )$ as well as their distributions. Figure 7 illustrates the results of this test, where each curve is obtained from averaging five independent runs with equal settings.
|
| 153 |
+
|
| 154 |
+
In Figure 7a, we show the average property score $J ( m )$ for 11 different values $\beta$ and observe, as expected, that low values of $\beta$ on average lead to higher $J ( m )$ score while very high values of $\beta$ limit the algorithm to stay inside the reference data set distribution, which, per definition, has a mean $J ( m )$ score of 0. Figure 7b illustrates the low average discriminator scores encountered after a few generations in case of low values of $\beta$ . The curves shown in Figure 7a and b suggest that $\beta$ allows us to interpolate between high and low $J ( m )$ and high and low resemblance with the reference data set. However, as shown in Figure $\mathrm { 7 c }$ , this is not the case. At values of $\beta \approx 2 0$ , there is a rather fast transition from molecules with high values of $J ( m )$ of approximately 12-13 to a $J ( m )$ distribution centered around 0 which is similar to the $J ( m )$ distribution of the reference data set. The same abrupt change is visible in the distributions of the discriminator scores. Only at $\beta \approx 1 8$ , we find a slightly wider distribution of intermediate $J ( m )$ values, which we assume is partially related to the fact that the $\beta = 1 8$ curve shown in Figure 7a is not converged yet.
|
| 155 |
+
|
| 156 |
+
Figure 7d shows examples of molecules generated with $\beta = 0$ (upper panel) and $\beta = 5 0$ (lower panel). While in the first case, the GA finds large molecules with many aromatic rings and long linear chains, that do not resemble the molecules in the reference data set, the latter case shows molecules with structures and properties resembling the reference data set. In this case, the distribution of $J ( m )$ is comparable to that of the data set (with 0 mean and unit standard deviation), while the discriminator encounters difficulty in correctly classification of the GA molecules, indicated by a mean discriminator score varying around 0.5 across many generations.
|
| 157 |
+
|
| 158 |
+
# 5 CONCLUSIONS AND FUTURE WORK
|
| 159 |
+
|
| 160 |
+
We presented a hybrid GA and ML-based generative model and demonstrated its application in molecular design. The model outperforms literature approaches in generating molecules with desired properties. A detailed analysis of the data generated by the genetic algorithm allowed us to
|
| 161 |
+
|
| 162 |
+
interpret the model and learn rules for the design of high performing molecules. This human expert design inspired from GA molecules outperformed all molecules created by generative models.
|
| 163 |
+
|
| 164 |
+
For computationally more expensive property evaluations, we will extend our approach by the introduction of an on-the-fly trained ML property evaluation method, which will open new ways of solving the inverse design challenge in chemistry and materials sciences.
|
| 165 |
+
|
| 166 |
+
Our approach is independent of domain knowledge, thus applicable to design questions in other scientific disciplines beyond chemistry. We therefore plan to generalize the GA-D approach to make it a more general concept of generative modelling.
|
| 167 |
+
|
| 168 |
+
# ACKNOWLEDGMENTS
|
| 169 |
+
|
| 170 |
+
The authors thank Gabriel dos Passos Gomes & Andres Aguilar Granda for useful discussions. ´ A. A.-G. acknowledges generous support from the Canada 150 Research Chair Program, Tata Steel, Anders G. Froseth, and the Office of Naval Research. M.K. acknowledges support from the Austrian Science Fund (FWF) through the Erwin Schrodinger fellowship No. J4309. P.F. has received funding ¨ from the European Union’s Horizon 2020 research and innovation programme under the Marie Sklodowska-Curie grant agreement No 795206.
|
| 171 |
+
|
| 172 |
+
# REFERENCES
|
| 173 |
+
|
| 174 |
+
Rim Assouel, Mohamed Ahmed, Marwin H Segler, Amir Saffari, and Yoshua Bengio. Defactor: Differentiable edge factorization-based probabilistic graph generation. arXiv preprint arXiv:1811.09766, 2018.
|
| 175 |
+
|
| 176 |
+
G Richard Bickerton, Gaia V Paolini, Jer´ emy Besnard, Sorel Muresan, and Andrew L Hopkins. ´ Quantifying the chemical beauty of drugs. Nature chemistry, 4(2):90, 2012.
|
| 177 |
+
|
| 178 |
+
Nathan Brown, Marco Fiscato, Marwin HS Segler, and Alain C Vaucher. Guacamol: benchmarking models for de novo molecular design. Journal of chemical information and modeling, 59(3): 1096–1108, 2019.
|
| 179 |
+
|
| 180 |
+
Hanjun Dai, Yingtao Tian, Bo Dai, Steven Skiena, and Le Song. Syntax-directed variational autoencoder for molecule generation. In Proceedings of the International Conference on Learning Representations, 2018.
|
| 181 |
+
|
| 182 |
+
Lawrence Davis. Handbook of genetic algorithms. 1991.
|
| 183 |
+
|
| 184 |
+
James Devillers. Genetic algorithms in molecular modeling. Academic Press, 1996.
|
| 185 |
+
|
| 186 |
+
Peter Ertl and Ansgar Schuffenhauer. Estimation of synthetic accessibility score of drug-like molecules based on molecular complexity and fragment contributions. Journal of cheminformatics, 1(1):8, 2009.
|
| 187 |
+
|
| 188 |
+
Yaakov Y Fein, Philipp Geyer, Patrick Zwick, Filip Kiałka, Sebastian Pedalino, Marcel Mayor, Stefan Gerlich, and Markus Arndt. Quantum superposition of molecules beyond 25 kda. Nature Physics, pp. 1–4, 2019.
|
| 189 |
+
|
| 190 |
+
Rafael Gomez-Bombarelli, Jennifer N Wei, David Duvenaud, Jos ´ e Miguel Hern ´ andez-Lobato, ´ Benjam´ın Sanchez-Lengeling, Dennis Sheberla, Jorge Aguilera-Iparraguirre, Timothy D Hirzel, ´ Ryan P Adams, and Alan Aspuru-Guzik. Automatic chemical design using a data-driven contin- ´ uous representation of molecules. ACS central science, 4(2):268–276, 2018.
|
| 191 |
+
|
| 192 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014.
|
| 193 |
+
|
| 194 |
+
Gabriel Lima Guimaraes, Benjamin Sanchez-Lengeling, Carlos Outeiral, Pedro Luis Cunha Farias, and Alan Aspuru-Guzik. Objective-reinforced generative adversarial networks (organ) for se- ´ quence generation models. arXiv preprint arXiv:1705.10843, 2017.
|
| 195 |
+
|
| 196 |
+
John J Irwin, Teague Sterling, Michael M Mysinger, Erin S Bolstad, and Ryan G Coleman. Zinc: a free tool to discover chemistry for biology. Journal of chemical information and modeling, 52 (7):1757–1768, 2012.
|
| 197 |
+
|
| 198 |
+
Jan H Jensen. A graph-based genetic algorithm and generative model/monte carlo tree search for the exploration of chemical space. Chemical science, 10(12):3567–3572, 2019.
|
| 199 |
+
|
| 200 |
+
Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Junction tree variational autoencoder for molecular graph generation. arXiv preprint arXiv:1802.04364, 2018a.
|
| 201 |
+
|
| 202 |
+
Wengong Jin, Kevin Yang, Regina Barzilay, and Tommi Jaakkola. Learning multimodal graph-tograph translation for molecular optimization. arXiv preprint arXiv:1812.01070, 2018b.
|
| 203 |
+
|
| 204 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 205 |
+
|
| 206 |
+
Mario Krenn, Florian Hase, AkshatKumar Nigam, Pascal Friederich, and Al ¨ an Aspuru-Guzik. Self- ´ ies: a robust representation of semantically constrained graphs with an example application in chemistry. arXiv preprint arXiv:1905.13741, 2019.
|
| 207 |
+
|
| 208 |
+
Matt J Kusner, Brooks Paige, and Jose Miguel Hern ´ andez-Lobato. Grammar variational autoen- ´ coder. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1945–1954. JMLR. org, 2017.
|
| 209 |
+
|
| 210 |
+
Joel Lehman, Jeff Clune, and Dusan Misevic. The surprising creativity of digital evolution. In Artificial Life Conference Proceedings, pp. 55–56. MIT Press, 2018.
|
| 211 |
+
|
| 212 |
+
Qi Liu, Miltiadis Allamanis, Marc Brockschmidt, and Alexander Gaunt. Constrained graph variational autoencoders for molecule design. In Advances in Neural Information Processing Systems, pp. 7795–7804, 2018.
|
| 213 |
+
|
| 214 |
+
Pruettha Nanakorn and Konlakarn Meesomklin. An adaptive penalty function in genetic algorithms for structural design optimization. Computers & Structures, 79(29-30):2527–2539, 2001.
|
| 215 |
+
|
| 216 |
+
Noel M O’Boyle, Casey M Campbell, and Geoffrey R Hutchison. Computational design and selection of optimal organic photovoltaic materials. The Journal of Physical Chemistry C, 115(32): 16200–16210, 2011.
|
| 217 |
+
|
| 218 |
+
Abby L Parrill. Evolutionary and genetic methods in drug design. Drug Discovery Today, 1(12): 514–521, 1996.
|
| 219 |
+
|
| 220 |
+
W Paszkowicz. Properties of a genetic algorithm equipped with a dynamic penalty function. Computational Materials Science, 45(1):77–83, 2009.
|
| 221 |
+
|
| 222 |
+
Daniil Polykovskiy, Alexander Zhebrak, Benjamin Sanchez-Lengeling, Sergey Golovanov, Oktai Tatanov, Stanislav Belyaev, Rauf Kurbanov, Aleksey Artamonov, Vladimir Aladinskiy, Mark Veselov, et al. Molecular sets (moses): a benchmarking platform for molecular generation models. arXiv preprint arXiv:1811.12823, 2018.
|
| 223 |
+
|
| 224 |
+
Chetan Rupakheti, Aaron Virshup, Weitao Yang, and David N Beratan. Strategy to discover diverse optimal molecules in the small molecule universe. Journal of chemical information and modeling, 55(3):529–537, 2015.
|
| 225 |
+
|
| 226 |
+
Benjamin Sanchez-Lengeling and Alan Aspuru-Guzik. Inverse molecular design using machine ´ learning: Generative models for matter engineering. Science, 361(6400):360–365, 2018.
|
| 227 |
+
|
| 228 |
+
Marwin HS Segler, Thierry Kogej, Christian Tyrchan, and Mark P Waller. Generating focused molecule libraries for drug discovery with recurrent neural networks. ACS central science, 4(1): 120–131, 2017.
|
| 229 |
+
|
| 230 |
+
Robert P Sheridan and Simon K Kearsley. Using a genetic algorithm to suggest combinatorial libraries. Journal of Chemical Information and Computer Sciences, 35(2):310–320, 1995.
|
| 231 |
+
|
| 232 |
+
Aaron M Virshup, Julia Contreras-Garc´ıa, Peter Wipf, Weitao Yang, and David N Beratan. Stochastic voyages into uncharted chemical space produce a representative library of all possible drug-like compounds. Journal of the American Chemical Society, 135(19):7296–7303, 2013.
|
| 233 |
+
|
| 234 |
+
Cenqi Yan, Stephen Barlow, Zhaohui Wang, He Yan, Alex K-Y Jen, Seth R Marder, and Xiaowei Zhan. Non-fullerene acceptors for organic solar cells. Nature Reviews Materials, 3(3):18003, 2018.
|
| 235 |
+
|
| 236 |
+
Xiufeng Yang, Jinzhe Zhang, Kazuki Yoshizoe, Kei Terayama, and Koji Tsuda. Chemts: an efficient python library for de novo molecular generation. Science and technology of advanced materials, 18(1):972–976, 2017.
|
| 237 |
+
|
| 238 |
+
Zhengjin Yang, Liuchuan Tong, Daniel P Tabor, Eugene S Beh, Marc-Antoni Goulet, Diana De Porcellinis, Alan Aspuru-Guzik, Roy G Gordon, and Michael J Aziz. Alkaline benzoquinone aque- ´ ous flow battery for large-scale storage of electrical energy. Advanced Energy Materials, 8(8): 1702056, 2018.
|
| 239 |
+
|
| 240 |
+
Jiaxuan You, Bowen Liu, Zhitao Ying, Vijay Pande, and Jure Leskovec. Graph convolutional policy network for goal-directed molecular graph generation. In Advances in Neural Information Processing Systems, pp. 6410–6421, 2018.
|
| 241 |
+
|
| 242 |
+
# 6 SUPPLEMENTARY INFORMATION
|
| 243 |
+
|
| 244 |
+

|
| 245 |
+
Figure S1 shows examples of the molecules optimized in Section 4.4.
|
| 246 |
+
Figure S1: Molecular modifications resulting in increased penalized logP scores under similarity constraint $s i m ( m , m ^ { \prime } ) > 0 . 4 , 0 . 6$ . We show the molecules that resulted in largest score improvement.
|
| 247 |
+
|
| 248 |
+
Figures S2-S4 show comparisons between the property distributions observed in molecule data sets such as the ZINC and the GuacaMol data set and property distributions of molecules generated using random SELFIES (Figure S2), GA generated molecules with the penalized logP objective (Figure S3) and GA generated molecules with an objective function which includes logP and QED (Figure S4). While the average logP scores of average SELFIES are low, the tail of the distribution reaches to high values, explaining the surprisingly high penalized logP scores shown in Table 1. The QED and weight distributions of molecules optimized using the penalized logP objective significantly differ from the distributions of the ZINC and the GuacaMol data set (see Figure S3). As soon as the QED score is simultaneously optimized, the distributions of GA generated molecules and molecules from the reference data sets become more similar (see Figure S4). Figure 6 shows that the GA can simultaneously optimize logP and QED.
|
| 249 |
+
|
| 250 |
+

|
| 251 |
+
Figure S2: Distributions of a) logP, b) SA, c) QED and d) molecular weight for randomly generated SELFIES, molecules from the ZINC data set and molecules from the GuacaMol data set.
|
| 252 |
+
|
| 253 |
+

|
| 254 |
+
Figure S3: Distributions of a) logP, b) SA, c) QED and d) molecular weight for GA generated SELFIES (penalized logP objective function), molecules from the ZINC data set and molecules from the GuacaMol data set.
|
| 255 |
+
|
| 256 |
+

|
| 257 |
+
Figure S4: Distributions of a) logP, b) SA, c) QED and d) molecular weight for GA generated SELFIES (logP and QED as objective function), molecules from the ZINC data set and molecules from the GuacaMol data set.
|
md/train/H1uP7ebAW/H1uP7ebAW.md
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING TO DIAGNOSE FROM SCRATCH BY EXPLOIT-ING DEPENDENCIES AMONG LABELS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The field of medical diagnostics contains a wealth of challenges which closely resemble classical machine learning problems; practical constraints, however, complicate the translation of these endpoints naively into classical architectures. Many tasks in radiology, for example, are largely problems of multi-label classification wherein medical images are interpreted to indicate multiple present or suspected pathologies. Clinical settings drive the necessity for high accuracy simultaneously across a multitude of pathological outcomes and greatly limit the utility of tools which consider only a subset. This issue is exacerbated by a general scarcity of training data and maximizes the need to extract clinically relevant features from available samples – ideally without the use of pre-trained models which may carry forward undesirable biases from tangentially related tasks. We present and evaluate a partial solution to these constraints in using LSTMs to leverage interdependencies among target labels in predicting 14 pathologic patterns from chest x-rays and establish state of the art results on the largest publicly available chest $\mathbf { X }$ -ray dataset from the NIH without pre-training. Furthermore, we propose and discuss alternative evaluation metrics and their relevance in clinical practice.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Medical diagnostics have increasingly become a more interesting and viable endpoint for machine learning. A general scarcity of publicly available medical data, however, inhibits its rapid development. Pre-training on tangentially related datasets such as ImageNet (Deng et al., 2009) has been shown to help in circumstances where training data is limited, but may introduce unintended biases which are undesirable in a clinical setting. Furthermore, most clinical settings will drive a need for models which can accurately predict a large number of diagnostic outcomes. This essentially turns many medical problems into multi-label classification with a large number of targets, many of which may be subtle or poorly defined and are likely to be inconsistently labeled. In addition, unlike the traditional multi-label setting, predicting the absence of each label is as important as predicting its presence in order to minimize the possibility of misdiagnosis. Each of these challenges drive a need for architectures which consider clinical context to make the most of the data available.
|
| 12 |
+
|
| 13 |
+
Chest $\mathbf { X }$ -rays are the most common type of radiology exam in the world and a particularly challenging example of multi-label classification in medical diagnostics. Making up nearly $45 \%$ of all radiological studies, the chest $\mathbf { X }$ -ray has achieved global ubiquity as a low-cost screening tool for a wealth of pathologies including lung cancer, tuberculosis, and pneumonia. Each scan can contain dozens of patterns corresponding to hundreds of potential pathologies and can thus be difficult to interpret, suffering from high disagreement rates between radiologists and often resulting in unnecessary follow-up procedures. Complex interactions between abnormal patterns frequently have significant clinical meaning that provides radiologists with additional context. For example, a study labeled to indicate the presence of cardiomegaly (enlargement of the cardiac silhouette) is more likely to additionally have pulmonary edema (abnormal fluid in the extravascular tissue of the lung) as the former may suggest left ventricular failure which often causes the latter. The presence of edema further predicates the possible presence of both consolidation (air space opacification) and a pleural effusion (abnormal fluid in the pleural space). Training a model to recognize the potential for these interdependencies could enable better prediction of pathologic outcomes across all categories while maximizing the data utilization and its statistical efficiency.
|
| 14 |
+
|
| 15 |
+
Among the aforementioned challenges, this work firstly addresses the problem of predicting multiple labels simultaneously while taking into account their conditional dependencies during both the training and the inference. Similar problems have been raised and analyzed in the work of Wang et al. (2016); Chen et al. (2017) with the application of image tagging, both outside the medical context. The work of Shin et al. (2016); Wang et al. (2017) for chest $\mathbf { X }$ -ray annotations are closest to ours. All of them utilize out-of-the-box decoders based on recurrent neural networks (RNNs) to sequentially predict the labels. Such a naive adoption of RNNs is problematic and often fails to attend to peculiarities of the medical problem in their design, which we elaborate on in Section 2.3 and Section 3.3.1.
|
| 16 |
+
|
| 17 |
+
In addition, we hypothesize that the need for pre-training may be safely removed when there are sufficient medical data available. To verify this, all our models are trained from scratch, without using any extra data from other domains. We directly compare our results with those of Wang et al. (2017) that are pre-trained on ImageNet. Furthermore, to address the issue of clinical interpretability, we juxtapose a collection of alternative metrics along with those traditionally used in machine learning, all of which are reported in our benchmark.
|
| 18 |
+
|
| 19 |
+
# 1.1 MAIN CONTRIBUTIONS
|
| 20 |
+
|
| 21 |
+
This work brings state-of-the-art machine learning models to bear on the problem of medical diagnosis with the hope that this will lead to better patient outcomes. We have advanced the existing research in three orthogonal directions:
|
| 22 |
+
|
| 23 |
+
• This work experimentally verifies that without pre-training, a carefully designed baseline model that ignores the label dependencies is able to outperform the pre-trained state-ofthe-art by a large margin.
|
| 24 |
+
• A collection of metrics is investigated for the purpose of establishing clinically relevant and interpretable benchmarks for automatic chest $\mathbf { X }$ -ray diagnosis. We propose to explicitly exploit the conditional dependencies among abnormality labels for better diagnostic results. Existing RNNs are purposely modified to accomplish such a goal. The results on the proposed metrics consistently indicate their superiority over models that do not consider interdependencies.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
# 2.1 NEURAL NETWORKS IN MEDICAL IMAGING
|
| 29 |
+
|
| 30 |
+
The present work is part of a recent effort to harness advances in Artificial Intelligence and machine learning to improve computer-assisted diagnosis in medicine. Over the past decades, the volume of clinical data in machine-readable form has grown, particularly in medical imaging. While previous generations of algorithms struggled to make effective use of this high-dimensional data, modern neural networks have excelled at such tasks. Having demonstrated their superiority in solving difficult problems involving natural images and videos, recent surveys from Litjens et al. (2017); Shen et al. (2017); Qayyum et al. (2017) suggest that they are rapidly becoming the “de facto” standard for classification, detection, and segmentation tasks with input modalities such as CT, MRI, x-ray, and ultrasound. As further evidence, models based on neural networks dominate the leaderboard in most medical imaging challenges 1,2.
|
| 31 |
+
|
| 32 |
+
Most successful applications of neural networks to medical images rely to a large extent on convolutional neural networks (ConvNets), which were first proposed in LeCun et al. (1998). This comes as no surprise since ConvNets are the basis of the top performing models for natural image understanding. For abnormality detection and segmentation, the most popular variants are UNets from Ronneberger et al. (2015) and VNets from Milletari et al. (2016), both built on the idea of fully convolutional neural networks introduced in Long et al. (2015). For classification, representative examples of neural network-based models from the medical literature include: Esteva et al. (2017) for skin cancer classification, Gulshan et al. (2016) for diabetic retinopathy, Lakhani & Sundaram (2017) for pulmonary tuberculosis detection in $\mathbf { X }$ -rays, and Huang et al. (2017b) for lung cancer diagnosis with chest CTs. All of the examples above employed 2D or 3D ConvNets and all of them provably achieved near-human level performance in their particular setup. Our model employs a 2D ConvNet as an image encoder to process chest $\mathbf { X }$ -rays.
|
| 33 |
+
|
| 34 |
+
# 2.2 MULTI-LABEL CLASSIFICATION
|
| 35 |
+
|
| 36 |
+
Given a finite set of possible labels, the multi-label classification problem is to associate each instance with a subset of those labels. Being relevant to applications in many domains, a variety of models have been proposed in the literature. The simplest approach, known as binary relevance, is to break the multi-label classification problem into independent binary classification problems, one for each label. A recent example from the medical literature is Wang et al. (2017). The appeal of binary relevance is its simplicity and the fact that it allows one to take advantage of a rich body of work on binary classification. However, it suffers from a potentially serious drawback: the assumption that the labels are independent. For many applications, such as the medical diagnostic application motivating this work, there are significant dependencies between labels that must be modeled appropriately in order to maximize the performance of the classifier.
|
| 37 |
+
|
| 38 |
+
Researchers have sought to model inter-label dependencies by making predictions over the label power set (e.g. Tsoumakas & Vlahavas (2007) and Read et al. (2008)), by training classifiers with loss functions that implicitly represent dependencies (e.g. Li et al. (2017)), and by using a sequence of single-label classifiers, each of which receives a subset of the previous predictions along with the instance to be classified (e.g. Dembczynski et al. (2012)). The later approach is equivalent to ´ factoring the joint distribution of labels using a product of conditional distributions. Recent research has favored recurrent neural networks (RNNs), which rely on their state variables to encode the relevant information from the previous predictions (e.g. Wang et al. (2016) and Chen et al. (2017)). The present work falls into this category.
|
| 39 |
+
|
| 40 |
+
# 2.3 KEY DIFFERENCES
|
| 41 |
+
|
| 42 |
+
To detect and classify abnormalities in chest x-ray images, we propose using 2D ConvNets as encoders and decoders based on recurrent neural networks (RNNs). Recently, Lipton et al. (2016) proposed an RNN-based model for abnormality classification that, based on the title of their paper, bears much resemblance to ours. However, in their work the RNN is used to process the inputs rather than the outputs, which fails to capture dependencies between labels; something we set out to explicitly address. They also deal exclusively with time series data rather than high-resolution images.
|
| 43 |
+
|
| 44 |
+
The work of Shin et al. (2016) also addresses the problem of chest $\mathbf { X }$ -ray annotation. They built a cascaded three-stage model using 2D ConvNets and RNNs to sequentially annotate both the abnormalities and their attributes (such as location and severity). Their RNN decoder resembles ours in its functionality, but differs in the way the sequence of abnormalities are predicted. In each RNN step, their model predicts one of $T$ abnormalities with softmax, and stops when reaching a predefined upper limit of total number of steps (5 is used in theirs). Instead, our model predicts the presence or absence of $t$ -th abnormality with sigmoid at time step $t$ and the total number of steps is the number of abnormalities. The choice of such a design is inspired by Neural Autoregressive Density Estimators (NADEs) of Larochelle & Murray (2011). Being able to predict the absence of an abnormality and feed to the next step, which is not possible with softmax and argmax, is preferable in the clinical setting to avoid any per-class overcall and false alarm. In addition, the absence of a certain abnormality may be a strong indication of the presence or absence of others. Beyond having a distinct approach to decoding, their model was trained on the $\mathrm { O p e n I } ^ { 3 }$ dataset with 7000 images, which is smaller and less representative than the dataset that we used (see below). In addition, we propose a different set of metrics to use in place of BLEU (Papineni et al., 2002), commonly used in machine translation, for better clinical interpretation.
|
| 45 |
+
|
| 46 |
+
In the non-medical setting, Wang et al. (2016) proposed a similar ConvNet–RNN architecture. Their choice of using an RNN decoder was also motivated by the desire to model label dependencies. However, they perform training and inference in the manner of Shin et al. (2016). Another example of this combination of application, architecture, and inference comes from Chen et al. (2017) whose work focused on eliminating the need to use a pre-defined label order for training. We show in the experiments that ordering does not seem to impose as a significant constraint when models are sufficiently trained.
|
| 47 |
+
|
| 48 |
+
Finally, Wang et al. (2017) proposed a 2D ConvNet for classifying abnormalities in chest x-ray images. However, they used a simple binary relevance approach to predict the labels. As we mentioned earlier, there is strong clinical evidence to suggest that labels do in fact exhibit dependencies that we attempt to model. They also presented the largest public $\mathbf { X }$ -ray dataset to date (“ChestX-ray8”). Due to its careful curation and large volume, such a collection is a more realistic retrospective clinical study than OpenI and therefore better suited to developing and benchmarking models. Consequently, we use “ChestX-ray8” to train and evaluate our model. And it should be noted that unlike Wang et al. (2017), we train our models from scratch to ensure that the image encoding best captures the features of $\mathbf { X }$ -ray images as opposed to natural images.
|
| 49 |
+
|
| 50 |
+
# 3 MODELS
|
| 51 |
+
|
| 52 |
+
The following notations are used throughout the paper. Denote $\mathbf { x }$ as an input image, and ${ \textbf { x } } \in$ $\mathcal { R } ^ { w \times h \times c }$ where $w$ , $h$ and $c$ represent width, height, and channel. Denote $\mathbf { y }$ as a binary vector of dimensionality $T$ , the total number of abnormalities. We used superscripts to indicate a specific dimensionality. Thus, given a specific abnormality $t$ , $\mathbf { y } ^ { t } = 0$ indicates its absence and $\mathbf { y } ^ { t } = 1$ its presence. We use subscripts to index a particular example, for instance, $\left\{ \mathbf { x } _ { i } , \mathbf { y } _ { i } \right\}$ is the $i$ -th example. In addition, $\theta$ denotes the union of parameters in a model. We also use $\mathbf { m }$ to represent a vector with each element $\mathbf { m } ^ { t }$ as the mean of a Bernoulli distribution.
|
| 53 |
+
|
| 54 |
+
# 3.1 DENSELY CONNECTED IMAGE ENCODER
|
| 55 |
+
|
| 56 |
+
A recent variant of Convolutional Neural Network (ConvNet) is proposed in Huang et al. (2017a), dubbed as Densely Connected Networks (DenseNet). As a direct extension of Deep Residual Networks (He et al., 2016) and Highway Networks (Srivastava et al., 2015), the key idea behind DenseNet is to establish shortcut connections from all pairs of layers at different depth of a very deep neural network. It has been argued in Huang et al. (2017a) that, as the result of the extensive and explicit feature reuse in DenseNets, they are both computationally and statistically more efficient. This property is particularly desirable in dealing with medical imaging problems where the number of training examples are usually limited and overfitting tends to prevail in models with more than tens of millions of parameters.
|
| 57 |
+
|
| 58 |
+
We therefore propose a model based on the design of DenseNets while taking into account the peculiarity of medical problems at hand. Firstly, the inputs of the model are of much higher resolutions. Lower resolution, typically with $2 5 6 \times 2 5 6$ , may be sufficient in dealing with problems related to natural images, photos and videos, a higher resolution, however, is often necessary to faithfully represent regions in images that are small and localized. Secondly, the proposed model is much smaller in network depth. While there is ample evidence suggesting the use of hundreds of layers, such models typically require hundreds of thousands to millions of examples to train. Large models are prone to overfitting with one tenth the training data. Figure 1 highlights such a design.
|
| 59 |
+
|
| 60 |
+
# 3.2 INDEPENDENT PREDICTION OF LABELS
|
| 61 |
+
|
| 62 |
+
Ignoring the nature of conditional dependencies among the indicators, $\mathbf { y } ^ { t }$ , one could establish the following probabilistic model:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
P ( \mathbf { y } | \mathbf { x } ) = \prod _ { t = 1 } ^ { T } P ( \mathbf { y } ^ { t } | \mathbf { x } ) .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
Equ (1) assumes that knowing one label does not provide any additional information about any other label. Therefore, in principle, one could build a separate model for each $\mathbf { y } ^ { t }$ which do not share any parameters. However, it is common in the majority of multi-class settings to permit a certain degree of parameter sharing among individual classifiers, which encourages the learned features to be reused among them. Furthermore, sharing alleviates the effect of overfitting as the exampleparameter ratio is much higher.
|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
Figure 1: The input image is encoded by a densely connected convolutional neural network (top). Similar to DenseNets from Huang et al. (2017a), our variant consists of DenseBlocks and TransitionBlocks. Within each DenseBlock, there are several ConvBlocks. The resulting encoded representation of the input is a vector that captures the higher-order semantics that are useful for the decoding task. $K$ is the growth rate in Huang et al. (2017a), $S$ is the stride. We also include the filter and pooling dimensionality when applicable. Unlike a DenseNet that has 16 to 32 ConvBlock within a DenseBlock, our model uses 4 in order to keep the total number of parameters small. Our proposed RNN decoder is illustrated on the bottom right.
|
| 72 |
+
|
| 73 |
+
# 3.2.1 TRAINING
|
| 74 |
+
|
| 75 |
+
During training, the model optimizes the following Maximum Log-likelihood Estimate (MLE) criteria:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\mathcal { L } _ { \alpha } = \underset { \theta } { \arg \operatorname* { m a x } } \sum _ { t = 1 } ^ { T } \log P ( \mathbf { y } ^ { t } | \mathbf { x } , \theta )
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $P ( \mathbf { y } ^ { t } | \mathbf { x } , \theta )$ is a Bernoulli distribution with its mean $\mathbf { m } ^ { t }$ parameterized by the model. In particular, $\mathbf { m } ^ { t } = \mathrm { s i g m o i d } ( f ( \mathbf { x } , \theta ) )$ .
|
| 82 |
+
|
| 83 |
+
# 3.2.2 INFERENCE
|
| 84 |
+
|
| 85 |
+
As labels are considered independent and during the inference, a binary label is generated for each factor independently with $\mathbf { y } ^ { t ^ { * } } = \arg \operatorname* { m a x } P ( \mathbf { y } ^ { t } | \mathbf { x } , \boldsymbol { \theta } )$ . This is equivalent to setting the classification threshold to 0.5.
|
| 86 |
+
|
| 87 |
+
# 3.3 EXPLOITING HIGHER-ORDER DEPENDENCIES AMONG LABELS
|
| 88 |
+
|
| 89 |
+
As discussed in length in Section 1, it is hardly true that abnormalities are independent from each other. Hence the assumption made by Equ (1) is undoubtably too restrictive. In order to treat the multi-label problem in its full generality, we can begin with the following factorization, which makes no assumption of independence:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
P ( \mathbf { y } | \mathbf { x } ) = P ( \mathbf { y } ^ { 0 } | \mathbf { x } ) P ( \mathbf { y } ^ { 1 } | \mathbf { y } ^ { 0 } , \mathbf { x } ) \dots P ( \mathbf { y } ^ { T } | \mathbf { y } ^ { 0 } , \dots , \mathbf { y } ^ { T - 1 } , \mathbf { x } ) .
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
Here, the statistical dependencies among the indicators, $\mathbf { y } ^ { t }$ , are explicitly modeled within each factor so the absence or the presence of a particular abnormality may suggest the absence or presence of others.
|
| 96 |
+
|
| 97 |
+
The factorization in Equ (3) has been the central study of many recent models. Bengio & Bengio (2000) proposed the first neural network based model, refined by Larochelle & Murray (2011) and Gregor et al. (2014), all of which used the model in the context of unsupervised learning in small discrete data or small image patches. Recently Sutskever et al. (2014); Cho et al. (2014) popularized the so-called “sequence-to-sequence” model where a Recurrent Neural Network (RNN) decoder models precisely the same joint distribution while conditioned on the output of an encoder. Compared with the previous work, RNNs provide a more general framework to model Equ (3) and an unmatched proficiency in capturing long term dependencies when $K$ is large.
|
| 98 |
+
|
| 99 |
+
We therefore adopt the Long-short Term Memory Networks (LSTM) (Hochreiter & Schmidhuber, 1997) and treat the multi-label classification as sequence prediction with a fixed length. The formulation of our LSTM is particularly similar to those used in image and video captioning (Xu et al., 2015; Yao et al., 2015), but without the use of an attention mechanism and without the need of learning when to stop.
|
| 100 |
+
|
| 101 |
+
Given an input $\mathbf { x }$ , the same DenseNet-based encoder of Section 3.2 is applied to produce a lower dimensional vector representation of it with
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\mathbf { x } _ { \mathrm { e n c } } = f _ { \mathrm { e n c } } ( \mathbf { x } )
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
For the decoder, $\mathbf { x e n c }$ is used to initialize both the states and memory of an LSTM with
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\begin{array} { r } { \mathbf { h } _ { 0 } = f _ { h _ { 0 } } ( \mathbf { x } _ { \mathrm { e n c } } ) \qquad \mathbf { c } _ { 0 } = f _ { c _ { 0 } } ( \mathbf { x } _ { \mathrm { e n c } } ) } \end{array}
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
where $f _ { h _ { 0 } }$ and $f _ { c _ { 0 } }$ are standard feedforward neural networks with one hidden layer. With $\mathbf { h } _ { 0 }$ and $\mathbf { c } _ { 0 }$ the LSTM decoder is parameterized as
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\begin{array} { r l } & { \mathbf { g } _ { i } ^ { t } = \mathrm { s i g m o i d } ( \mathbf { x } _ { \mathrm { e n c } } \mathbf { W } _ { i } + \mathbf { h } ^ { t - 1 } \mathbf { U } _ { i } + \mathbf { y } ^ { t - 1 } \mathbf { V } _ { i } + \mathbf { b } _ { i } ) } \\ & { \mathbf { g } _ { o } ^ { t } = \mathrm { s i g m o i d } ( \mathbf { x } _ { \mathrm { e n c } } \mathbf { W } _ { o } + \mathbf { h } ^ { t - 1 } \mathbf { U } _ { o } + \mathbf { y } ^ { t - 1 } \mathbf { V } _ { o } + \mathbf { b } _ { o } ) } \\ & { \mathbf { g } _ { f } ^ { t } = \mathrm { s i g m o i d } ( \mathbf { x } _ { \mathrm { e n c } } \mathbf { W } _ { f } + \mathbf { h } ^ { t - 1 } \mathbf { U } _ { f } + \mathbf { y } ^ { t - 1 } \mathbf { V } _ { f } + \mathbf { b } _ { f } ) } \\ & { \mathbf { g } _ { g } ^ { t } = \mathbf { x } _ { \mathrm { e n c } } \mathbf { W } _ { g } + \mathbf { h } ^ { t - 1 } \mathbf { U } _ { g } + \mathbf { y } ^ { t - 1 } \mathbf { V } _ { g } + \mathbf { b } _ { g } } \\ & { \mathbf { c } ^ { t } = \mathbf { g } _ { f } ^ { t } \odot \mathbf { c } ^ { t - 1 } + \mathbf { g } _ { i } ^ { t } \odot \mathrm { t a n h } ( \mathbf { g } _ { g } ^ { t } ) } \\ & { \mathbf { h } ^ { t } = \mathbf { g } _ { o } ^ { t } \odot \mathrm { t a n h } ( \mathbf { c } ^ { t } ) } \\ & { \mathbf { m } ^ { t } = \mathrm { s i g m o i d } ( \mathbf { h } ^ { t } \mathbf { q } ^ { T } + b _ { l } ) } \end{array}
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where model parameters consist of three matrices Ws, Us, Vs, vectors bs and a scalar $b _ { l }$ . y is a vector code of the ground truth labels that respects a fixed ordering, with each element being either 0 or 1. All the vectors, including hs, gs, cs, bs, $\mathbf { q }$ and $\mathbf { y }$ are row vectors such that the vector-matrix multiplication makes sense. $\odot$ denotes the element-wise multiplication. Both sigmoid and tanh are element-wise nonlinearities. For brevity, we summarize one step of decoder computation as
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\mathbf { m } ^ { t } = f _ { \mathrm { d e c } } ( \mathbf { x } _ { \mathrm { e n c } } , \mathbf { y } ^ { t - 1 } , \mathbf { h } ^ { t - 1 } )
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
where the decoder LSTM computes sequentially the mean of a Bernoulli distribution. With Equ (3), each of its factor may be rewritten as
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
P ( \mathbf { y } ^ { t } | \mathbf { y } ^ { 0 } , \ldots , \mathbf { y } ^ { t - 1 } , \mathbf { x } ) = P ( \mathbf { y } ^ { t } = 1 ) ^ { \mathbf { m } ^ { t } } P ( \mathbf { y } ^ { t } = 0 ) ^ { ( 1 - \mathbf { m } ^ { t } ) }
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
# 3.3.1 THE DESIGN CHOICE OF SIGMOID
|
| 132 |
+
|
| 133 |
+
The choice of using sigmoid to predict $\mathbf { y } _ { t }$ is by design. Standard sequence-to-sequence models often use softmax to predict one out of $\mathrm { T }$ classes and thus need to learn explicitly an “end-ofsequence” class. This is not desirable in our context due to the sparseness of the labels, resulting in the learned decoder being strongly biased towards predicting “end-of-sequence” while missing infrequently appearing abnormalities. Secondly, during the inference of the softmax based RNN decoder, the prediction at the current step is largely based on the presence of abnormalities at all previous steps due to the use of argmax. However, in the medical setting, the absence of previously predicted abnormalities may also be important. Sigmoid conveniently addresses these issues by explicitly predicting 0 or 1 at each step and it does not require the model to learn when to stop; the decoder always runs for the same number of steps as the total number of classes. Figure 1 contains the overall architecture of the decoder.
|
| 134 |
+
|
| 135 |
+
# 3.3.2 TRAINING
|
| 136 |
+
|
| 137 |
+
During training, the model optimizes
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\mathcal { L } _ { \beta } = \mathop { \arg \operatorname* { m a x } } _ { \theta } \sum _ { t = 1 } ^ { T } \log P ( \mathbf { y } ^ { k } | \mathbf { y } ^ { 0 } , \dots , \mathbf { y } ^ { t - 1 } , { \mathbf { x } } , \theta )
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
Compared with Equ (1), the difference is the explicit dependencies among $\mathbf { y } ^ { t } \mathbf { s }$ . One may also notice that such a factorization is not unique – in fact, there exist $T !$ different orderings. Although mathematically equivalent, in practice, some of the orderings may result in a model that is easier to train. We investigate in Section 4 the impact of such decisions with two distinct orderings.
|
| 144 |
+
|
| 145 |
+
# 3.3.3 INFERENCE
|
| 146 |
+
|
| 147 |
+
The inference of such a model is unfortunately intractable as $\mathbf { y } ^ { * } = \arg \operatorname* { m a x } _ { \mathbf { y } } P ( \mathbf { y } ^ { 0 } , \ldots , \mathbf { y } ^ { T } | \mathbf { x } )$ . Beam search (Sutskever et al., 2014) is often used as an approximation. We have found in practice that greedy search, which is equivalent to beam search with size 1, results in similar performance due to the binary sampling nature of each $\mathbf { y } ^ { t }$ , and use it throughout the experiments. It is equivalent to setting 0.5 as the discretization threshold on each of the factors.
|
| 148 |
+
|
| 149 |
+
# 4 EXPERIMENTS
|
| 150 |
+
|
| 151 |
+
# 4.1 DATASET
|
| 152 |
+
|
| 153 |
+
To verify the efficacy of the proposed models in medical diagnosis, we conduct experiments on the dataset introduced in Wang et al. (2017). It is to-date the largest collection of chest $\mathbf { X }$ -rays that is publicly available. It contains in total 112,120 frontal-view chest x-rays each of which is associated with the absence or presence of 14 abnormalities. The dataset is originally released in PNG format, with each image rescaled to $1 0 2 4 \times 1 0 2 4$ .
|
| 154 |
+
|
| 155 |
+
As there is no standard split for this dataset, we follow the guideline in Wang et al. (2017) to randomly split the entire dataset into $70 \%$ for training, $10 \%$ for validation and $20 \%$ for training. The authors of Wang et al. (2017) noticed insignificant performance difference with different random splits, as confirmed in our experiments by the observation that the performance on validation and test sets are consistent with each other.
|
| 156 |
+
|
| 157 |
+
# 4.2 PERFORMANCE METRICS
|
| 158 |
+
|
| 159 |
+
As the dataset is relatively new, the complete set of metrics have yet to be established. In this work, the following metrics are considered, and their advantage and drawbacks outlined below.
|
| 160 |
+
|
| 161 |
+
1. Negative log-probability of the test set (NLL). This metric has a direct and intuitive probabilistic interpretation: The lower the NLL, the more likely the ground truth label. However, it is difficult to associate it with a clinical interpretation. Indeed, it does not directly reflect how accurate the model is at diagnosing cases with or without particular abnormalities.
|
| 162 |
+
|
| 163 |
+
2. Area under the ROC curves (AUC). This is the reported metric of Wang et al. (2017) and it is widely used in modern biostatistics to measure collectively the rate of true detections and false alarms. In particular, we define 4 quantities: (1) true positive as TP: model predicts 1 with ground truth 1. (2) true negative as TN: model predicts 0 with ground truth 0. (3) false positive as FP: model predicts 1 with ground truth 0. (4) false negative as FN: model predicts 0 with ground truth 1. Sensitivity (or recall) is computed as $\mathrm { \bar { T P } / ( T P + F N ) }$ that measures the success of identifying abnormal cases. Specificity is $\mathrm { T N } / ( \mathrm { T N } + \mathrm { F P } )$ that measures the success of not flagging normal cases as abnormal. The ROC curve has typically horizontal axis as (1-specificity) and vertical axis as sensitivity. Once $P ( \mathbf { y } _ { i } | \mathbf { x } )$ is available, the curve is generated by varying the decision threshold to discretize the probability into either 0 or 1. Despite of its clinical relevance, $P ( \mathbf { y } _ { i } | \mathbf { x } )$ is intractable to compute with the model of Equ (3) due to the need of marginalizing out other binary random variables. It is however straightforward to compute with the model of Equ (1) due the independent factorization.
|
| 164 |
+
|
| 165 |
+
3. DICE coefficient. As a similarity measure over two sets, DICE coefficient is formulated as $\mathrm { D I C E } ( { \bf y } _ { \alpha } , { \bf y } _ { \beta } ) = ( 2 { \bf y } _ { \alpha } { \bf y } _ { \beta } ) / ( { \bf \dot { y } } _ { \alpha } ^ { 2 } + { \bf y } _ { \beta } ^ { 2 } ) = 2 \mathrm { T P } / ( 2 \mathrm { T P } + \mathrm { F P } + \mathrm { F N } )$ with the maxima at 1 when ${ \bf y } _ { \alpha } \equiv { \bf y } _ { \beta }$ . Such a metric may be generalized in cases where $\mathbf { y } _ { \alpha }$ is a predicted probability with ${ \bf y } _ { \alpha } = { \cal P } ( { \bf y } | { \bf x } )$ and $\mathbf { y } _ { \beta }$ is the binary-valued ground truth, as is used in image segmentation tasks such as in Ronneberger et al. (2015); Milletari et al. (2016). We adopt such a generalization as our models naturally output probabilities.
|
| 166 |
+
|
| 167 |
+
4. Per-example sensitivity and specificity (PESS). The following formula is used to compute PESS
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\mathrm { P E S S } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \frac { \mathrm { s e n s i t i v i t y } ( \hat { \bf y } _ { i } , { \bf y } _ { i } ) + \mathrm { s p e c i f i c i t y } ( \hat { \bf y } _ { i } , { \bf y } _ { i } ) } { 2 }
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
where $N$ is the size of the test set. Notice that the computation of sensitivity and specificity requires a binary prediction vector. Therefore, without introducing any thresholding bias, we use
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
\hat { \mathbf { y } } _ { i } = \left\{ \begin{array} { l l } { 1 } & { P ( \mathbf { y } _ { i } | \mathbf { x } _ { i } ) > 0 . 5 } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
5. Per-class sensitivity and specificity (PCSS). Unlike PESS, the following formula is used to compute PCSS
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
\mathrm { P C S S } = \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \frac { \mathrm { s e n s i t i v i t y } ( \hat { \mathbf { y } } _ { i } ^ { t } , \mathbf { y } _ { i } ^ { t } ) + \mathrm { s p e c i f i c i t y } ( \hat { \mathbf { y } } _ { i } ^ { t } , \mathbf { y } _ { i } ^ { t } ) } { 2 }
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
where $\hat { \mathbf { y } } _ { i } ^ { t }$ follows the same threshold of 0.5 as in PESS. Unlike PCSS where the average is over examples, PCSS averages over abnormalities instead.
|
| 186 |
+
|
| 187 |
+
# 4.3 TRAINING PROCEDURES
|
| 188 |
+
|
| 189 |
+
Three types of models are tuned on the training set. We have found that data augmentation is crucial in combatting the overfitting in all of our experiments despite their relatively small size. In particular, the input image of resolution $5 1 2 \times 5 1 2$ is randomly translated in 4 directions by 25 pixels, randomly rotated from -15 to 15 degrees, and randomly scaled between $80 \%$ and $120 \%$ . Furthermore, the ADAM optimizer Kingma & Ba (2015) is used with an initial learning rate of 0.001 which is multiplied by 0.9 whenever the performance on the validation set does not improve during training. Early stop is applied when the performance on the validation set does not improve for 10,000 parameter updates. All the reported metrics are computed on the test set with models selected with the metric in question on the validation set.
|
| 190 |
+
|
| 191 |
+
In order to ensure a fair comparison, we constrain all models to have roughly the same number of parameters. For $\mathrm { m o d e l } _ { a }$ , where labels are considered independent, a much higher network growth rate is used for the encoder. For $\mathrm { m o d e l } _ { b _ { 1 } }$ and $\mathrm { m o d e l } _ { b _ { 2 } }$ where LSTMs are used as decoders, the encoders are narrower. The exact configuration of three models is shown in Table 1. In addition, we investigate the effect of ordering in the factorization of Equ (3). In particular, $\mathrm { m o d e l } _ { b _ { 1 } }$ sorts labels by their frequencies in the training set while $\mathrm { m o d e l } _ { b _ { 1 } }$ orders them alphabetically. All models are trained with MLE with the weighted cross-entropy loss introduced in Wang et al. (2017). All models are trained end-to-end from scratch, without any pre-training on ImageNet data.
|
| 192 |
+
|
| 193 |
+
Table 1: Hyper-parameter configuration of three models. To ensure the fairness of the comparison, we deliberately reduce the capacity of the encoder for $\mathrm { m o d e l } _ { b _ { 1 } }$ and $\mathrm { m o d e l } _ { b _ { 2 } }$ to match the total number of parameters of mode $^ { - a }$ .
|
| 194 |
+
|
| 195 |
+
<table><tr><td></td><td># of dense block × # of conv block</td><td>growth rate</td><td>LSTM dim.</td><td>total # of params</td></tr><tr><td>modela</td><td>4×3</td><td>38</td><td>1</td><td>1,007K</td></tr><tr><td>modelb1,b2</td><td>4×3</td><td>19</td><td>100</td><td>1,016K</td></tr></table>
|
| 196 |
+
|
| 197 |
+
# 4.4 QUANTITATIVE RESULTS
|
| 198 |
+
|
| 199 |
+
The AUC per abnormality is shown in Table 2, computed based on the marginal distribution of $P ( \mathbf { y } | \mathbf { x } )$ . Only mode $^ { - a }$ is included as such marginals are in general intractable for the other two due to the dependencies among $\mathbf { y } ^ { t } \mathbf { s }$ . In addition, Table 3 compares all three models based on the proposed metrics from Section 4.2. It can be observed that our baseline model significantly outperformed the previous state-of-the-art. According to Table 3, considering label dependencies brings significant benefits in all 4 metrics and the impact of ordering seems to be marginal when the model is sufficiently trained.
|
| 200 |
+
|
| 201 |
+
Table 2: Fifteen abnormalities and their AUCs, including the average AUC over all abnormalities. The model is trained without pre-training or feature extraction from ImageNet. The model corresponds to the one in Section 3.2 where $\mathbf { \bar { y } } ^ { t } \mathbf { s }$ are considered independent. This table excludes the model from Section 3.3 because AUC requires $P ( \mathbf { y } ^ { t } | \mathbf { x } )$ , which is in general intractable.
|
| 202 |
+
|
| 203 |
+
<table><tr><td>abnormality</td><td>Wang et al. (2017)</td><td>modela</td></tr><tr><td>atelectasis cardiomegaly</td><td>0.716</td><td>0.772</td></tr><tr><td>effusion</td><td>0.807 0.784</td><td>0.904 0.859</td></tr><tr><td>infiltration</td><td>0.609</td><td>0.695</td></tr><tr><td>mass</td><td>0.706</td><td>0.792</td></tr><tr><td>nodule</td><td>0.671</td><td>0.717</td></tr><tr><td>pneumonia</td><td>0.633</td><td>0.713</td></tr><tr><td>pneumothorax</td><td>0.806</td><td></td></tr><tr><td>consolidation</td><td></td><td>0.841</td></tr><tr><td>edema</td><td>0.708</td><td>0.788</td></tr><tr><td>emphysema</td><td>0.835</td><td>0.882</td></tr><tr><td>fibrosis</td><td>0.815</td><td>0.829</td></tr><tr><td></td><td>0.769</td><td>0.767</td></tr><tr><td>PT</td><td>0.708</td><td>0.765</td></tr><tr><td>hernia</td><td>0.767</td><td>0.914</td></tr><tr><td>A.V.G.</td><td>0.738</td><td>0.798</td></tr><tr><td>no finding</td><td>-</td><td>0.762</td></tr></table>
|
| 204 |
+
|
| 205 |
+
Table 3: Test set performance on negative log-probability (NLL), DICE, per-example sensitivity (PESS) at a threshold 0.5 and per-class sensitivity and specificity (PCSS) at a threshold of 0.5. See Section 4.2 for explanations of the metrics. In addition to $\mathrm { m o d e l } _ { a }$ used in Table 2, $\mathrm { m o d e l } _ { b 1 }$ and $\mathrm { m o d e l } _ { b 2 }$ corresponds to the model introduced in Section 3.3, with the difference in the ordering of the factorization in Equ (3). $\mathrm { m o d e l } _ { b 1 }$ sorts labels by their frequency in the training set in ascending order. As a comparison, $\mathrm { m o d e l } _ { b 2 }$ orders labels alphabetically according to the name of the abnormality.
|
| 206 |
+
|
| 207 |
+
<table><tr><td></td><td>NLL</td><td>DICE</td><td>PESS0.5</td><td>PCSS0.5</td></tr><tr><td>modela</td><td>4.474</td><td>0.261</td><td>0.752</td><td>0.665</td></tr><tr><td>modelb1</td><td>4.099</td><td>0.310</td><td>0.765</td><td>0.676</td></tr><tr><td>modelb2</td><td>3.848</td><td>0.310</td><td>0.767</td><td>0.677</td></tr></table>
|
| 208 |
+
|
| 209 |
+
# 5 CONCLUSION
|
| 210 |
+
|
| 211 |
+
To improve the quality of computer-assisted diagnosis of chest $\mathbf { X }$ -rays, we proposed a two-stage end-to-end neural network model that combines a densely connected image encoder with a recurrent neural network decoder. The first stage was chosen to address the challenges to learning presented by high-resolution medical images and limited training set sizes. The second stage was designed to allow the model to exploit statistical dependencies between labels in order to improve the accuracy of its predictions. Finally, the model was trained from scratch to ensure that the best application-specific features were captured. Our experiments have demonstrated both the feasibility and effectiveness of this approach. Indeed, our baseline model significantly outperformed the current state-of-the-art. The proposed set of metrics provides a meaningful quantification of this performance and will facilitate comparisons with future work.
|
| 212 |
+
|
| 213 |
+
While a limited exploration into the value of learning interdependencies among labels yields promising results, additional experimentation will be required to further explore the potential of this methodology both as it applies specifically to chest $\mathbf { X }$ -rays and to medical diagnostics as a whole. One potential concern with this approach is the risk of learning biased interdependencies from a limited training set which does not accurately represent a realistic distribution of pathologies – if every example of cardiomegaly is also one of cardiac failure, the model may learn to depend too much on the presence of other patterns such as edemas which do not always accompany enlargement of the cardiac silhouette. This risk is heightened when dealing with data labeled with a scheme which mixes pathologies, such as pneumonia, with patterns symptomatic of those pathologies, such as consolidation. The best approach to maximizing feature extraction and leveraging interdependencies among target labels likely entails training from data labeled with an ontology that inherently poses some consistent known relational structure. This will be the endpoint of a future study.
|
| 214 |
+
|
| 215 |
+
# REFERENCES
|
| 216 |
+
|
| 217 |
+
Yoshua Bengio and Samy Bengio. Modeling high-dimensional discrete data with multi-layer neural networks. In Advances in Neural Information Processing Systems, pp. 400–406, 2000.
|
| 218 |
+
|
| 219 |
+
Shang-Fu Chen, Yi-Chen Chen, Chih-Kuan Yeh, and Yu-Chiang Frank Wang. Order-free rnn with visual attention for multi-label classification. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017.
|
| 220 |
+
|
| 221 |
+
Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Hol- ¨ ger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. 2014.
|
| 222 |
+
|
| 223 |
+
Krzysztof Dembczynski, Willem Waegeman, and Eyke H ´ ullermeier. An analysis of chaining ¨ in multi-label classification. In Proceedings of the 20th European Conference on Artificial Intelligence, ECAI’12, pp. 294–299, Amsterdam, The Netherlands, The Netherlands, 2012. IOS Press. ISBN 978-1-61499-097-0. doi: 10.3233/978-1-61499-098-7-294. URL https: //doi.org/10.3233/978-1-61499-098-7-294.
|
| 224 |
+
|
| 225 |
+
J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR09, 2009.
|
| 226 |
+
|
| 227 |
+
Andre Esteva, Brett Kuprel, Roberto A Novoa, Justin Ko, Susan M Swetter, Helen M Blau, and Sebastian Thrun. Dermatologist-level classification of skin cancer with deep neural networks. Nature, 542(7639):115–118, 2017.
|
| 228 |
+
|
| 229 |
+
Karol Gregor, Ivo Danihelka, Andriy Mnih, Charles Blundell, and Daan Wierstra. Deep autoregressive networks. In International Conference on Machine Learning, pp. 1242–1250, 2014.
|
| 230 |
+
|
| 231 |
+
Varun Gulshan, Lily Peng, Marc Coram, Martin C Stumpe, Derek Wu, Arunachalam Narayanaswamy, Subhashini Venugopalan, Kasumi Widner, Tom Madams, Jorge Cuadros, et al. Development and validation of a deep learning algorithm for detection of diabetic retinopathy in retinal fundus photographs. Jama, 316(22):2402–2410, 2016.
|
| 232 |
+
|
| 233 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
|
| 234 |
+
|
| 235 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 236 |
+
|
| 237 |
+
Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017a.
|
| 238 |
+
|
| 239 |
+
Peng Huang, Seyoun Park, Rongkai Yan, Junghoon Lee, Linda C Chu, Cheng T Lin, Amira Hussien, Joshua Rathmell, Brett Thomas, Chen Chen, et al. Added value of computer-aided ct image features for early lung cancer diagnosis with small pulmonary nodules: A matched case-control study. Radiology, pp. 162725, 2017b.
|
| 240 |
+
|
| 241 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. 2015.
|
| 242 |
+
|
| 243 |
+
Paras Lakhani and Baskaran Sundaram. Deep learning at chest radiography: Automated classification of pulmonary tuberculosis by using convolutional neural networks. Radiology, pp. 162326, 2017.
|
| 244 |
+
|
| 245 |
+
Hugo Larochelle and Iain Murray. The neural autoregressive distribution estimator. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 29–37, 2011.
|
| 246 |
+
|
| 247 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 248 |
+
|
| 249 |
+
Yuncheng Li, Yale Song, and Jiebo Luo. Improving pairwise ranking for multi-label image classification. CoRR, abs/1704.03135, 2017. URL http://arxiv.org/abs/1704.03135.
|
| 250 |
+
|
| 251 |
+
Zachary C Lipton, David C Kale, Charles Elkan, and Randall Wetzell. Learning to diagnose with lstm recurrent neural networks. In International Conference on Learning Representations (ICLR), 2016.
|
| 252 |
+
|
| 253 |
+
Geert Litjens, Thijs Kooi, Babak Ehteshami Bejnordi, Arnaud Arindra Adiyoso Setio, Francesco Ciompi, Mohsen Ghafoorian, Jeroen AWM van der Laak, Bram van Ginneken, and Clara I Sanchez. A survey on deep learning in medical image analysis. ´ arXiv preprint arXiv:1702.05747, 2017.
|
| 254 |
+
|
| 255 |
+
Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3431–3440, 2015.
|
| 256 |
+
|
| 257 |
+
Fausto Milletari, Nassir Navab, and Seyed-Ahmad Ahmadi. V-net: Fully convolutional neural networks for volumetric medical image segmentation. In 3D Vision (3DV), 2016 Fourth International Conference on, pp. 565–571. IEEE, 2016.
|
| 258 |
+
|
| 259 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, pp. 311–318. Association for Computational Linguistics, 2002.
|
| 260 |
+
|
| 261 |
+
Adnan Qayyum, Syed Muhammad Anwar, Muhammad Majid, Muhammad Awais, and Majdi Alnowami. Medical image analysis using convolutional neural networks: A review. 2017.
|
| 262 |
+
|
| 263 |
+
Jesse Read, Bernhard Pfahringer, and Geoffrey Holmes. Multi-label classification using ensembles of pruned sets. In ICDM, pp. 995–1000. IEEE Computer Society, 2008. ISBN 978- 0-7695-3502-9. URL http://dblp.uni-trier.de/db/conf/icdm/icdm2008. html#ReadPH08.
|
| 264 |
+
|
| 265 |
+
Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pp. 234–241. Springer, 2015.
|
| 266 |
+
|
| 267 |
+
Dinggang Shen, Guorong Wu, and Heung-Il Suk. Deep learning in medical image analysis. Annual Review of Biomedical Engineering, (0), 2017.
|
| 268 |
+
|
| 269 |
+
Hoo-Chang Shin, Kirk Roberts, Le Lu, Dina Demner-Fushman, Jianhua Yao, and Ronald M Summers. Learning to read chest x-rays: recurrent neural cascade model for automated image annotation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2497–2506, 2016.
|
| 270 |
+
|
| 271 |
+
Rupesh Kumar Srivastava, Klaus Greff, and Jurgen Schmidhuber. Highway networks. ¨ ICML, 2015.
|
| 272 |
+
|
| 273 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pp. 3104–3112, 2014.
|
| 274 |
+
|
| 275 |
+
Grigorios Tsoumakas and Ioannis Vlahavas. Random k-labelsets: An ensemble method for multilabel classification. In Proceedings of the 18th European Conference on Machine Learning, ECML ’07, pp. 406–417, Berlin, Heidelberg, 2007. Springer-Verlag. ISBN 978-3-540- 74957-8. doi: 10.1007/978-3-540-74958-5 38. URL http://dx.doi.org/10.1007/ 978-3-540-74958-5_38.
|
| 276 |
+
|
| 277 |
+
Jiang Wang, Yi Yang, Junhua Mao, Zhiheng Huang, Chang Huang, and Wei Xu. Cnn-rnn: A unified framework for multi-label image classification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2285–2294, 2016.
|
| 278 |
+
|
| 279 |
+
Xiaosong Wang, Yifan Peng, Le Lu, Zhiyong Lu, Mohammadhadi Bagheri, and Ronald M Summers. Chestx-ray8: Hospital-scale chest $\mathbf { X }$ -ray database and benchmarks on weakly-supervised classification and localization of common thorax diseases. CVPR, 2017.
|
| 280 |
+
|
| 281 |
+
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhudinov, Rich Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In International Conference on Machine Learning, pp. 2048–2057, 2015.
|
| 282 |
+
|
| 283 |
+
Li Yao, Atousa Torabi, Kyunghyun Cho, Nicolas Ballas, Christopher Pal, Hugo Larochelle, and Aaron Courville. Describing videos by exploiting temporal structure. In Proceedings of the IEEE international conference on computer vision, pp. 4507–4515, 2015.
|
md/train/H1zriGeCZ/H1zriGeCZ.md
ADDED
|
@@ -0,0 +1,461 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HYPERPARAMETER OPTIMIZATION:A SPECTRAL APPROACH
|
| 2 |
+
|
| 3 |
+
Elad Hazan Princeton University and Google Brain ehazan@cs.princeton.edu
|
| 4 |
+
|
| 5 |
+
Adam Klivans Department of Computer Science University of Texas at Austin klivans@cs.utexas.edu
|
| 6 |
+
|
| 7 |
+
Yang Yuan
|
| 8 |
+
Department of Computer Science Cornell University
|
| 9 |
+
yangyuan@cs.cornell.edu
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
We give a simple, fast algorithm for hyperparameter optimization inspired by techniques from the analysis of Boolean functions. We focus on the high-dimensional regime where the canonical example is training a neural network with a large number of hyperparameters. The algorithm — an iterative application of compressed sensing techniques for orthogonal polynomials — requires only uniform sampling of the hyperparameters and is thus easily parallelizable.
|
| 14 |
+
|
| 15 |
+
Experiments for training deep neural networks on Cifar-10 show that compared to state-of-the-art tools (e.g., Hyperband and Spearmint), our algorithm finds significantly improved solutions, in some cases better than what is attainable by handtuning. In terms of overall running time (i.e., time required to sample various settings of hyperparameters plus additional computation time), we are at least an order of magnitude faster than Hyperband and Bayesian Optimization. We also outperform Random Search $8 \times$ .
|
| 16 |
+
|
| 17 |
+
Our method is inspired by provably-efficient algorithms for learning decision trees using the discrete Fourier transform. We obtain improved sample-complexty bounds for learning decision trees while matching state-of-the-art bounds on running time (polynomial and quasipolynomial, respectively).
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Large scale machine learning and optimization systems usually involve a large number of free parameters for the user to fix according to their application. A timely example is the training of deep neural networks for a signal processing application: the ML specialist needs to decide on an architecture, depth of the network, choice of connectivity per layer (convolutional, fully-connected, etc.), choice of optimization algorithm and recursively choice of parameters inside the optimization library itself (learning rate, momentum, etc.).
|
| 22 |
+
|
| 23 |
+
Given a set of hyperparameters and their potential assignments, the naive practice is to search through the entire grid of parameter assignments and pick the one that performed the best, a.k.a. “grid search”. As the number of hyperparameters increases, the number of possible assignments increases exponentially and a grid search becomes quickly infeasible. It is thus crucial to find a method for automatic tuning of these parameters.
|
| 24 |
+
|
| 25 |
+
This auto-tuning, or finding a good setting of these parameters, is now referred to as hyperparameter optimization (HPO), or simply automatic machine learning (auto-ML). For continuous hyperparameters, gradient descent is usually the method of choice (Maclaurin et al., 2015; Luketina et al., 2015; Fu et al., 2016). Discrete parameters, however, such as choice of architecture, number of layers, connectivity and so forth are significantly more challenging. More formally, let
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
f : \{ - 1 , 1 \} ^ { n } \mapsto [ 0 , 1 ]
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
be a function mapping hyperparameter choices to test error of our model. That is, each dimension corresponds to a certain hyperparameter (number of layers, connectivity, etc.), and for simplicity of illustration we encode the choices for each parameter as binary numbers $\{ - 1 , 1 \}$ . The goal of HPO is to approximate the minimizer $\begin{array} { r } { x ^ { * } = \arg \operatorname* { m i n } _ { x \in \{ 0 , 1 \} ^ { n } } f ( x ) } \end{array}$ in the following setting:
|
| 32 |
+
|
| 33 |
+
1. Oracle model: evaluation of $f$ for a given choice of hyperparameters is assumed to be very expensive. Such is the case of training a given architecture of a huge dataset. 2. Parallelism is crucial: testing several model hyperparameters in parallel is entirely possible in cloud architecture, and dramatically reduces overall optimization time. 3. $f$ is structured.
|
| 34 |
+
|
| 35 |
+
The third point is very important since clearly HPO is information-theoretically hard and $2 ^ { n }$ evaluations of the function are necessary in the worst case. Different works have considered exploiting one or more of the properties above. The approach of Bayesian optimization (Snoek et al., 2012) addresses the structure of $f$ , and assumes that a useful prior distribution over the structure of $f$ is known in advance. Multi-armed bandit algorithms (Li et al., 2016), and Random Search (Bergstra & Bengio, 2012), exploit computational parallelism very well, but do not exploit any particular structure of $f ^ { 1 }$ . These approaches are surveyed in more detail later.
|
| 36 |
+
|
| 37 |
+
# 1.1 OUR CONTRIBUTION
|
| 38 |
+
|
| 39 |
+
In this paper we introduce a new spectral approach to hyperparameter optimization. Our main idea is to make assumptions on the structure of $f$ in the Fourier domain. Specifically we assume that $f$ can be approximated by a sparse and low degree polynomial in the Fourier basis. This means intuitively that it can be approximated well by a decision tree.
|
| 40 |
+
|
| 41 |
+
The implication of this assumption is that we can obtain a rigorous theoretical guarantee: approximate minimization of $f$ over the boolean hypercube with function evaluations only linear in sparsity that can be carried out in parallel. We further give improved heuristics on this basic construction and show experiments showing our assumptions are validated in practice for HPO as applied to deep learning over image datasets.
|
| 42 |
+
|
| 43 |
+
Thus our contributions can be listed as:
|
| 44 |
+
|
| 45 |
+
• A new spectral method called Harmonica that has provable guarantees: sample-efficient recovery if the underlying objective is a sparse (noisy) polynomial and easy to implement on parallel architectures. We demonstrate significant improvements in accuracy, sample complexity, and running time for deep neural net training experiments. We compare ourselves to state-of-the-art solvers from Bayesian optimization, Multi-armed bandit techniques, and Random Search. Projecting to even higher numbers of hyperparameters, we perform simulations that show several orders-of-magnitude of speedup versus Bayesian optimization techniques. Improved bounds on the sample complexity of learning noisy, size $s$ decision trees over $n$ variables under the uniform distribution. We observe that the classical sample complexity bound of $n ^ { O ( \log ( s / \varepsilon ) ) }$ due to Linial et al. (1993) can be improved to quadratic in the size of the tree ${ \tilde { O } } ( s ^ { 2 } / \varepsilon \cdot \log n )$ while matching the best known quasipolynomial bound in running time.
|
| 46 |
+
|
| 47 |
+
# 1.2 PREVIOUS WORK
|
| 48 |
+
|
| 49 |
+
The literature on discrete-domain HPO can be roughly divided into two: probabilistic approaches and decision-theoretic methods. In critical applications, researchers usually use a grid search over all parameter space, but that becomes quickly prohibitive as the number of hyperparameter grows. Gradient-based methods such as (Maclaurin et al., 2015; Luketina et al., 2015; Fu et al., 2016; Bengio, 2000) are applicable only to continuous hyperparameters which we do not consider. Neural network structural search based on reinforcement learning is an active direction (Baker et al., 2016; Zoph & Le, 2016; Zhong et al., 2017), which usually needs many samples of network architectures. 1 except that they could implicitly utilize smoothness or other local properties of the space.
|
| 50 |
+
|
| 51 |
+
Probabilistic methods and Bayesian optimization. Bayesian optimization (BO) algorithms (Bergstra et al., 2011; Snoek et al., 2012; Swersky et al., 2013; Snoek et al., 2014; Gardner et al., 2014; Wang et al., 2013; Ilievski et al., 2017) tune hyperparameters by assuming a prior distribution of the loss function, and then keep updating this prior distribution based on the new observations. Each new observation is selected according to an acquisition function, which balances exploration and exploitation such that the new observation gives us a better result, or helps gain more information. The BO approach is inherently serial and difficult to parallelize, and its theoretical guarantees have thus far been limited to statistical consistency (convergence in the limit).
|
| 52 |
+
|
| 53 |
+
Decision-theoretic methods. Perhaps the simplest approach to HPO is random sampling of different choices of parameters and picking the best amongst the chosen evaluations (Bergstra & Bengio, 2012). It is naturally very easy to implement and parallelize. Upon this simple technique, researchers have tried to allocate different budgets to the different evaluations, depending on their early performance. Using adaptive resource allocation techniques found in the multi-armed bandit literature, Successive Halving (SH) algorithm was introduced (Jamieson & Talwalkar, 2016). Hyperband further improves SH by automatically tuning the hyperparameters in SH (Li et al., 2016).
|
| 54 |
+
|
| 55 |
+
Learning decision trees. Prior work for learning decision trees (more generally Boolean functions that are approximated by low-degree polynomials) used the celebrated “low-degree” algorithm of Linial et al. (1993). Their algorithm uses random sampling to estimate each low-degree Fourier coefficient to high accuracy.
|
| 56 |
+
|
| 57 |
+
We make use of the approach of Stobbe & Krause (2012), who showed how to learn low-degree, sparse Boolean functions using tools from compressed sensing (similar approaches were taken by Kocaoglu et al. (2014) and Negahban & Shah (2012)). We observe that their approach can be extended to learn functions that are both “approximately sparse” (in the sense that the $L _ { 1 }$ norm of the coefficients is bounded) and “approximately low-degree” (in the sense that most of the $L _ { 2 }$ mass of the Fourier spectrum resides on monomials of low-degree). This implies the first decision tree learning algorithm with polynomial sample complexity that handles adversarial noise. In addition, we obtain the optimal dependence on the error parameter $\varepsilon$ .
|
| 58 |
+
|
| 59 |
+
For the problem of learning exactly $k$ -sparse Boolean functions over $n$ variables, Haviv & Regev (2015) have recently shown that $O ( n k \log n )$ uniformly random samples suffice. Their result is not algorithmic but does provide an upper bound on the information-theoretic problem of how many samples are required to learn. The best algorithm in terms of running time for learning $k$ -sparse Boolean functions is due to Feldman et al. (2009), and requires time $2 ^ { { \bar { \Omega } } ( n / \log n ) }$ . It is based on the Blum et al. (2003) algorithm for learning parities with noise.
|
| 60 |
+
|
| 61 |
+
Techniques. Our methods are heavily based on known results from the analysis of boolean functions as well as compressed sensing.
|
| 62 |
+
|
| 63 |
+
# 2 SETUP AND DEFINITIONS
|
| 64 |
+
|
| 65 |
+
The problem of hyperparameter optimization is that of minimizing a discrete, real-valued function, which we denote by $f : \{ - 1 , 1 \} ^ { n } \mapsto [ - 1 , 1 ]$ (we can handle arbitrary inputs, binary is chosen for simplicity of presentation).
|
| 66 |
+
|
| 67 |
+
In the context of hyperparameter optimization, function evaluation is very expensive, although parallelizable, as it corresponds to training a deep neural net. In contrast, any computation that does not involve function evaluation is considered less expensive, such as computations that require time $\Omega ( n ^ { d } )$ for “somewhat large” $d$ or are subexponential (we still consider runtimes that are exponential in $n$ to be costly).
|
| 68 |
+
|
| 69 |
+
# 2.1 BASICS OF FOURIER ANALYSIS
|
| 70 |
+
|
| 71 |
+
The reader is referred to O’Donnell (2014) for an in depth treatment of Fourier analysis of Boolean functions. Let $f : \mathcal { X } \mapsto [ - 1 , 1 ]$ be a function over domain $\mathcal { X } \subseteq \mathbb { R } ^ { n }$ . Let $\mathcal { D }$ a probability distribution on $\mathcal { X }$ . We write $g \equiv _ { \varepsilon } f$ and say that $f , g$ are $\varepsilon$ -close if $\begin{array} { r } { \mathbb { E } _ { x \sim \mathcal { D } } [ ( f ( x ) - g ( x ) ) ^ { \bar { 2 } } ] \le \varepsilon } \end{array}$ .
|
| 72 |
+
|
| 73 |
+
Definition 1. (Rauhut, 2010) We say a family of functions $\psi _ { 1 } , \ldots , \psi _ { N }$ ( $\psi _ { i }$ maps $\mathcal { X }$ to $\mathbb { R }$ ) is a Random Orthonormal Family with respect to $\mathcal { D }$ if
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\mathbb { E } _ { \mathcal { D } } [ \psi _ { i } ( X ) \cdot \psi _ { j } ( X ) ] = \delta _ { i j } = \left\{ \begin{array} { l l } { 1 } & { \mathrm { ~ i f ~ } i = j } \\ { 0 } & { \mathrm { ~ o t h e r w i s e } } \end{array} \right. .
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
The expectation is taken with respect to probability distribution $\mathcal { D }$ . We say that the family is $K$ - bounded if $\begin{array} { r } { \operatorname* { s u p } _ { x \in \mathcal { X } } | \psi _ { i } ( x ) | \le K } \end{array}$ for every $i$ . Henceforth we assume $K = 1$ .
|
| 80 |
+
|
| 81 |
+
An important example of a random orthonormal family is the class of parity functions with respect to the uniform distribution on $\{ - 1 , 1 \} ^ { n }$ :
|
| 82 |
+
|
| 83 |
+
Definition 2. A parity function on some subset of variables $S \subseteq [ n ]$ is the function $\chi _ { S } : \{ - 1 , 1 \} ^ { n } \mapsto$ $\{ - 1 , 1 \}$ where $\begin{array} { r } { \bar { \chi } _ { S } ( x ) = \prod _ { i \in S } x _ { i } } \end{array}$ .
|
| 84 |
+
|
| 85 |
+
It is easy to see that the set of all $2 ^ { n }$ parity functions $\{ \chi _ { S } \}$ , one for each $S \subseteq [ n ]$ , form a random orthonormal family with respect to the uniform distribution on $\{ - 1 , 1 \} ^ { n }$ .
|
| 86 |
+
|
| 87 |
+
This random orthonormal family is often referred to as the Fourier basis, as it is a complete orthonormal basis for the class of Boolean functions with respect to the uniform distribution on $\{ - 1 , 1 \} ^ { n }$ . More generally, for any $f : \{ - 1 , 1 \} ^ { n } \mapsto \mathbb { R }$ , $f$ can be uniquely represented in this basis as $\begin{array} { r } { f ( x ) = \sum _ { S \subseteq [ n ] } \hat { f } _ { S } \chi _ { S } ( x ) } \end{array}$ where $\hat { f } _ { S } = \langle f , \chi _ { S } \rangle = \mathbb { E } _ { x \in \{ - 1 , 1 \} ^ { n } } [ f ( x ) \chi _ { S } ( x ) ]$ is the Fourier coefficient corresponding to $S$ where $x$ is drawn uniformly from $\{ - 1 , 1 \} ^ { n }$ . We also have Parseval’s identity: $\begin{array} { r } { \mathbb { E } [ f ^ { 2 } ] = \sum _ { S } \hat { f } _ { S } ^ { 2 } } \end{array}$ .
|
| 88 |
+
|
| 89 |
+
In this paper, we will work exclusively with the above parity basis. Our results apply more generally, however, to any orthogonal family of polynomials (and corresponding product measure on $\mathbb { R } ^ { n }$ ). For example, if we wished to work with continuous hyperparameters, we could work with families of Hermite orthogonal polynomials with respect to multivariate spherical Gaussian distributions.
|
| 90 |
+
|
| 91 |
+
We conclude with a definition of low-degree, approximately sparse (bounded $L _ { 1 }$ norm) functions:
|
| 92 |
+
|
| 93 |
+
Definition 3 (Approximately sparse function). Let $\{ \chi _ { S } \}$ be the parity basis, and let $\mathcal { C }$ be a class of functions mapping $\{ - 1 , 1 \} ^ { n }$ to $\mathbb { R }$ . Thus for $f \in { \mathcal { C } }$ , $\begin{array} { r } { f = \sum _ { S } \hat { f } ( S ) \chi _ { S } } \end{array}$ . We say a function $f \in C$ is $s$ -sparse if $L _ { 0 } ( f ) ~ \le ~ s$ , ie., f has at most $s$ nonzero entries in its polynomial expansion. $f$ is $( \varepsilon , d )$ -concentrated if $\begin{array} { r } { \mathbb { E } [ ( f - \sum _ { S , | S | } \le _ { d } \hat { f } ( S ) \chi _ { S } ) ^ { 2 } ] \ge 1 - \varepsilon . { \mathcal C } } \end{array}$ is $( \varepsilon , d , s )$ -bounded if for every $f \in { \mathcal { C } }$ , $f$ is $( \varepsilon , d )$ -concentrated and in addition $\mathcal { C }$ has $L _ { 1 }$ norm bounded by $s$ , that is, for every $f \in { \mathcal { C } }$ we have $\Sigma _ { S } \left| \hat { f } ( S ) \right| \le s$ .
|
| 94 |
+
|
| 95 |
+
It is easy to see that the class of functions with bounded $L _ { 1 }$ norm is more general than sparse functions. For example, the Boolean AND function has $L _ { 1 }$ norm bounded by 1 but is not sparse.
|
| 96 |
+
|
| 97 |
+
We also have the following simple fact:
|
| 98 |
+
|
| 99 |
+
Fact 4. (Mansour, 1994) Let $f$ be such that $L _ { 1 } ( f ) ~ \leq ~ s .$ . Then there exists $g$ such that $g$ is $s ^ { 2 } / \varepsilon$ sparse and $E [ ( f - g ) ^ { 2 } ] \ \leq \ \varepsilon .$ . The function $g$ is constructed by taking all coefficients of magnitude $\varepsilon / s$ or larger in $f$ ’s expansion as a polynomial.
|
| 100 |
+
|
| 101 |
+
# 2.2 COMPRESSED SENSING AND SPARSE RECOVERY
|
| 102 |
+
|
| 103 |
+
In the problem of sparse recovery, a learner attempts to recover a sparse vector $x \in \mathbb { R } ^ { n }$ which is $s$ sparse, i.e. $\| x \| _ { 0 } ~ \leq ~ s$ , from an observation vector $y \in R ^ { m }$ that is assumed to equal $y =$ $A x + e$ , where $e$ is assumed to be zero-mean, usually Gaussian, noise. The seminal work of Candes et al. (2006); Donoho (2006) shows how $x$ can be recovered exactly under various conditions on the observation matrix $A \in \mathbb { R } ^ { m \times n }$ and the noise. The usual method for recovering the signal proceeds by solving a convex optimization problem consisting of $\ell _ { 1 }$ minimization as follows (for some parameter $\lambda > 0$ ):
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\operatorname* { m i n } _ { x \in \mathbb { R } ^ { n } } \left\{ \| x \| _ { 1 } + \lambda \| A x - y \| _ { 2 } ^ { 2 } \right\} .
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
The above formulation comes in many equivalent forms (e.g., Lasso), where one of the objective parts may appear as a hard constraint.
|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 1: Compressed sensing over the Fourier domain: Harmonica recovers the Fourier coefficients of a sparse low degree polynomial $\textstyle \sum _ { S } \alpha _ { S } \Psi _ { S } ( x _ { i } )$ from observations $f ( x _ { i } )$ of randomly chosen points $x _ { i } \in$ $\{ - 1 , 1 \} ^ { n }$ .
|
| 113 |
+
|
| 114 |
+
For our work, the most relevant extension of traditional sparse recovery is due to Rauhut (2010), who considers the problem of sparse recovery when the measurements are evaluated according to a random orthonormal family. More concretely, fix $x \in \mathbb { R } ^ { n }$ with $s$ non-zero entries. For $K$ - bounded random orthonormal family $\mathcal { F } = \{ \psi _ { 1 } , . . . , \psi _ { N } \}$ , and $m$ independent draws $z ^ { 1 } , \ldots , z ^ { m }$ from corresponding distribution $\mathcal { D }$ define the $m \times N$ matrix $A$ such that $A _ { i j } = \psi _ { j } ( z ^ { i } )$ . Rauhut gives the following result for recovering sparse vectors $x$ :
|
| 115 |
+
|
| 116 |
+
Theorem 5 (Sparse Recovery for Random Orthonormal Families, (Rauhut, 2010) Theorem 4.4). Given as input matrix √ $A \ \in \ \mathbb { R } ^ { m \times N }$ and vector $y$ with $y _ { i } ~ = ~ A x + e _ { i }$ for some vector e with $\| e \| _ { 2 } ~ \le ~ \bar { \eta \sqrt { m } } ,$ , mathematical program (1) finds a vector $x ^ { * }$ such that for constants $c _ { 1 }$ and $c _ { 2 }$ , $\begin{array} { r } { \| x - x ^ { * } \| _ { 2 } \ \leq \ c _ { 1 } \frac { \sigma _ { s } ( x ) _ { 1 } } { \sqrt { s } } + c _ { 2 } \eta } \end{array}$ with probability $1 - \delta$ as long as for sufficiently large constant $C _ { i }$ , $m \ge C K ^ { 2 } \log K \cdot s \log ^ { 3 } s \cdot \log ^ { 2 } N \cdot \log ( 1 / \delta )$ .
|
| 117 |
+
|
| 118 |
+
The term $\sigma _ { s } ( x ) _ { 1 }$ is equal to $\operatorname* { m i n } \{ \| x - z \| _ { 1 } , z$ is $s$ sparse}. Recent work (Bourgain, 2014; Haviv & Regev, 2016) has improved the dependence on the polylog factors in the lower bound for $m$ .
|
| 119 |
+
|
| 120 |
+
# 3 BASIC ALGORITHM AND MAIN THEORETICAL RESULTS
|
| 121 |
+
|
| 122 |
+
The main component of our spectral algorithm for hyperparameter optimization is given in Algorithm $1 ^ { 2 }$ . It is essentially an extension of sparse recovery (basis pursuit or Lasso) to the orthogonal basis of polynomials in addition to an optimization step. See Figure 1 for an illustration. We prove Harmonica’s theoretical guarantee, and show how it gives rise to new theoretical results in learning from the uniform distribution.
|
| 123 |
+
|
| 124 |
+
In the next section we describe extensions of this basic algorithm to a more practical algorithm with various heuristics to improve its performance.
|
| 125 |
+
|
| 126 |
+
# Algorithm 1 Harmonica-1
|
| 127 |
+
|
| 128 |
+
1: Input: oracle for $f$ , number of samples $T$ , sparsity $s$ , degree $d$ , parameter $\lambda$ .
|
| 129 |
+
2: Invoke $\mathrm { P S R } ( f , T , s , d , \lambda )$ (Procedure 2) to obtain $( g , J )$ , where $g$ is a function defined on vari
|
| 130 |
+
ables specified by index set $J \subseteq [ n ]$ .
|
| 131 |
+
3: Set the variables in $[ n ] \mid J$ to arbitrary values, compute a minimizer $x ^ { \star } \in \arg \operatorname* { m i n } g ( x )$ .
|
| 132 |
+
4: return $x ^ { \star }$
|
| 133 |
+
|
| 134 |
+
Theorem 6 (Noiseless recovery). Let $\{ \psi _ { S } \}$ be a 1-bounded orthonormal polynomial basis for distribution $\mathcal { D }$ . Let $f : \mathbb { R } ^ { n } \mapsto \mathbb { R }$ be a $( 0 , d , s )$ -bounded function as per definition $^ 3$ with respect to the basis $\psi _ { S }$ . Then Algorithm $^ { l }$ , in time $n ^ { O ( d ) }$ and sample complexity $T = { \tilde { O } } ( s \cdot d \log n )$ , returns $x ^ { \star }$ such that $x ^ { \star } \in \arg \operatorname* { m i n } f ( x )$ .
|
| 135 |
+
|
| 136 |
+
This theorem, and indeed most of the results in this paper, follows from the main recovery properties of Procedure 2. This recovery procedure satisfies the following main lemma. See its proof in Section A.1.
|
| 137 |
+
|
| 138 |
+
Lemma 7 (Noisy recovery). Let $\{ \psi _ { S } \}$ be a 1-bounded orthonormal polynomial basis for distribution $\mathcal { D }$ . Let $f ~ : ~ \mathbb { R } ^ { n } \ \mapsto \ \mathbb { R }$ be a $( \varepsilon / 4 , d , s )$ -bounded as per definition 3 with respect to the
|
| 139 |
+
|
| 140 |
+
# Procedure 2 Polynomial Sparse Recovery (PSR)
|
| 141 |
+
|
| 142 |
+
1: Input: oracle for $f$ , number of samples $T$ , sparsity $s$ , degree $d$ , regularization parameter $\lambda$
|
| 143 |
+
2: Query $T$ random samples: $\{ f ( x _ { 1 } ) , . . . . , f ( x _ { T } ) \}$ .
|
| 144 |
+
|
| 145 |
+
3: Solve sparse $d$ -polynomial regression over all polynomials up to degree $d$
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\arg \operatorname* { m i n } _ { \alpha \in \mathbb { R } ^ { \left( \frac { n } { d } \right) } } \left\{ \sum _ { i = 1 } ^ { T } \left( \sum _ { | S | \leq d } \alpha _ { S } \psi _ { S } ( x _ { i } ) - f ( x _ { i } ) \right) ^ { 2 } + \lambda \| \alpha \| _ { 1 } \right\}
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
4: Let $S _ { 1 } , . . . , S _ { s }$ be the indices of the largest coefficients of $\vec { \alpha }$ .
|
| 152 |
+
|
| 153 |
+
5: return $\begin{array} { r } { g \triangleq \sum _ { i \in [ s ] } \alpha _ { S _ { i } } \psi _ { S _ { i } } ( x ) } \end{array}$ and $J = \cup _ { i = 1 } ^ { s } S _ { i }$ basis $\psi _ { S }$ . Then Procedure 2 finds a function $\begin{array} { l l } { \boldsymbol { \mathit { g } } } & { \equiv _ { \varepsilon } } & { \boldsymbol { \mathit { f } } } \end{array}$ in time $O ( n ^ { d } )$ and sample complexity $T = \tilde { O } ( s ^ { 2 } / \varepsilon \cdot d \log n )$ .
|
| 154 |
+
|
| 155 |
+
Remark: Note that the above Lemma also holds in the adversarial or agnostic noise setting. That is, an adversary could add a noise vector $v$ to the labels received by the learner. In this case, the learner will see label vector $y = A x + e + v$ . If $\| v \| _ { 2 } ~ \le ~ \sqrt { \gamma m }$ , then we will recover a polynomial with squared-error at most $\varepsilon + O ( \gamma )$ via re-scaling $\varepsilon$ by a constant factor and applying the triangle inequality to $\lVert e + v \rVert _ { 2 }$ .
|
| 156 |
+
|
| 157 |
+
While this noisy recovery lemma is the basis for our enhanced algorithm in the next section as well as the learning-theoretic result on learning of decision trees detailed in the next subsection, it does not imply recovery of the global optimum. The reason is that noisy recovery guarantees that we output a hypothesis close to the underlying function, but even a single noisy point can completely change the optimum.
|
| 158 |
+
|
| 159 |
+
Nevertheless, we can use our techniques to prove recovery of optimality for functions that are computed exactly by a sparse, low-degree polynomial (Theorem 6). See the proof in Section A.2.
|
| 160 |
+
|
| 161 |
+
# 3.1 APPLICATION: LEARNING DECISION TREES IN QUASI-POLYNOMIAL TIME AND POLYNOMIAL SAMPLE COMPLEXITY
|
| 162 |
+
|
| 163 |
+
Lemma 7 has important applications for learning (in the PAC model (Valiant, 1984)) well-studied function classes with respect to the uniform distribution on $\{ - 1 , 1 \} ^ { n 3 }$ . For example, we obtain the first quasi-polynomial time algorithm for learning decision trees with respect to the uniform distribution on $\bar { \{ - 1 , 1 \} } ^ { n }$ with polynomial sample complexity:
|
| 164 |
+
|
| 165 |
+
Corollary 8. Let $\mathcal { X } = \{ - 1 , 1 \} ^ { n }$ and let $\mathcal { C }$ be the class of all decision trees of size s on n variables. Then $\mathcal { C }$ is learnable with respect to the uniform distribution in time $n ^ { O ( \log ( s / \varepsilon ) ) }$ and sample complexity $m = \tilde { O } ( s ^ { 2 } / \varepsilon \cdot \log n )$ . Further, if the labels are corrupted by arbitrary noise vector $v$ such that $\| v \| _ { 2 } ~ \le ~ \sqrt { \gamma m }$ , then the output classifier will have squared-error at most $\varepsilon + O ( \gamma )$ .
|
| 166 |
+
|
| 167 |
+
See the proof of Corollary 8 in Section A.3.
|
| 168 |
+
|
| 169 |
+
Comparison with the “Low-Degree” Algorithm. Prior work for learning decision trees (more generally Boolean functions that are approximated by low-degree polynomials) used the celebrated “low-degree” algorithm of Linial et al. (1993). Their algorithm uses random sampling to estimate each low-degree Fourier coefficient to high accuracy. In contrast, our approach is to use algorithms for compressed sensing to estimate the coefficients. Tools for compressed sensing take advantage of the incoherence of the design matrix and give improved results that seem unattainable from the “low-degree” algorithm.
|
| 170 |
+
|
| 171 |
+
For learning noiseless, Boolean decision trees, the low-degree algorithm uses quasipolynomial time and sample complexity ${ \tilde { O } } ( s ^ { 2 } / \varepsilon ^ { 2 } \cdot \log n )$ to learn to accuracy $\varepsilon$ . It is not clear, however, how to obtain any noise tolerance from their approach.
|
| 172 |
+
|
| 173 |
+
For general real-valued decision trees where $B$ is an upper bound on the maximum value at any leaf of a size $s$ tree, our algorithm will succeed with sample complexity $\tilde { O } ( B ^ { 2 } s ^ { 2 } / \varepsilon \cdot \log n )$ and be tolerant to noise while the low-degree algorithm will use $\bar { \tilde { O } } ( B ^ { 4 } s ^ { 2 } \bar { / } \varepsilon ^ { 2 } \cdot \mathrm { l o g } n )$ (and will have no noise tolerance properties). Note our improvement in the dependence on $\varepsilon$ (even in the noiseless setting), which is a consequence of the RIP property of the random orthonormal family.
|
| 174 |
+
|
| 175 |
+
# 4 HARMONICA: THE FULL ALGORITHM
|
| 176 |
+
|
| 177 |
+
Rather than applying Algorithm 1 directly, we found that performance is greatly enhanced by iteratively using Procedure 2 to estimate the most influential hyperparameters and their optimal values.
|
| 178 |
+
|
| 179 |
+
In the rest of this section we describe this iterative heuristic, which essentially runs Algorithm 1 for multiple stages. More concretely, we continue to invoke the PSR subroutine until the search space becomes small enough for us to use a “base” hyperparameter optimizer (in our case either SH or Random Search).
|
| 180 |
+
|
| 181 |
+
The space of minimizing assignments to a multivariate polynomial is a highly non-convex set that may contain many distinct points. As such, we take an average of several of the best minimizers (of subsets of hyperparameters) during each stage.
|
| 182 |
+
|
| 183 |
+
In order to describe this formally we need the following definition of a restriction of function:
|
| 184 |
+
|
| 185 |
+
Definition 9 (restriction (O’Donnell, 2014)). Let $f \in \{ - 1 , 1 \} ^ { n } \mapsto \mathbb { R }$ , $J \subseteq [ n ]$ , and $z \in \{ - 1 , 1 \} ^ { J }$ be given. We call $( J , z )$ a restriction pair of function $f$ . We denote $f _ { J , z }$ the function over $n - | J |$ variables given by setting the variables of $J$ to $z$ .
|
| 186 |
+
|
| 187 |
+
We can now describe our main algorithm (Algorithm 3). Here $q$ is the number of stages for which we apply the PSR subroutine, and the restriction size $t$ serves as a tie-breaking rule for the best minimizers (which can be set to 1).
|
| 188 |
+
|
| 189 |
+
# Algorithm 3 Harmonica- $q$
|
| 190 |
+
|
| 191 |
+
1: Input: oracle for $f$ , number of samples $T$ , sparsity $s$ , degree $d$ , regularization parameter $\lambda$ ,
|
| 192 |
+
number of stages $q$ , restriction size $t$ , base hyperparameter optimizer ALG.
|
| 193 |
+
2: for stage $i = 1$ to $q$ do
|
| 194 |
+
3: Invoke $\mathrm { P S R } ( f , T , s , d , \lambda )$ (Procedure 2) to obtain $( g _ { i } , J _ { i } )$ , where $g _ { i }$ is a function defined on
|
| 195 |
+
variables specified by index set $J _ { i } \subseteq [ n ]$ .
|
| 196 |
+
4: Let $M _ { i } = \left\{ x _ { 1 } ^ { \star } , . . . , x _ { t } ^ { \star } \right\} = \arg \operatorname* { m i n } g _ { i } ( x )$ be the best $t$ minimizers of $g _ { i }$ .
|
| 197 |
+
5: Let $f _ { i } = \mathbb { E } _ { k \in [ t ] } [ f _ { J _ { i } , x _ { k } ^ { \star } } ]$ be the expected restriction of $f$ according to minimizers $M _ { i }$ . 4
|
| 198 |
+
6: Set $f = f _ { i }$ .
|
| 199 |
+
7: end for
|
| 200 |
+
8: return Search for the global minimizer of $f _ { q }$ using base optimizer ALG
|
| 201 |
+
|
| 202 |
+
We defer the comparison of Harmonica and other algorithms in Section B.
|
| 203 |
+
|
| 204 |
+
# 5 EXPERIMENTS WITH TRAINING DEEP NETWORKS
|
| 205 |
+
|
| 206 |
+
We compare Harmonica5 with Spearmint6 (Snoek et al., 2012), Hyperband, $\mathrm { S H } ^ { 7 }$ and Random Search. Both Spearmint and Hyperband are state-of-the-art algorithms, and it is observed that Random Search $2 \mathbf { x }$ (Random Search with doubled function evaluation resources) is a very competitive benchmark that beats many algorithms8.
|
| 207 |
+
|
| 208 |
+
Our first experiment is over training residual network on Cifar-10 dataset9. We included 39 binary hyperparameters, including initialization, optimization method, learning rate schedule, momentum rate, etc. Table 1 (Section C.1) details the hyperparameters considered. We also include 21 dummy variables to make the task more challenging. Notice that Hyperband, SH, and Random Search are agnostic to the dummy variables in the sense that they just set the value of dummy variables randomly, therefore select essentially the same set of configurations with or without the dummy variables. Only Harmonica and Spearmint are sensitive to the dummy variables as they try to learn the high dimensional function space. To make a fair comparison, we run Spearmint without any dummy variables.
|
| 209 |
+
|
| 210 |
+

|
| 211 |
+
Figure 2: Distribution of the best results and running time of different algorithms
|
| 212 |
+
|
| 213 |
+

|
| 214 |
+
Figure 3: Comparing different variants of Harmonica with SH on test error and running time
|
| 215 |
+
|
| 216 |
+
As most hyperparameters have a consistent effect as the network becomes deeper, a common handtuning strategy is “tune on small network, then apply the knowledge to big network” (See discussion in Section C.3). Harmonica can also exploit this strategy as it selects important features stageby-stage. More specifically, during the feature selection stages, we run Harmonica for tuning an 8 layer neural network with 30 training epochs. At each stage, we take 300 samples to extract 5 important features, and set restriction size $t \ : = \ : 4$ (see Procedure 2). After that, we fix all the important features, and run the SH or Random Search as our base algorithm on the big 56 layer neural network for training the whole 160 epochs10. To clarify, “stage” means the stages of the hyperparameter algorithms, while “epoch” means the epochs for training the neural network.
|
| 217 |
+
|
| 218 |
+
# 5.1 PERFORMANCE
|
| 219 |
+
|
| 220 |
+
We tried three versions of Harmonica for this experiment, Harmonica with 1 stage (Harmonica-1), 2 stages (Harmonica-2) and 3 stages (Harmonica-3). All of them use SH as the base algorithm. The top 10 test error results and running times of the different algorithms are depicted in Figure 2. SH based algorithms may return fewer than 10 results. For more runs of variants of Harmonica and its resulting test error, see Figure 3 (the results are similar to Figure 2).
|
| 221 |
+
|
| 222 |
+
Test error and scalability: Harmonica-1 uses less than $1 / 5$ time of Spearmint, $1 / 7$ time of Hyperband and $1 / 8$ time compared with Random Search, but gets better results than the competing algorithms. It beats the Random Search 8x benchmark (stronger than Random Search $2 \mathbf { x }$ benchmark of Li et al. (2016)). Harmonica-2 uses slightly more time, but is able to find better results.
|
| 223 |
+
|
| 224 |
+
Improving upon human-tuned parameters: Harmonica-3 obtains a better test error $( 6 . 5 8 \% )$ ) as compared to the best hand-tuning rate $6 . 9 7 \%$ reported in (He et al., 2016)11. Harmonica-3 uses only 6.1 GPU days, which is less than half day in our environment, as we have 20 GPUs running in parallel. Notice that we did not cherry pick the results for Harmonica-3. In Section 5.3 we show by running Harmonica-3 for longer time, one can obtain a few other solutions better than hand tuning.
|
| 225 |
+
|
| 226 |
+
Performance of provable methods: Harmonica-1 has noiseless and noisy recovery guarantees (Lemma 7), which are validated experimentally.
|
| 227 |
+
|
| 228 |
+
# 5.2 AVERAGE TEST ERROR FOR EACH STAGE
|
| 229 |
+
|
| 230 |
+
We computed the average test error among 300 random samples for an 8 layer network with 30 epochs after each stage. See Figure 4 in Appendix. After selecting 5 features in stage 1, the average test error drops from 60.16 to 33.3, which indicates the top 5 features are very important. As we proceed to stage 3, the improvement on test error becomes less significant as the selected features at stage 3 have mild contributions.
|
| 231 |
+
|
| 232 |
+
# 5.3 HYPERPARAMETERS FOR HARMONICA
|
| 233 |
+
|
| 234 |
+
To be clear, Harmonica itself has six hyperparameters that one needs to set including the number of stages, $\ell _ { 1 }$ regularizer for Lasso, the number of features selected per stage, base algorithm, small network configuration, and the number of samples per stage. Note, however, that we have reduced the search space of general hyperparameter optimization down to a set of only six hyperparameters. Empirically, our algorithm is robust to different settings of these parameters, and we did not even attempt to tune some of them (e.g., small network configuration).
|
| 235 |
+
|
| 236 |
+
Base algorithm and #stages. We tried different versions of Harmonica, including Harmonica with 1 stage, 2 stages and 3 stages using SH as the base algorithm (Harmonica-1, Harmonica-2, Harmonica-3), with 1 stage and 2 stages using Random Search as the base algorithm (Harmonica-1- Random-Search, Harmonica-2-Random-Search), and with 2 stages and 3 stages running SH as the base for longer time (Harmonica-2-Long, Harmonica-3-Long). As can be seen in Figure 3, most variants produce better results than SH and use less running time. Moreover, if we run SH for longer time, we will obtain more stable solutions with less variance in test error.
|
| 237 |
+
|
| 238 |
+
Lasso parameters are stable. See Table 3 in Appendix for stable range for regularization term $\lambda$ and the number of samples. Here stable range means as long as the parameters are set in this range, the top 5 features and the signs of their weights (which are what we need for computing $g ( x )$ in Procedure 2) do not change. In other words, the feature selection outcome is not affected. When parameters are outside the stable ranges, usually the top features are still unchanged, and we miss only one or two out of the five features.
|
| 239 |
+
|
| 240 |
+
On the degree of features. We set degree to be three because it does not find any important features with degree larger than this. Since Lasso can be solved efficiently (less than 5 minutes in our experiments), the choice of degree can be decided automatically.
|
| 241 |
+
|
| 242 |
+
# 5.4 EXPERIMENTS WITH SYNTHETIC FUNCTIONS
|
| 243 |
+
|
| 244 |
+
Our second experiment considers a synthetic hierarchically bounded function $h ( x )$ . In this experiment, we showed that the optimization time of Harmonica is significantly faster than Spearmint, and the estimation error of Harmonica is linear in the noise level of the function. See Section C.4 for details.
|
| 245 |
+
|
| 246 |
+
# 6 ACKNOWLEDGEMENTS
|
| 247 |
+
|
| 248 |
+
We thank Sanjeev Arora for helpful discussions and encouragement. We thank anonymous reviewers for their helpful comments. Elad Hazan is supported by NSF grant 1523815. This project is supported by a Microsoft Azure research award and Amazon AWS research award.
|
| 249 |
+
|
| 250 |
+
# REFERENCES
|
| 251 |
+
|
| 252 |
+
Bowen Baker, Otkrist Gupta, Nikhil Naik, and Ramesh Raskar. Designing neural network architectures using reinforcement learning. CoRR, abs/1611.02167, 2016.
|
| 253 |
+
|
| 254 |
+
Yoshua Bengio. Gradient-based optimization of hyperparameters. Neural Computation, 12(8): 1889–1900, 2000.
|
| 255 |
+
|
| 256 |
+
James Bergstra and Yoshua Bengio. Random search for hyper-parameter optimization. J. Mach. Learn. Res., 13:281–305, February 2012. ISSN 1532-4435.
|
| 257 |
+
|
| 258 |
+
James S. Bergstra, Remi Bardenet, Yoshua Bengio, and Bal ´ azs K ´ egl. Algorithms for hyper- ´ parameter optimization. In J. Shawe-Taylor, R. S. Zemel, P. L. Bartlett, F. Pereira, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 24, pp. 2546–2554. Curran Associates, Inc., 2011.
|
| 259 |
+
|
| 260 |
+
Avrim Blum, Adam Kalai, and Hal Wasserman. Noise-tolerant learning, the parity problem, and the statistical query model. J. ACM, 50(4):506–519, July 2003. ISSN 0004-5411.
|
| 261 |
+
|
| 262 |
+
Jean Bourgain. An Improved Estimate in the Restricted Isometry Problem, pp. 65–70. Springer International Publishing, Cham, 2014.
|
| 263 |
+
|
| 264 |
+
E. J. Candes, J. Romberg, and T. Tao. Robust uncertainty principles: Exact signal reconstruction from highly incomplete frequency information. IEEE Trans. Inf. Theor., 52(2):489–509, February 2006. ISSN 0018-9448.
|
| 265 |
+
|
| 266 |
+
D. L. Donoho. Compressed sensing. IEEE Trans. Inf. Theor., 52(4):1289–1306, April 2006. ISSN 0018-9448.
|
| 267 |
+
|
| 268 |
+
V. Feldman, Parikshit Gopalan, Subhash Khot, and Ashok Kumar Ponnuswami. On agnostic learning parities, monomials,and halfspaces. SIAM Journal on Computing, 39(2):606–645, 2009. ISSN 0097-5397.
|
| 269 |
+
|
| 270 |
+
Jie Fu, Hongyin Luo, Jiashi Feng, Kian Hsiang Low, and Tat-Seng Chua. Drmad: Distilling reversemode automatic differentiation for optimizing hyperparameters of deep neural networks. CoRR, abs/1601.00917, 2016.
|
| 271 |
+
|
| 272 |
+
Jacob R. Gardner, Matt J. Kusner, Zhixiang Eddie Xu, Kilian Q. Weinberger, and John P. Cunningham. Bayesian optimization with inequality constraints. In Proceedings of the 31th International Conference on Machine Learning, ICML 2014, Beijing, China, 21-26 June 2014, pp. 937–945, 2014.
|
| 273 |
+
|
| 274 |
+
Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, AISTATS 2010, Chia Laguna Resort, Sardinia, Italy, May 13-15, 2010, pp. 249– 256, 2010.
|
| 275 |
+
|
| 276 |
+
Ishay Haviv and Oded Regev. The list-decoding size of fourier-sparse boolean functions. In David Zuckerman (ed.), 30th Conference on Computational Complexity, CCC 2015, June 17- 19, 2015, Portland, Oregon, USA, volume 33 of LIPIcs, pp. 58–71. Schloss Dagstuhl - LeibnizZentrum fuer Informatik, 2015. ISBN 978-3-939897-81-1. URL http://www.dagstuhl. de/dagpub/978-3-939897-81-1.
|
| 277 |
+
|
| 278 |
+
Ishay Haviv and Oded Regev. The restricted isometry property of subsampled fourier matrices. In Proceedings of the Twenty-seventh Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’16, pp. 288–297, Philadelphia, PA, USA, 2016. Society for Industrial and Applied Mathematics. ISBN 978-1-611974-33-1. URL http://dl.acm.org/citation.cfm?id= 2884435.2884457.
|
| 279 |
+
|
| 280 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In 2015 IEEE International Conference on Computer Vision, ICCV 2015, Santiago, Chile, December 7-13, 2015, pp. 1026–1034, 2015.
|
| 281 |
+
|
| 282 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pp. 770–778, 2016.
|
| 283 |
+
|
| 284 |
+
Gao Huang, Zhuang Liu, and Kilian Q. Weinberger. Densely connected convolutional networks. CoRR, abs/1608.06993, 2016.
|
| 285 |
+
|
| 286 |
+
Ilija Ilievski, Taimoor Akhtar, Jiashi Feng, and Christine Annette Shoemaker. Efficient hyperparameter optimization for deep learning algorithms using deterministic RBF surrogates. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA., pp. 822–829, 2017.
|
| 287 |
+
|
| 288 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pp. 448–456, 2015.
|
| 289 |
+
|
| 290 |
+
Kevin G. Jamieson and Ameet Talwalkar. Non-stochastic best arm identification and hyperparameter optimization. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, AISTATS 2016, Cadiz, Spain, May 9-11, 2016, pp. 240–248, 2016.
|
| 291 |
+
|
| 292 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014.
|
| 293 |
+
|
| 294 |
+
Murat Kocaoglu, Karthikeyan Shanmugam, Alexandros G. Dimakis, and Adam R. Klivans. Sparse polynomial learning and graph sketching. In Zoubin Ghahramani, Max Welling, Corinna Cortes, Neil D. Lawrence, and Kilian Q. Weinberger (eds.), Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pp. 3122–3130, 2014. URL http://papers.nips.cc/ book/advances-in-neural-information-processing-systems-27-2014.
|
| 295 |
+
|
| 296 |
+
L. Li, K. Jamieson, G. DeSalvo, A. Rostamizadeh, and A. Talwalkar. Hyperband: A Novel BanditBased Approach to Hyperparameter Optimization. ArXiv e-prints, March 2016.
|
| 297 |
+
|
| 298 |
+
Nathan Linial, Yishay Mansour, and Noam Nisan. Constant depth circuits, fourier transform, and learnability. J. ACM, 40(3):607–620, July 1993. ISSN 0004-5411.
|
| 299 |
+
|
| 300 |
+
Jelena Luketina, Mathias Berglund, Klaus Greff, and Tapani Raiko. Scalable gradient-based tuning of continuous regularization hyperparameters. CoRR, abs/1511.06727, 2015.
|
| 301 |
+
|
| 302 |
+
Dougal Maclaurin, David Duvenaud, and Ryan P. Adams. Gradient-based hyperparameter optimization through reversible learning. In Proceedings of the 32Nd International Conference on International Conference on Machine Learning - Volume 37, ICML’15, pp. 2113–2122. JMLR.org, 2015. URL http://dl.acm.org/citation.cfm?id=3045118.3045343.
|
| 303 |
+
|
| 304 |
+
Yishay Mansour. Learning Boolean Functions via the Fourier Transform, pp. 391–424. Springer US, Boston, MA, 1994. doi: 10.1007/978-1-4615-2696-4 11.
|
| 305 |
+
|
| 306 |
+
Sahand Negahban and Devavrat Shah. Learning sparse boolean polynomials. In Allerton, pp. 2032– 2036. IEEE, 2012. ISBN 978-1-4673-4537-8. URL http://ieeexplore.ieee.org/ xpl/mostRecentIssue.jsp?punumber $=$ 6475439.
|
| 307 |
+
|
| 308 |
+
Ryan O’Donnell. Analysis of Boolean Functions. Cambridge University Press, New York, NY, USA, 2014. ISBN 1107038324, 9781107038325.
|
| 309 |
+
|
| 310 |
+
Holger Rauhut. Compressive sensing and structured random matrices. Theoretical foundations and numerical methods for sparse recovery, 9:1–92, 2010.
|
| 311 |
+
|
| 312 |
+
Benjamin Recht. Embracing the random. http://www.argmin.net/2016/06/23/ hyperband/, 2016a.
|
| 313 |
+
|
| 314 |
+
Benjamin Recht. The news on auto-tuning. http://www.argmin.net/2016/06/20/ hypertuning/, 2016b.
|
| 315 |
+
|
| 316 |
+
Jasper Snoek, Hugo Larochelle, and Ryan P. Adams. Practical bayesian optimization of machine learning algorithms. In Advances in Neural Information Processing Systems 25: 26th Annual Conference on Neural Information Processing Systems 2012. Proceedings of a meeting held December 3-6, 2012, Lake Tahoe, Nevada, United States., pp. 2960–2968, 2012.
|
| 317 |
+
|
| 318 |
+
Jasper Snoek, Kevin Swersky, Richard S. Zemel, and Ryan P. Adams. Input warping for bayesian optimization of non-stationary functions. In Proceedings of the 31th International Conference on Machine Learning, ICML 2014, Beijing, China, 21-26 June 2014, pp. 1674–1682, 2014.
|
| 319 |
+
|
| 320 |
+
Nitish Srivastava, Geoffrey E. Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(1):1929–1958, 2014.
|
| 321 |
+
|
| 322 |
+
Peter Stobbe and Andreas Krause. Learning fourier sparse set functions. In Neil D. Lawrence and Mark A. Girolami (eds.), Proceedings of the Fifteenth International Conference on Artificial Intelligence and Statistics, AISTATS 2012, La Palma, Canary Islands, April 21-23, 2012, volume 22 of JMLR Proceedings, pp. 1125–1133. JMLR.org, 2012. URL http://jmlr.org/ proceedings/papers/v22/.
|
| 323 |
+
|
| 324 |
+
Ilya Sutskever, James Martens, George E. Dahl, and Geoffrey E. Hinton. On the importance of initialization and momentum in deep learning. In Proceedings of the 30th International Conference on Machine Learning, ICML 2013, Atlanta, GA, USA, 16-21 June 2013, pp. 1139–1147, 2013.
|
| 325 |
+
|
| 326 |
+
Kevin Swersky, Jasper Snoek, and Ryan Prescott Adams. Multi-task bayesian optimization. In Advances in Neural Information Processing Systems 26: 27th Annual Conference on Neural Information Processing Systems 2013. Proceedings of a meeting held December 5-8, 2013, Lake Tahoe, Nevada, United States., pp. 2004–2012, 2013.
|
| 327 |
+
|
| 328 |
+
R. Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society (Series B), 58:267–288, 1996.
|
| 329 |
+
|
| 330 |
+
Leslie G Valiant. A theory of the learnable. Communications of the ACM, 27(11):1134–1142, 1984.
|
| 331 |
+
|
| 332 |
+
Ziyu Wang, Masrour Zoghi, Frank Hutter, David Matheson, and Nando de Freitas. Bayesian optimization in high dimensions via random embeddings. In IJCAI 2013, Proceedings of the $2 3 r d$ International Joint Conference on Artificial Intelligence, Beijing, China, August 3-9, 2013, pp. 1778–1784, 2013.
|
| 333 |
+
|
| 334 |
+
Jian Wu and Peter I. Frazier. The parallel knowledge gradient method for batch bayesian optimization. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 3126–3134, 2016.
|
| 335 |
+
|
| 336 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. CoRR, abs/1605.07146, 2016.
|
| 337 |
+
|
| 338 |
+
Zhao Zhong, Junjie Yan, and Cheng-Lin Liu. Practical network blocks design with q-learning. CoRR, abs/1708.05552, 2017.
|
| 339 |
+
|
| 340 |
+
Barret Zoph and Quoc V. Le. Neural architecture search with reinforcement learning. CoRR, abs/1611.01578, 2016.
|
| 341 |
+
|
| 342 |
+
# A MISSING PROOFS
|
| 343 |
+
|
| 344 |
+
A.1 PROOF OF LEMMA 7
|
| 345 |
+
|
| 346 |
+
Recall the Chebyshev inequality:
|
| 347 |
+
|
| 348 |
+
Fact 10 (Multidimensional Chebyshev inequality). Let $X$ be an m dimensional random vector, with expected value $\mu = \operatorname { \mathbb { E } } [ X ]$ , and covariance matrix $V = \mathbb { E } [ ( X - \mu ) ( X - \mu ) ^ { T } ]$ .
|
| 349 |
+
|
| 350 |
+
If $V$ is a positive definite matrix, for any real number $\delta > 0$ :
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
\mathbb { P } ( \sqrt { ( X - \mu ) ^ { T } V ^ { - 1 } ( X - \mu ) } > \delta ) \le \frac { m } { \delta ^ { 2 } }
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
For ease of notation we assume $K = 1$ . Let $f$ be an $( \varepsilon / 4 , s , d )$ -bounded function written in the orthonormal basis as $\textstyle \sum _ { S } { \hat { f } } ( S ) \psi _ { S }$ . We can equivalently write $f$ as $f = h + g$ , where $h$ is a degree $d$ polynomial that only includes coefficients of magnitude at least $\varepsilon / 4 s$ and the constant term of the polynomial expansion of $f$ .
|
| 357 |
+
|
| 358 |
+
Since $\begin{array} { r } { L _ { 1 } ( f ) = \sum _ { S } | \hat { f } _ { S } | \le s } \end{array}$ , by Fact 4 we have that $h$ is $4 s ^ { 2 } / \varepsilon + 1$ sparse. The function $g$ is thus the sum of the remaining ${ \hat { f } } ( S ) \psi _ { S }$ terms not included in $h$ .
|
| 359 |
+
|
| 360 |
+
Draw $m$ (to be chosen later) random labeled examples $\{ ( z ^ { 1 } , y ^ { 1 } ) , \dots , ( z ^ { m } , y ^ { m } ) \}$ and enumerate all $N = n ^ { d }$ basis functions $\psi _ { S }$ for $| S | \le d$ as $\{ \psi _ { 1 } , \ldots , \psi _ { N } \}$ . Form matrix $A$ such that $A _ { i j } = \psi _ { j } ( z ^ { i } )$ and consider the problem of recovering $4 s ^ { 2 } / \varepsilon + 1$ sparse $x$ given $A x + e = y$ where $x$ is the vector of coefficients of $h$ , the $i$ th entry of $y$ equals $y ^ { i }$ , and $e _ { i } = g ( \bar { z } ^ { i } )$ .
|
| 361 |
+
|
| 362 |
+
We will prove that with constant probability over the choice $m$ random examples, $\| e \| _ { 2 } ~ \le ~ \sqrt { \varepsilon m }$ . Applying Theorem 5 by setting $\eta = \sqrt { \varepsilon }$ and observing that $\sigma _ { 4 s ^ { 2 } / \varepsilon + 1 } ( x ) _ { 1 } = 0$ , we will recover $x ^ { \prime }$ such that $\| x - x ^ { \prime } \| _ { 2 } ^ { 2 } \ \leq \ c _ { 2 } ^ { 2 } \varepsilon$ for some constant $c _ { 2 }$ . As such, for the function $\begin{array} { r } { \tilde { f } = \sum _ { i = 1 } ^ { N } x _ { i } ^ { \prime } \psi _ { i } } \end{array}$ we will have $\mathbb { E } [ \| h - \tilde { f } \| ^ { 2 } ] \ \leq \ c _ { 2 } ^ { 2 } \varepsilon$ by Parseval’s identity. Note, however, that we may rescale $\varepsilon$ by constant factor $1 / ( 2 c _ { 2 } ^ { 2 } )$ to obtain error $\varepsilon / 2$ and only incur an additional constant (multiplicative) factor in the sample complexity bound.
|
| 363 |
+
|
| 364 |
+
By the definition of $g$ , we have
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
\| g \| ^ { 2 } = \left( \sum _ { S , | S | > d } \hat { f } ( S ) ^ { 2 } + \sum _ { R } \hat { f } ( R ) ^ { 2 } \right)
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
where each ${ \hat { f } } ( R )$ is of magnitude at most $\varepsilon / 4 s$ . By Fact 4 and Parseval’s identity we have $\textstyle \sum _ { R } { \hat { f } } ( R ) ^ { 2 } \ \leq \ \varepsilon / 4$ . Since $f$ is $( \varepsilon / 4 , d )$ -concentrated we have $\begin{array} { r } { \sum _ { S , | S | > d } { \hat { f } } ( S ) ^ { 2 } ~ \le ~ \varepsilon / 4 } \end{array}$ . Thus, $\| g \| ^ { 2 }$ is at most $\varepsilon / 2$ . Therefore, by triangle inequality $\mathbb { E } [ \| f - \tilde { f } \| ^ { 2 } ] \le \mathbb { E } [ \| h - \tilde { f } \| ^ { 2 } ] + \mathbb { E } [ \| g \| ^ { 2 } ] \le \varepsilon$ . It remains to bound $\| e \| _ { 2 }$ . Note that since the examples are chosen independently, the entries $e _ { i } =$ $g ( z ^ { i } )$ are independent random variables. Since $g$ is a linear combination of orthonormal monomials (not including the constant term), we have $\mathbb { E } _ { z \sim D } [ g ( z ) ] = 0$ . Here we can apply linearity of variance (the covariance of $\psi _ { i }$ and $\psi _ { j }$ is zero for all $i \neq j$ ) and calculate the variance
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
\mathbf { V a r } ( g ( z ^ { i } ) ) = ( \sum _ { S , | S | > d } { \hat { f } } ( S ) ^ { 2 } + \sum _ { R } { \hat { f } } ( R ) ^ { 2 } )
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
With the same calculation as (3), we know ${ \mathbf { V a r } } ( g ( z ^ { i } ) )$ is at most $\varepsilon / 2$ .
|
| 377 |
+
|
| 378 |
+
Now consider the covariance matrix $V$ of the vector $e$ which equals $\mathbb { E } [ e e ^ { \top } ]$ (recall every entry of $e$ has mean 0). Then $V$ is a diagonal matrix (covariance between two independent samples is zero), and every diagonal entry is at most $\varepsilon / 2$ . Applying Fact 10 we have
|
| 379 |
+
|
| 380 |
+
$$
|
| 381 |
+
\mathbb { P } ( \| e \| _ { 2 } > \sqrt { \frac { \varepsilon } { 2 } } \delta ) \ \leq \ \frac { m } { \delta ^ { 2 } } .
|
| 382 |
+
$$
|
| 383 |
+
|
| 384 |
+
Setting $\delta = { \sqrt { 2 m } }$ , we conclude that $\mathbb { P } ( \| e \| _ { 2 } > { \sqrt { \varepsilon m } } ) \leq { \frac { 1 } { 2 } }$ . Hence with probability at least $1 / 2$ , we have that $\| e \| _ { 2 } ~ \le ~ \sqrt { \varepsilon m }$ . From Theorem 5, we may choose $m = \tilde { O } ( s ^ { 2 } / \varepsilon \cdot \log n ^ { d } )$ . This completes the proof. Note that the probability $1 / 2$ above can be boosted to any constant probability with a constant factor loss in sample complexity.
|
| 385 |
+
|
| 386 |
+
# A.2 PROOF OF THEOREM 6
|
| 387 |
+
|
| 388 |
+
There are at most $N = n ^ { d }$ polynomials $\psi _ { S }$ with $| S | \le d$ . Let the enumeration of these polynomials be $\psi _ { 1 } , \ldots , \psi _ { N }$ . Draw $m$ labeled examples $\{ ( z ^ { 1 } , y ^ { 1 } ) , \dots , ( z ^ { m } , y ^ { m } ) \}$ independently from $\mathcal { D }$ and construct an $m \times N$ matrix $A$ with $A _ { i j } = \psi _ { j } ( z ^ { i } )$ . Since $f$ can be written as an $s$ sparse linear combination of $\psi _ { 1 } , \dots , \psi _ { N }$ , there exists an $s$ -sparse vector $x$ such that $A x = y$ where the ith entry of $y$ is $y ^ { i }$ . Hence we can apply Theorem 5 to recover $x$ exactly. These are the $s$ non-zero coefficients of $f$ ’s expansion in terms of $\{ \psi _ { S } \}$ . Since $f$ is recovered exactly, its minimizer is found in the optimization step.
|
| 389 |
+
|
| 390 |
+
# A.3 PROOF OF COROLLARY 8
|
| 391 |
+
|
| 392 |
+
As mentioned earlier, the orthonormal polynomial basis for the class of Boolean functions with respect to the uniform distribution on $\{ - 1 , 1 \} ^ { n }$ is the class of parity functions $\{ \chi _ { S } \}$ for $S \subseteq \{ - 1 , 1 \} ^ { n }$ . Further, it is easy to show that for Boolean function $f$ , if $\mathbb { E } [ ( h - f ) ^ { 2 } ] ~ \leq ~ \varepsilon$ then $\mathbb { P } [ \mathsf { s i g n } ( h ( x ) ) \neq$ $f ( x ) ] \ \leq \ \varepsilon$ . The corollary now follows by applying Lemma 7 and two known structural facts about decision trees: 1) a tree of size $s$ is $( \varepsilon , \log ( s / \varepsilon ) )$ -concentrated and has $L _ { 1 }$ norm bounded by $s$ (see e.g., Mansour Mansour (1994)) and 2) by Fact 4, for any function $f$ with $L _ { 1 }$ norm bounded by $s$ (i.e., a decision tree of size $s$ ), there exists an $s ^ { 2 } / \varepsilon$ sparse function $g$ such that $\mathbb { E } [ ( f - g ) ^ { 2 } ] \ \leq \ \varepsilon$ . The noise tolerance property follows immediately from the remark after the proof of Lemma 7.
|
| 393 |
+
|
| 394 |
+
# B ALGORITHM ATTRIBUTES AND HEURISTICS
|
| 395 |
+
|
| 396 |
+
Scalability. If the hidden function if $s$ -sparse, Harmonica can find such a sparse function using $\tilde { O } ( s \log s )$ samples. If at every stage of Harmonica, the target function can be approximated by an $s$ sparse function, we only need ${ \tilde { O } } ( q s \log s )$ samples where $q$ is the number of stages. For real world applications such as deep neural network hyperparameter tuning, it seems (empirically) reasonable to assume that the hidden function is indeed sparse at every stage (see Section 5).
|
| 397 |
+
|
| 398 |
+
For Hyperband (Li et al., 2016), SH (Jamieson & Talwalkar, 2016) or Random Search, even if the function is $s$ -sparse, in order to cover the optimal configuration by random sampling, we need $\Omega ( 2 ^ { s } )$ samples.
|
| 399 |
+
|
| 400 |
+
Optimization time. Harmonica runs the Lasso (Tibshirani, 1996) algorithm after each stage to solve (2), which is a well studied convex optimization problem and has very fast implementations. Hyperband and SH are also efficient in terms of running time as a function of the number of function evaluations, and require sorting or other simple computations. The running time of Bayesian optimization is cubic in number of function evaluations, which limits applicability for large number of evaluations / high dimensionality, as we shall see in Section C.4.
|
| 401 |
+
|
| 402 |
+
Parallelizability. Harmonica, similar to Hyperband, SH, and Random Search, has straightforward parallel implementations. In every stage of those algorithms, we could simply evaluate the objective functions over randomly chosen points in parallel.
|
| 403 |
+
|
| 404 |
+
It is hard to run Bayesian optimization algorithm in parallel due to its inherent serial nature. Previous works explored variants in which multiple points are evaluated at the same time in parallel (Wu & Frazier, 2016), though speed ups do not grow linearly in the number of machines, and the batch size is usually limited to a small number.
|
| 405 |
+
|
| 406 |
+
Feature Extraction. Harmonica is able to extract important features with weights in each stages, which automatically sorts all the features according to their importance. See Section C.2.
|
| 407 |
+
|
| 408 |
+
# C EXPERIMENTAL DETAILS
|
| 409 |
+
|
| 410 |
+
# C.1 OPTIONS
|
| 411 |
+
|
| 412 |
+
Table 1: 60 options used in Section 5
|
| 413 |
+
|
| 414 |
+
<table><tr><td colspan="1" rowspan="1">Option Name</td><td colspan="1" rowspan="1">Description</td></tr><tr><td colspan="1" rowspan="1">01. Weight initialization</td><td colspan="1" rowspan="1">Use standard initializations or other initializations?</td></tr><tr><td colspan="1" rowspan="1">02. Weight initialization (Detail 1)</td><td colspan="1" rowspan="1"> Xavier Glorot (Glorot & Bengio,2010), Kaiming (He et al., 2015),1/n,or1/n2?</td></tr><tr><td colspan="1" rowspan="1">03.Optimization method</td><td colspan="1" rowspan="1"> SGD or ADAM? (Kingma & Ba, 2014)</td></tr><tr><td colspan="1" rowspan="1">04. Initial learning rate</td><td colspan="1" rowspan="1">≥ 0.01 or<0.01?</td></tr><tr><td colspan="1" rowspan="1">05. Initial learning rate (Detail 1)</td><td colspan="1" rowspan="1">≥ 0.1,<0.1,≥ 0.001,0r<0.001?</td></tr><tr><td colspan="1" rowspan="1">06. Initial learning rate (Detail 2)</td><td colspan="1" rowspan="1">0.3,0.1, 0.03,0.01,0.003,0.001,0.0003,0r 0.0001?</td></tr><tr><td colspan="1" rowspan="1"> 07. Learning rate drop</td><td colspan="1" rowspan="1">Do we need to decrease learning rate as we train? Yes or No?</td></tr><tr><td colspan="1" rowspan="1">08. Learning rate first drop time</td><td colspan="1" rowspan="1">If drop learning rate, when is the first time to drop by 1/1O? Epoch 40or Epoch 60?</td></tr><tr><td colspan="1" rowspan="1">09. Learning rate second drop time</td><td colspan="1" rowspan="1">If drop learning rate, when is the second time to drop by 1/10o? Epoch80 or Epoch 100?</td></tr><tr><td colspan="1" rowspan="1">10. Use momentum (Sutskever et al.,2013)</td><td colspan="1" rowspan="1">Yes or No?</td></tr><tr><td colspan="1" rowspan="1">11.Momentum rate</td><td colspan="1" rowspan="1">If use momentum, rate is 0.9 or 0.99?</td></tr><tr><td colspan="1" rowspan="1">12. Initial residual link weight</td><td colspan="1" rowspan="1">What is the initial residual link weight? All constant 1 or a randomnumber in [0,1]?</td></tr><tr><td colspan="1" rowspan="1">13.Tune residual link weight</td><td colspan="1" rowspan="1">Do we want to use back propagation to tune the weight of residual links?Yes or No?</td></tr><tr><td colspan="1" rowspan="1">14.Tune time of residual link weight</td><td colspan="1" rowspan="1">When do we start to tune residual link weight? At the first epoch orepoch 10?</td></tr><tr><td colspan="1" rowspan="1">15. Resblock first activation</td><td colspan="1" rowspan="1">Do we want to add activation layer after the first convolution? Yes orNo?</td></tr><tr><td colspan="1" rowspan="1">16. Resblock second activation</td><td colspan="1" rowspan="1">Do we want to add activation layer after the second convolution? YesorNo?</td></tr><tr><td colspan="1" rowspan="1">17. Resblock third activation</td><td colspan="1" rowspan="1">Do we want to add activation layer after adding the residual link? Yesor No?</td></tr><tr><td colspan="1" rowspan="1">18.Convolution bias</td><td colspan="1" rowspan="1">Do we want to have bias term in convolutional layers? Yes or No?</td></tr><tr><td colspan="1" rowspan="1">19.Activation</td><td colspan="1" rowspan="1">What kind of activations do we use? ReLU or others?</td></tr><tr><td colspan="1" rowspan="1">20. Activation (Detail 1)</td><td colspan="1" rowspan="1">ReLU, ReLU, Sigmoid,or Tanh?</td></tr><tr><td colspan="1" rowspan="1">21. Use dropout (Srivastava et al., 2014)</td><td colspan="1" rowspan="1">Yes or No?</td></tr><tr><td colspan="1" rowspan="1">22. Dropout rate</td><td colspan="1" rowspan="1"> If use dropout, rate is high or low?</td></tr><tr><td colspan="1" rowspan="1">23. Dropout rate (Detail 1)</td><td colspan="1" rowspan="1">If use dropout, the rate is 0.3, 0.2, 0.1, or 0.05?</td></tr><tr><td colspan="1" rowspan="1">24.Batch norm (Ioffe & Szegedy, 2015)</td><td colspan="1" rowspan="1">Do we use batch norm? Yes or No?</td></tr><tr><td colspan="1" rowspan="1">25. Batch norm tuning</td><td colspan="1" rowspan="1">If we use batch norm,do we tune the parameters in the batch normlayers? Yes or No?</td></tr><tr><td colspan="1" rowspan="1">26. Resnet shortcut type</td><td colspan="1" rowspan="1">What kind of resnet shortcut type do we use? Identity or others?</td></tr><tr><td colspan="1" rowspan="1">27. Resnet shortcut type (Detail 1)</td><td colspan="1" rowspan="1">Identity, Identity, Type B or Type C?</td></tr><tr><td colspan="1" rowspan="1">28.Weight decay</td><td colspan="1" rowspan="1">Do we use weight decay during the training? Yes or No?</td></tr><tr><td colspan="1" rowspan="1">29.Weight decay parameter</td><td colspan="1" rowspan="1">If use weight decay, what is the parameter? 1e - 3 or 1e - 4?</td></tr><tr><td colspan="1" rowspan="1">30.Batch Size</td><td colspan="1" rowspan="1">What is the batch size we should use? Big or Small?</td></tr><tr><td colspan="1" rowspan="1">31.Batch Size (Detail 1)</td><td colspan="1" rowspan="1">256,128,64,or 32?</td></tr><tr><td colspan="1" rowspan="1">32. Optnet</td><td colspan="1" rowspan="1"> An option specific to the codel2. Yes or No?</td></tr><tr><td colspan="1" rowspan="1">33.Share gradInput</td><td colspan="1" rowspan="1"> An option specific to the code. Yes or No?</td></tr><tr><td colspan="1" rowspan="1">34.Backend</td><td colspan="1" rowspan="1">What kind of backend shall we use? cudnn or cunn?</td></tr><tr><td colspan="1" rowspan="1">35.cudnn running state</td><td colspan="1" rowspan="1">If use cudnn, shall we use fastest of other states?</td></tr><tr><td colspan="1" rowspan="1"> 36. cudnn running state (Detail 1)</td><td colspan="1" rowspan="1">Fastest,Fastest, default, deterministic</td></tr><tr><td colspan="1" rowspan="1">37. nthreads</td><td colspan="1" rowspan="1">How many threads shall we use? Many or few?</td></tr><tr><td>38.nthreads (Detail 1)</td><td>8,4,2,or 1?</td></tr><tr><td>39-60.Dummy variables</td><td>Just dummy variables,no effect at all.</td></tr></table>
|
| 415 |
+
|
| 416 |
+
See Table 1 for the specific hyperparameter options that we use in Section 5. For those variables with $k$ options $( k > 2 )$ , we use $\log k$ binary variables under the same name to represent them. For example, we have two variables (01, 02) and their binary representation to denote four kinds of possible initializations: Xavier Glorot (Glorot & Bengio, 2010), Kaiming (He et al., 2015), $1 / n$ , or $\mathbf { { \bar { 1 } } } / n ^ { 2 }$ .
|
| 417 |
+
|
| 418 |
+
# C.2 IMPORTANCE FEATURES
|
| 419 |
+
|
| 420 |
+
We show the selected important features and their weights during the first 3 stages in Table 2, where each feature is a monomial of variables with degree at most 3. We do not include the 4th stage because in that stage there are no features with nonzero weights.
|
| 421 |
+
|
| 422 |
+
Smart choices on important options. Based on Table 2, Harmonica will fix the following variables (sorted according to their importance): Batch Norm (Yes), Activation (ReLU), Initial learning rate ([0.001, 0.1]), Optimization method (Adam), Use momentum (Yes), Resblock first activation (Yes), Resblcok third activation (No), Weight decay (No if initial learning rate is comparatively small and Yes otherwise), Batch norm tuning (Yes). Most of these choices match what people are doing in practice.
|
| 423 |
+
|
| 424 |
+
A metric for the importance of variables. The features that Harmonica finds can serve as a metric for measuring the importance of different variables. For example, Batch Norm turns out to be the most significant variable, and ReLU is second important. By contrast, Dropout, when Batch Norm is presented, does not have significant contributions. This actually matches with the observations in (Ioffe & Szegedy, 2015).
|
| 425 |
+
|
| 426 |
+
No dummy/irrelevant variables selected. Although there are 21/60 dummy variables, we never select any of them. Moreover, the irrelevant variables like cudnn, backend, nthreads, which do not affect the test error, were not selected.
|
| 427 |
+
|
| 428 |
+
Table 2: Important features
|
| 429 |
+
|
| 430 |
+
<table><tr><td rowspan=1 colspan=1>Stage</td><td rowspan=1 colspan=1>Feature Name</td><td rowspan=1 colspan=1>Weights</td></tr><tr><td rowspan=1 colspan=1>1-1</td><td rowspan=1 colspan=1>24.Batch norm</td><td rowspan=1 colspan=1>8.05</td></tr><tr><td rowspan=1 colspan=1>1-2</td><td rowspan=1 colspan=1>19. Activation</td><td rowspan=1 colspan=1>3.47</td></tr><tr><td rowspan=1 colspan=1>1-3</td><td rowspan=1 colspan=1> 04. Initial learning rate * O5. Initial learning rate (Detail 1)</td><td rowspan=1 colspan=1>3.12</td></tr><tr><td rowspan=1 colspan=1>1-4</td><td rowspan=1 colspan=1>19. Activation * 24. Batch norm</td><td rowspan=1 colspan=1>-2.55</td></tr><tr><td rowspan=1 colspan=1>1-5</td><td rowspan=1 colspan=1>04. Initial learning rate</td><td rowspan=1 colspan=1>-2.34</td></tr><tr><td rowspan=1 colspan=1>1-6</td><td rowspan=1 colspan=1>28. Weight decay</td><td rowspan=1 colspan=1>-1.90</td></tr><tr><td rowspan=1 colspan=1>1-7</td><td rowspan=1 colspan=1>24. Batch norm * 28. Weight decay</td><td rowspan=1 colspan=1>1.79</td></tr><tr><td rowspan=1 colspan=1>1-8</td><td rowspan=1 colspan=1> 34. Optnet * 35. Share gradInput * 52. Dummy13</td><td rowspan=1 colspan=1>1.54</td></tr><tr><td rowspan=1 colspan=1>2-1</td><td rowspan=1 colspan=1>03.Optimization method</td><td rowspan=1 colspan=1>-4.22</td></tr><tr><td rowspan=1 colspan=1>2-2</td><td rowspan=1 colspan=1>03.Optimization method * 10. Use momentum</td><td rowspan=1 colspan=1>-3.02</td></tr><tr><td rowspan=1 colspan=1>2-3</td><td rowspan=1 colspan=1>15.Resblock first activation</td><td rowspan=1 colspan=1>2.80</td></tr><tr><td rowspan=1 colspan=1>2-4</td><td rowspan=1 colspan=1>10.Use momentum</td><td rowspan=1 colspan=1>2.19</td></tr><tr><td rowspan=1 colspan=1>2-5</td><td rowspan=1 colspan=1>15.Resblock first activation * 17. Resblock third activation</td><td rowspan=1 colspan=1>1.68</td></tr><tr><td rowspan=1 colspan=1>2-6</td><td rowspan=1 colspan=1>01.Good initialization</td><td rowspan=1 colspan=1>-1.26</td></tr><tr><td rowspan=1 colspan=1>2-7</td><td rowspan=1 colspan=1>01.Good initialization *10. Use momentum</td><td rowspan=1 colspan=1>-1.12</td></tr><tr><td rowspan=1 colspan=1>2-8</td><td rowspan=1 colspan=1>01.Good initialization * O3.Optimization method</td><td rowspan=1 colspan=1>0.67</td></tr><tr><td rowspan=1 colspan=1>3-1</td><td rowspan=1 colspan=1>29.Weight decayparameter</td><td rowspan=1 colspan=1>-0.49</td></tr><tr><td rowspan=1 colspan=1>3-2</td><td rowspan=1 colspan=1>28.Weight decay</td><td rowspan=1 colspan=1>-0.26</td></tr><tr><td rowspan=1 colspan=1>3-3</td><td rowspan=1 colspan=1>06. Initial learning rate (Detail 3) * 28. Weight decay</td><td rowspan=1 colspan=1>0.23</td></tr><tr><td rowspan=1 colspan=1>3-4</td><td rowspan=1 colspan=1>25. Batch norm tuning</td><td rowspan=1 colspan=1>0.21</td></tr><tr><td rowspan=1 colspan=1>3-5</td><td rowspan=1 colspan=1>28.Weight decay * 29. Weight decay parameter</td><td rowspan=1 colspan=1>0.20</td></tr></table>
|
| 431 |
+
|
| 432 |
+

|
| 433 |
+
Figure 4: Average test error drops.
|
| 434 |
+
|
| 435 |
+

|
| 436 |
+
Figure 5: Optimization time comparison
|
| 437 |
+
|
| 438 |
+
Table 3: Stable ranges for parameters in Lasso
|
| 439 |
+
|
| 440 |
+
<table><tr><td rowspan=1 colspan=1>Parameter</td><td rowspan=1 colspan=1>Stage 1</td><td rowspan=1 colspan=1>Stage 2</td><td rowspan=1 colspan=1>Stage 3</td></tr><tr><td rowspan=1 colspan=1>入</td><td rowspan=1 colspan=1>[0.01,4.5]</td><td rowspan=1 colspan=1>[0.1,2.5]</td><td rowspan=1 colspan=1>[0.5, 1.1]</td></tr><tr><td rowspan=1 colspan=1>#Samples</td><td rowspan=1 colspan=1>≥250</td><td rowspan=1 colspan=1>≥180</td><td rowspan=1 colspan=1>≥150</td></tr></table>
|
| 441 |
+
|
| 442 |
+
# C.3 GENERALIZING FROM SMALL NETWORKS TO BIG NETWORKS
|
| 443 |
+
|
| 444 |
+
In our experiments, Harmonica first runs on a small network to extract important features and then uses these features to do fine tuning on a big network. Since Harmonica finds significantly better solutions, it is natural to ask whether other algorithms can also exploit this strategy to improve performance.
|
| 445 |
+
|
| 446 |
+
Unfortunately, it seems that all the other algorithms do not naturally support feature extraction from a small network. For Bayesian Optimization techniques, small networks and large networks have different optimization spaces. Therefore without some modification, Spearmint cannot use information from the small network to update the prior distribution for the large network.
|
| 447 |
+
|
| 448 |
+
Random-search-based techniques are able to find configurations with low test error on the small network, which might be good candidates for the large network. However, based on our simulation, good configurations of hyperparameters from random search do not generalize from small networks to large networks. This is in contrast to important features in our (Fourier) space, which do seem to generalize.
|
| 449 |
+
|
| 450 |
+
To test the latter observation using Cifar-10 dataset, we first spent 7 GPU days on 8 layer network to find top 10 configurations among 300 random selected configurations. Then we apply these 10 configurations, as well as 90 locally perturbed configurations (each of them is obtained by switching one random option from one top-10 configuration), so in total 100 “promising” configurations, to the large 56 layer network. This simulation takes 27 GPU days, but the best test error we obtained is only $1 1 . 1 \%$ , even worse than purely random search. Since Hyperband is essentially a fast version of Random Search, it also does not support feature extraction.
|
| 451 |
+
|
| 452 |
+
Hence, being able to extract important features from small networks seems empirically to be a unique feature of Harmonica.
|
| 453 |
+
|
| 454 |
+
# C.4 EXPERIMENTS WITH SYNTHETIC FUNCTIONS
|
| 455 |
+
|
| 456 |
+
Our second experiment considers a synthetic hierarchically bounded function $h ( x )$ . We run Harmonica with 100 samples, 5 features selected per stage, for 3 stages, using degree 3 features. See Figure 5 for optimization time comparison. We only plot the optimization time for Spearmint when $n = 6 0$ , which takes more than one day for 500 samples. Harmonica is several magnitudes faster than Spearmint. In Figure 6, we show that Harmonica is able to estimate the hidden function with error proportional to the noise level.
|
| 457 |
+
|
| 458 |
+
The synthetic function $h ( x ) \in \{ - 1 , + 1 \} ^ { n } \to \mathbb { R }$ is defined as follows. $h ( x )$ has three stages, and in $i$ -th stage $( i = 0 , 1 , 2 )$ , it has $3 2 ^ { i }$ sparse vectors $s _ { i , j }$ for $j = 0 , \cdots , 3 2 ^ { i } - 1$ . Each $s _ { i , j }$ contains 5 pairs of weight $w _ { i , j } ^ { k }$ and feature $f _ { i , j } ^ { k }$ for $k = 1 , \cdots 5$ , where $w _ { i , j } ^ { k } \in [ 1 0 + 1 0 ^ { - i } , 1 0 ^ { \top } + 1 0 ^ { 2 - i } ]$ . and $f _ { i , j } ^ { k }$ is a monomial on $x$ with degree at most 3. Therefore, for input $x \in \mathbb { R } ^ { n }$ , the sparse vector $\begin{array} { r } { s _ { i , j } ( x ) = \sum _ { k = 1 } ^ { 5 } w _ { i , j } ^ { k } f _ { i , j } ^ { k } ( x ) } \end{array}$ . Since $x \in \{ - 1 , + 1 \} ^ { n }$ , $f _ { i , j } ^ { k } ( x )$ is binary. Therefore, $\{ f _ { i , j } ^ { k } ( x ) \} _ { k = 1 } ^ { 5 }$ contains 5 binaries and represents a integer in $\left[ 0 , 3 1 \right]$ , denoted as $c _ { i , j } ( \boldsymbol { x } )$ . Let $h ( x ) = s _ { 1 , 1 } ( x ) +$ $s _ { 2 , c _ { 1 , 1 } ( x ) } ( x ) + s _ { 3 , c _ { 1 , 1 } ( x ) * 3 2 + c _ { 2 , c _ { 1 , 1 } ( x ) } ( x ) } ( x ) + \xi$ , where $\xi$ is the noise uniformly sampled from $[ - A , A ]$ ( $\boldsymbol { \cdot } \boldsymbol { A }$ is the noise level). In other words, in every stage $i$ we will get a sparse vector $s _ { i , j }$ . Based on $s _ { i , j } ( x )$ , we pick a the next sparse function and proceed to the next stage.
|
| 459 |
+
|
| 460 |
+

|
| 461 |
+
Figure 6: The estimation error of Harmonica is linear in noise level.
|
md/train/HJSA_e1AW/HJSA_e1AW.md
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NORMALIZED DIRECTION-PRESERVING ADAM
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Optimization algorithms for training deep models not only affects the convergence rate and stability of the training process, but are also highly related to the generalization performance of trained models. While adaptive algorithms, such as Adam and RMSprop, have shown better optimization performance than stochastic gradient descent (SGD) in many scenarios, they often lead to worse generalization performance than SGD, when used for training deep neural networks (DNNs). In this work, we identify two problems regarding the direction and step size for updating the weight vectors of hidden units, which may degrade the generalization performance of Adam. As a solution, we propose the normalized direction-preserving Adam (ND-Adam) algorithm, which controls the update direction and step size more precisely, and thus bridges the generalization gap between Adam and SGD. Following a similar rationale, we further improve the generalization performance in classification tasks by regularizing the softmax logits. By bridging the gap between SGD and Adam, we also shed some light on why certain optimization algorithms generalize better than others.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
In contrast with the growing complexity of neural network architectures (Szegedy et al., 2015; He et al., 2016; Hu et al., 2017), the training methods remain relatively simple. Most practical optimization methods for deep neural networks (DNNs) are based on the stochastic gradient descent (SGD) algorithm. However, the learning rate of SGD, as a hyperparameter, is often difficult to tune, since the magnitudes of different parameters can vary widely, and adjustment is required throughout the training process.
|
| 12 |
+
|
| 13 |
+
To tackle this problem, several adaptive variants of SGD have been developed, including Adagrad (Duchi et al., 2011), Adadelta (Zeiler, 2012), RMSprop (Tieleman & Hinton, 2012), Adam (Kingma & Ba, 2014), etc. These algorithms aim to adapt the learning rate to different parameters automatically, based on the statistics of gradient. Although they usually simplify learning rate settings, and lead to faster convergence, it is observed that their generalization performance tend to be significantly worse than that of SGD in some scenarios (Wilson et al., 2017). This intriguing phenomenon may explain why SGD (possibly with momentum) is still prevalent in training state-of-the-art deep models, especially feedforward DNNs (Szegedy et al., 2015; He et al., 2016; Hu et al., 2017). Furthermore, recent work has shown that DNNs are capable of fitting noise data (Zhang et al., 2017), suggesting that their generalization capabilities are not the mere result of DNNs themselves, but are entwined with optimization (Arpit et al., 2017).
|
| 14 |
+
|
| 15 |
+
This work aims to bridge the gap between SGD and Adam in terms of the generalization performance. To this end, we identify two problems that may degrade the generalization performance of Adam, and show how these problems are (partially) avoided by using SGD with L2 weight decay. First, the updates of SGD lie in the span of historical gradients, whereas it is not the case for Adam. This difference has been discussed in rather recent literature (Wilson et al., 2017), where the authors show that adaptive methods can find drastically different but worse solutions than SGD. Second, while the magnitudes of Adam parameter updates are invariant to rescaling of the gradient, the effect of the updates on the same overall network function still varies with the magnitudes of parameters. As a result, the effective learning rates of weight vectors tend to decrease during training, which leads to sharp local minima that do not generalize well (Hochreiter & Schmidhuber, 1997).
|
| 16 |
+
|
| 17 |
+
To fix the two problems for Adam, we propose the normalized direction-preserving Adam (NDAdam) algorithm, which controls the update direction and step size more precisely. We show that
|
| 18 |
+
|
| 19 |
+
ND-Adam is able to achieve significantly better generalization performance than vanilla Adam, and matches that of SGD in image classification tasks.
|
| 20 |
+
|
| 21 |
+
We summarize our contributions as follows:
|
| 22 |
+
|
| 23 |
+
• We observe that the directions of Adam parameter updates are different from that of SGD, i.e., Adam does not preserve the directions of gradients as SGD does. We fix the problem by adapting the learning rate to each weight vector, instead of each individual weight, such that the direction of the gradient is preserved.
|
| 24 |
+
For both Adam and SGD without L2 weight decay, we observe that the magnitude of each vector’s direction change depends on its L2-norm. We show that, using SGD with L2 weight decay implicitly normalizes the weight vectors, and thus remove the dependence in an approximate manner. We fix the problem for Adam by explicitly normalizing each weight vector, and by optimizing only its direction, such that the effective learning rate can be precisely controlled.
|
| 25 |
+
We further show that, without proper regularization, the learning signal backpropagated from the softmax layer may vary with the overall magnitude of the logits in an undesirable way. Based on the observation, we apply batch normalization or L2-regularization to the logits, which further improves the generalization performance in classification tasks.
|
| 26 |
+
|
| 27 |
+
In essence, our proposed methods, ND-Adam and regularized softmax, improve the generalization performance of Adam by enabling more precise control over the directions of parameter updates, the learning rates, and the learning signals.
|
| 28 |
+
|
| 29 |
+
# 2 BACKGROUND AND MOTIVATION
|
| 30 |
+
|
| 31 |
+
# 2.1 ADAPTIVE MOMENT ESTIMATION (ADAM)
|
| 32 |
+
|
| 33 |
+
Adaptive moment estimation (Adam) (Kingma & Ba, 2014) is a stochastic optimization method that applies individual adaptive learning rates to different parameters, based on the estimates of the first and second moments of the gradients. Specifically, for $n$ trainable parameters, $\boldsymbol \theta \in \mathbb { R } ^ { n }$ , Adam maintains a running average of the first and second moments of the gradient w.r.t. each parameter as
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
m _ { t } = \beta _ { 1 } m _ { t - 1 } + \left( 1 - \beta _ { 1 } \right) g _ { t } ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
v _ { t } = \beta _ { 2 } v _ { t - 1 } + \left( 1 - \beta _ { 2 } \right) g _ { t } ^ { 2 } .
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
Here, $t$ denotes the time step, $m _ { t } \in \mathbb { R } ^ { n }$ and $\boldsymbol { v } _ { t } ~ \in ~ \mathbb { R } ^ { n }$ denote respectively the first and second moments, and $\beta _ { 1 } \in \mathbb { R }$ and $\beta _ { 2 } \in \mathbb { R }$ are the corresponding decay factors. Kingma & Ba (2014) further notice that, since $m _ { 0 }$ and $v _ { 0 }$ are initialized to $0 \mathrm { { s } }$ , they are biased towards zero during the initial time steps, especially when the decay factors are large (i.e., close to 1). Thus, for computing the next update, they need to be corrected as
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\hat { m } _ { t } = \frac { m _ { t } } { 1 - \beta _ { 1 } ^ { t } } , \hat { v } _ { t } = \frac { v _ { t } } { 1 - \beta _ { 2 } ^ { t } } ,
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $\beta _ { 1 } ^ { t } , \beta _ { 2 } ^ { t }$ are the $t$ -th powers of $\beta _ { 1 } , \beta _ { 2 }$ respectively. Then, we can update each parameter as
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\theta _ { t } = \theta _ { t - 1 } - \frac { \alpha _ { t } } { \sqrt { \hat { v } _ { t } } + \epsilon } \hat { m } _ { t } ,
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where $\alpha _ { t }$ is the global learning rate, and $\epsilon$ is a small constant to avoid division by zero. Note the above computations between vectors are element-wise.
|
| 56 |
+
|
| 57 |
+
A distinguishing merit of Adam is that the magnitudes of parameter updates are invariant to rescaling of the gradient, as shown by the adaptive learning rate term, $\frac { \alpha _ { t } } { \sqrt { \hat { v } _ { t } } + \epsilon }$ . However, there are two potential problems when applying Adam to DNNs.
|
| 58 |
+
|
| 59 |
+
First, in some scenarios, DNNs trained with Adam generalize worse than that trained with stochastic gradient descent (SGD) (Wilson et al., 2017). Zhang et al. (2017) demonstrate that overparameterized DNNs are capable of memorizing the entire dataset, no matter if it is natural data or meaningless noise data, and thus suggest much of the generalization power of DNNs comes from the training algorithm, e.g., SGD and its variants. It coincides with another recent work (Wilson et al., 2017), which shows that simple SGD often yields better generalization performance than adaptive gradient methods, such as Adam. As pointed out by the latter, the difference in the generalization performance may result from the different directions of updates. Specifically, for each hidden unit, the SGD update of its input weight vector can only lie in the span of all possible input vectors, which, however, is not the case for Adam due to the individually adapted learning rates. We refer to this problem as the direction missing problem.
|
| 60 |
+
|
| 61 |
+
Second, while batch normalization (Ioffe & Szegedy, 2015) can significantly accelerate the convergence of DNNs, the input weights and the scaling factor of each hidden unit can be scaled in infinitely many (but consistent) ways, without changing the function implemented by the hidden unit. Thus, for different magnitudes of an input weight vector, the updates given by Adam can have different effects on the overall network function, which is undesirable. Furthermore, even when batch normalization is not used, a network using linear rectifiers (e.g., ReLU, leaky ReLU) as activation functions, is still subject to ill-conditioning of the parameterization (Glorot et al., 2011), and hence the same problem. We refer to this problem as the ill-conditioning problem.
|
| 62 |
+
|
| 63 |
+
# 2.2 L2 WEIGHT DECAY
|
| 64 |
+
|
| 65 |
+
L2 weight decay is a regularization technique frequently used with SGD. It often has a significant effect on the generalization performance of DNNs. Despite the simplicity and crucial role of L2 weight decay in the training process, it remains to be explained how it works in DNNs. A common justification for L2 weight decay is that it can be introduced by placing a Gaussian prior upon the weights, when the objective is to find the maximum a posteriori (MAP) weights (Blundell et al., 2015). However, as discussed in Sec. 2.1, the magnitudes of input weight vectors are irrelevant in terms of the overall network function, in some common scenarios, rendering the variance of the Gaussian prior meaningless.
|
| 66 |
+
|
| 67 |
+
We propose to view L2 weight decay in neural networks as a form of weight normalization, which may better explain its effect on the generalization performance. Consider a neural network trained with the following loss function:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\widetilde { L } \left( \boldsymbol { \theta } ; \mathcal { D } \right) = L \left( \boldsymbol { \theta } ; \mathcal { D } \right) + \frac { \lambda } { 2 } \sum _ { i \in \mathcal { N } } \left. w _ { i } \right. _ { 2 } ^ { 2 } ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $L \left( \theta ; \mathcal { D } \right)$ is the original loss function specified by the task, $\mathcal { D }$ is a batch of training data, $\mathcal { N }$ is the set of all hidden units, and $w _ { i }$ denotes the input weights of hidden unit $i$ , which is included in the trainable parameters, $\theta$ . For simplicity, we consider SGD updates without momentum. Therefore, the update of $w _ { i }$ at each time step is
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\Delta w _ { i } = - \alpha \frac { \partial \widetilde { L } } { \partial w _ { i } } = - \alpha \left( \frac { \partial L } { \partial w _ { i } } + \lambda w _ { i } \right) ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $\alpha$ is the learning rate. As we can see from Eq. (5), the gradient magnitude of the L2 penalty is proportional to $\lVert \boldsymbol { w } _ { i } \rVert _ { 2 }$ , thus forms a negative feedback loop that stabilizes $\lVert \boldsymbol { w } _ { i } \rVert _ { 2 }$ to an equilibrium value. Empirically, we find that $\lVert \boldsymbol { w } _ { i } \rVert _ { 2 }$ tends to increase or decrease dramatically at the beginning of the training, and then varies mildly within a small range, which indicates $\lVert \boldsymbol { w } _ { i } \rVert _ { 2 } \approx \lVert \boldsymbol { w } _ { i } + \Delta \boldsymbol { w } _ { i } \rVert _ { 2 }$ . In practice, we usually have $\left\| \Delta w _ { i } \right\| _ { 2 } / \left\| w _ { i } \right\| _ { 2 } \ll 1$ , thus $\Delta w _ { i }$ is approximately orthogonal to $w _ { i }$ , i.e. $w _ { i } \cdot \Delta w _ { i } \approx 0$ .
|
| 80 |
+
|
| 81 |
+
Let $l _ { \parallel w _ { i } }$ and $l \_ w _ { i }$ be the vector projection and rejection of $\frac { \partial L } { \partial w _ { i } }$ on $w _ { i }$ , which are defined as
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
l _ { \parallel w _ { i } } = \left( \frac { \partial L } { \partial w _ { i } } \cdot \frac { w _ { i } } { \parallel w _ { i } \parallel _ { 2 } } \right) \frac { w _ { i } } { \parallel w _ { i } \parallel _ { 2 } } , l _ { \perp w _ { i } } = \frac { \partial L } { \partial w _ { i } } - l _ { \parallel w _ { i } } .
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
From Eq. (5) and (6), it is easy to show
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\frac { \left. \Delta w _ { i } \right. _ { 2 } } { \left. w _ { i } \right. _ { 2 } } \approx \frac { \left. l _ { \perp w _ { i } } \right. _ { 2 } } { \left. l _ { \parallel w _ { i } } \right. _ { 2 } } \alpha \lambda .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
As discussed in Sec. 2.1, when batch normalization is used, or when linear rectifiers are used as activation functions, the magnitude of $\lVert \boldsymbol { w } _ { i } \rVert _ { 2 }$ is irrelevant. Thus, it is the direction of $w _ { i }$ that actually makes a difference in the overall network function. If L2 weight decay is not applied, the magnitude of $w _ { i }$ ’s direction change will decrease as $\lVert \boldsymbol { w } _ { i } \rVert _ { 2 }$ increases during the training process, which can potentially lead to overfitting (discussed in detail in Sec. 3.2). On the other hand, Eq. (7) shows that L2 weight decay implicitly normalizes the weights, such that the magnitude of $w _ { i }$ ’s direction change does not depend on $\lVert \boldsymbol { w } _ { i } \rVert _ { 2 }$ , and can be tuned by the product of $\alpha$ and $\lambda$ . In the following, we refer to $\| \Delta w _ { i } \| _ { 2 } | \| w _ { i } \| _ { 2 }$ as the effective learning rate of $w _ { i }$ .
|
| 94 |
+
|
| 95 |
+
While L2 weight decay produces the normalization effect in an implicit and approximate way, we will show that explicitly doing so enables more precise control of the effective learning rate.
|
| 96 |
+
|
| 97 |
+
# 3 NORMALIZED DIRECTION-PRESERVING ADAM
|
| 98 |
+
|
| 99 |
+
We first present the normalized direction-preserving Adam (ND-Adam) algorithm, which essentially improves the optimization of the input weights of hidden units, while employing the vanilla Adam algorithm to update other parameters. Specifically, we divide the trainable parameters, $\theta$ , into two sets, $\theta ^ { v }$ and $\theta ^ { s }$ , such that $\mathcal { \tilde { \theta } } ^ { v } = \{ w _ { i } | i \in \bar { \mathcal { N } } \}$ , and $\theta ^ { s } = \{ \theta \setminus \theta ^ { v } \}$ . Then we update $\theta ^ { v }$ and $\theta ^ { s }$ by different rules, as described by Alg. 1. The learning rates for the two sets of parameters are denoted respectively by $\alpha _ { t } ^ { v }$ and $\alpha _ { t } ^ { s }$ .
|
| 100 |
+
|
| 101 |
+
# Algorithm 1: Normalized direction-preserving Adam
|
| 102 |
+
|
| 103 |
+
$/ \star$ Initialization \*/
|
| 104 |
+
$t \gets 0$ ;
|
| 105 |
+
for $i \in \mathcal N$ do $w _ { i , 0 } w _ { i , 0 } / \parallel w _ { i , 0 } \parallel _ { 2 } ;$ $m _ { 0 } \left( w _ { i } \right) \gets 0$ ; $v _ { 0 } ( w _ { i } ) 0$ ;
|
| 106 |
+
$/ \star$ Perform $T$ iterations of training \*/
|
| 107 |
+
while $t < T$ do $t \gets t + 1$ ; $/ \star$ Update $\theta ^ { v }$ \*/ for $i \in \mathcal N$ do $\bar { g } _ { t } ( w _ { i } ) \partial L / \partial w _ { i }$ ; $g _ { t } \left( w _ { i } \right) \gets \bar { g } _ { t } \left( w _ { i } \right) - \left( \bar { g } _ { t } \left( w _ { i } \right) \cdot w _ { i , t - 1 } \right) w _ { i , t - 1 } ;$ $m _ { t } \left( w _ { i } \right) \gets \beta _ { 1 } m _ { t - 1 } \left( w _ { i } \right) + \left( 1 - \beta _ { 1 } \right) g _ { t } \left( w _ { i } \right) ;$ $v _ { t } ( w _ { i } ) \beta _ { 2 } v _ { t - 1 } ( w _ { i } ) + ( 1 - \beta _ { 2 } ) \| g _ { t } ( w _ { i } ) \| _ { 2 } ^ { 2 } ;$ $\hat { m } _ { t } \left( w _ { i } \right) \gets m _ { t } \left( w _ { i } \right) / \left( 1 - \beta _ { 1 } ^ { t } \right)$ ; $\hat { v } _ { t } ( w _ { i } ) v _ { t } ( w _ { i } ) / ( 1 - \beta _ { 2 } ^ { t } )$ ; $\bar { w } _ { i , t } w _ { i , t - 1 } - \alpha _ { t } ^ { v } \hat { m } _ { t } ( w _ { i } ) / ( \sqrt { \hat { v } _ { t } ( w _ { i } ) } + \epsilon ) ;$ ; $w _ { i , t } \gets \bar { w } _ { i , t } / \left. \bar { w } _ { i , t } \right. _ { 2 }$ ; /\* Update $\theta ^ { s }$ using Adam \*/ $\theta _ { t } ^ { s } \gets$ AdamUpdate $\left( \theta _ { t - 1 } ^ { s } ; \alpha _ { t } ^ { s } , \beta _ { 1 } , \beta _ { 2 } \right)$ ;
|
| 108 |
+
|
| 109 |
+
return $\theta _ { T }$
|
| 110 |
+
|
| 111 |
+
In Alg. 1, the iteration over $\mathcal { N }$ can be performed in parallel, and thus introduces no extra computational complexity. Compared to Adam, computing $g _ { t } \left( w _ { i } \right)$ and $w _ { i , t }$ may take slightly more time, which, however, is negligible in practice. On the other hand, to estimate the second order moment of each $w _ { i } \in \mathbb { R } ^ { n }$ , Adam maintains $n$ scalars, whereas ND-Adam requires only one scalar, $v _ { t } \left( w _ { i } \right)$ . Thus, ND-Adam has smaller memory overhead than Adam.
|
| 112 |
+
|
| 113 |
+
In the following, we address the direction missing problem and the ill-conditioning problem discussed in Sec. 2.1, and explain Alg. 1 in detail. We show how the proposed algorithm jointly solves the two problems, as well as its relation to other normalization schemes.
|
| 114 |
+
|
| 115 |
+
# 3.1 PRESERVING GRADIENT DIRECTIONS
|
| 116 |
+
|
| 117 |
+
Assuming the stationarity of a hidden unit’s input distribution, the SGD update (possibly with momentum) of the input weight vector is a linear combination of historical gradients, and thus can only lie in the span of the input vectors. As a result, the input weight vector itself will eventually converge to the same subspace.
|
| 118 |
+
|
| 119 |
+
On the contrary, the Adam algorithm adapts the global learning rate to each scalar parameter independently, such that the gradient of each parameter is normalized by a running average of its magnitudes, which changes the direction of the gradient. To preserve the direction of the gradient w.r.t. each input weight vector, we generalize the learning rate adaptation scheme from scalars to vectors.
|
| 120 |
+
|
| 121 |
+
Let $g _ { t } ( w _ { i } ) , m _ { t } ( w _ { i } ) , v _ { t } ( w _ { i } )$ be the counterparts of $g _ { t }$ , $m _ { t }$ , $v _ { t }$ for vector $w _ { i }$ . Since Eq. (1a) is a linear combination of historical gradients, it can be extended to vectors without any change; or equivalently, we can rewrite it for each vector as
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
m _ { t } \left( w _ { i } \right) = \beta _ { 1 } m _ { t - 1 } \left( w _ { i } \right) + \left( 1 - \beta _ { 1 } \right) g _ { t } \left( w _ { i } \right) .
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
We then extend Eq. (1b) as
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
v _ { t } \left( w _ { i } \right) = \beta _ { 2 } v _ { t - 1 } \left( w _ { i } \right) + \left( 1 - \beta _ { 2 } \right) \left. g _ { t } \left( w _ { i } \right) \right. _ { 2 } ^ { 2 } ,
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
i.e., instead of estimating the average gradient magnitude for each individual parameter, we estimate the average of $\| g _ { t } \left( w _ { i } \right) \| _ { 2 } ^ { 2 }$ for each vector $w _ { i }$ . In addition, we modify Eq. (2) and (3) accordingly as
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\hat { m } _ { t } \left( w _ { i } \right) = \frac { m _ { t } \left( w _ { i } \right) } { 1 - \beta _ { 1 } ^ { t } } , \hat { v } _ { t } \left( w _ { i } \right) = \frac { v _ { t } \left( w _ { i } \right) } { 1 - \beta _ { 2 } ^ { t } } ,
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
and
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
w _ { i , t } = w _ { i , t - 1 } - \frac { \alpha _ { t } ^ { v } } { \sqrt { { \hat { v } } _ { t } \left( w _ { i } \right) } + \epsilon } { \hat { m } } _ { t } \left( w _ { i } \right) .
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
Here, $\hat { m } _ { t } \left( \boldsymbol { w } _ { i } \right)$ is a vector with the same dimension as $w _ { i }$ , whereas $\hat { v } _ { t } \left( w _ { i } \right)$ is a scalar. Therefore, when applying Eq. (11), the direction of the update is the negative direction of $\hat { m } _ { t } \left( \boldsymbol { w } _ { i } \right)$ , and thus is in the span of the historical gradients of $w _ { i }$ .
|
| 146 |
+
|
| 147 |
+
It is worth noting that only the input to the first layer (i.e., the training data) is stationary throughout training. Thus, for the weights of an upper layer to converge to the span of its input vectors, it is necessary for the lower layers to converge first. Interestingly, this predicted phenomenon may have been observed in practice (Brock et al., 2017).
|
| 148 |
+
|
| 149 |
+
Despite the empirical success of SGD, a question remains as to why it is desirable to constrain the input weights in the span of the input vectors. A possible explanation is related to the manifold hypothesis, which suggests that real-world data presented in high dimensional spaces (images, audios, text, etc) concentrates on manifolds of much lower dimensionality (Cayton, 2005; Narayanan & Mitter, 2010). In fact, commonly used activation functions, such as (leaky) ReLU, sigmoid, tanh, can only be activated (not saturating or having small gradients) by a portion of the input vectors, in whose span the input weights lie upon convergence. Assuming the local linearity of the manifolds of data or hidden-layer representations, constraining the input weights in the subspace that contains some of the input vectors, encourages the hidden units to form local coordinate systems on the corresponding manifold, which can lead to good representations (Rifai et al., 2011).
|
| 150 |
+
|
| 151 |
+
# 3.2 SPHERICAL WEIGHT OPTIMIZATION
|
| 152 |
+
|
| 153 |
+
The ill-conditioning problem occurs when the magnitude change of an input weight vector can be compensated by other parameters, such as the scaling factor of batch normalization, or the output weight vector, without affecting the overall network function. Consequently, suppose we have two DNNs that parameterize the same function, but with some of the input weight vectors having different magnitudes, applying the same SGD or Adam update rule will, in general, change the network functions in different ways. Thus, the ill-conditioning problem makes the training process inconsistent and difficult to control.
|
| 154 |
+
|
| 155 |
+
More importantly, when the weights are not properly regularized (e.g., without using L2 weight decay), the magnitude of $w _ { i }$ ’s direction change will decrease as $\lVert \boldsymbol { w } _ { i } \rVert _ { 2 }$ increases during the training process. As a result, the effective learning rate for $w _ { i }$ tends to decrease faster than expected, making the network converge to sharp minima. It is well known that sharp minima generalize worse than flat minima (Hochreiter & Schmidhuber, 1997; Keskar et al., 2017).
|
| 156 |
+
|
| 157 |
+
As shown in Sec. 2.2, L2 weight decay can alleviate the ill-conditioning problem by implicitly and approximately normalizing the weights. However, we still do not have a precise control over the effective learning rate, since $\| \bar { l _ { \perp w _ { i } } } \| _ { 2 } / | \bar { \| l _ { \parallel w _ { i } } } | | _ { 2 }$ is unknown and not necessarily stable. Moreover, the approximation fails when $\lVert \boldsymbol { w } _ { i } \rVert _ { 2 }$ is far from the equilibrium due to improper initialization, or drastic changes in the magnitudes of the weight vectors. This problem is also addressed by (Neyshabur et al., 2015), by employing a geometry invariant to rescaling of weights. However, their proposed methods do not preserve the direction of gradient.
|
| 158 |
+
|
| 159 |
+
To address the ill-conditioning problem in a more principled way, we restrict the L2-norm of each $w _ { i }$ to 1, and only optimize its direction. In other words, instead of optimizing $w _ { i }$ in a $n$ -dimensional space, we optimize $w _ { i }$ on a $( n - 1 )$ -dimensional unit sphere. Specifically, we first obtain the raw gradient w.r.t. $w _ { i } , \bar { g } _ { t } \left( w _ { i } \right) = \partial L / \partial w _ { i }$ , and project the gradient onto the unit sphere as
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
g _ { t } \left( w _ { i } \right) = \bar { g } _ { t } \left( w _ { i } \right) - \left( \bar { g } _ { t } \left( w _ { i } \right) \cdot w _ { i , t - 1 } \right) w _ { i , t - 1 } .
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
Here, $\| w _ { i , t - 1 } \| _ { 2 } = 1$ . Then we follow Eq. (8)-(10), and replace (11) with
|
| 166 |
+
|
| 167 |
+
and
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\begin{array} { c } { \displaystyle \bar { w } _ { i , t } = w _ { i , t - 1 } - \frac { \alpha _ { t } ^ { v } } { \sqrt { \hat { v } _ { t } \left( w _ { i } \right) } + \epsilon } \hat { m } _ { t } \left( w _ { i } \right) , } \\ { \displaystyle w _ { i , t } = \frac { \bar { w } _ { i , t } } { \| \bar { w } _ { i , t } \| _ { 2 } } . } \end{array}
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
In Eq. (12), we keep only the component that is orthogonal to $w _ { i , t - 1 }$ . However, $\hat { m } _ { t } \left( \boldsymbol { w } _ { i } \right)$ is not necessarily orthogonal as well. In addition, even when $\hat { m } _ { t } \left( \boldsymbol { w } _ { i } \right)$ is orthogonal to $w _ { i , t - 1 }$ , Eq. (13a) can still increase $\lVert \boldsymbol { w } _ { i } \rVert _ { 2 }$ , according to the Pythagorean theorem. Therefore, we explicitly normalize $w _ { i , t }$ in Eq. (13b), to ensure $\| w _ { i , t } \| _ { 2 } = 1$ after each update. Also note that, since $w _ { i , t - 1 }$ is a linear combination of its historical gradients, $g _ { t } \left( w _ { i } \right)$ still lies in the span of the historical gradients after the projection in Eq. (12).
|
| 174 |
+
|
| 175 |
+
Compared to SGD with L2 weight decay, spherical weight optimization explicitly normalizes the weight vectors, such that each update to the weight vectors only changes their directions, and strictly keeps the magnitudes constant. As a result, the effective learning rate of a weight vector is
|
| 176 |
+
|
| 177 |
+
$$
|
| 178 |
+
\frac { \left. \Delta w _ { i , t } \right. _ { 2 } } { \left. w _ { i , t - 1 } \right. _ { 2 } } \approx \frac { \left. \hat { m } _ { t } \left( w _ { i } \right) \right. _ { 2 } } { \sqrt { \hat { v } _ { t } \left( w _ { i } \right) } } \alpha _ { t } ^ { v } ,
|
| 179 |
+
$$
|
| 180 |
+
|
| 181 |
+
which enables precise control over the learning rate of $w _ { i }$ through a single hyperparameter, $\alpha _ { t } ^ { v }$ rather than two as required by Eq. (7). Note that it is possible to control the effective learning rate more precisely, by normalizing $\hat { m } _ { t } \left( \boldsymbol { w } _ { i } \right)$ with $\| \hat { m } _ { t } \left( w _ { i } \right) \| _ { 2 }$ , instead of by $\sqrt { \hat { v } _ { t } \left( w _ { i } \right) }$ . However, by doing so, we lose the information provided by $\| \hat { m } _ { t } \left( \boldsymbol { w } _ { i } \right) \| _ { 2 }$ at different time steps. In addition, since $\hat { m } _ { t } \left( \boldsymbol { w } _ { i } \right)$ is less noisy than $g _ { t } \left( w _ { i } \right)$ , $\Vert \hat { m } _ { t } \left( w _ { i } \right) \Vert _ { 2 } / \sqrt { \hat { v } _ { t } \left( w _ { i } \right) }$ becomes small near convergence, which is considered a desirable property of Adam (Kingma $\&$ Ba, 2014). Thus, we keep the gradient normalization scheme intact.
|
| 182 |
+
|
| 183 |
+
We note the difference between various gradient normalization schemes and the normalization scheme employed by spherical weight optimization. As shown in Eq. 11, ND-Adam generalizes the gradient normalization scheme of Adam, and thus both Adam and ND-Adam normalize the gradient by a running average of its magnitude. This, and other similar schemes (Hazan et al., 2015; Yu et al., 2017) make the optimization less susceptible to vanishing and exploding gradients. On the other hand, the proposed spherical weight optimization serves a different purpose. It normalizes each weight vector and projects the gradient onto a unit sphere, such that the effective learning rate can be controlled more precisely. Moreover, it provides robustness to improper weight initialization, since the magnitude of each weight vector is kept constant.
|
| 184 |
+
|
| 185 |
+
For nonlinear activation functions, such as sigmoid and tanh, an extra scaling factor is needed for each hidden unit to express functions that require unnormalized weight vectors. For instance, given an input vector $x \in \mathbb { R } ^ { n }$ , and a nonlinearity $\phi \left( \cdot \right)$ , the activation of hidden unit $i$ is then given by
|
| 186 |
+
|
| 187 |
+
$$
|
| 188 |
+
y _ { i } = \phi \left( \gamma _ { i } w _ { i } \cdot x + b _ { i } \right) ,
|
| 189 |
+
$$
|
| 190 |
+
|
| 191 |
+
where $\gamma _ { i }$ is the scaling factor, and $b _ { i }$ is the bias.
|
| 192 |
+
|
| 193 |
+
# 3.3 RELATION TO WEIGHT NORMALIZATION AND BATCH NORMALIZATION
|
| 194 |
+
|
| 195 |
+
A related normalization and reparameterization scheme, weight normalization (Salimans & Kingma, 2016), has been developed as an alternative to batch normalization, aiming to accelerate the convergence of SGD optimization. We note the difference between spherical weight optimization and weight normalization. First, the weight vector of each hidden unit is not directly normalized in weight normalization, i.e, $\| w _ { i } \| _ { 2 } \neq 1$ in general. At training time, the activation of hidden unit $i$ is
|
| 196 |
+
|
| 197 |
+
$$
|
| 198 |
+
y _ { i } = \phi \left( \frac { \gamma _ { i } } { \left\| w _ { i } \right\| _ { 2 } } w _ { i } \cdot x + b _ { i } \right) ,
|
| 199 |
+
$$
|
| 200 |
+
|
| 201 |
+
which is equivalent to Eq. (15) for the forward pass. For the backward pass, the effective learning rate still depends on $\lVert \boldsymbol { w } _ { i } \rVert _ { 2 }$ in weight normalization, hence it does not solve the ill-conditioning problem. At inference time, both of these two schemes can combine $w _ { i }$ and $\gamma _ { i }$ into a single equivalent weight vector, $w _ { i } ^ { \prime } = \gamma _ { i } w _ { i }$ , o r $\begin{array} { r } { w _ { i } ^ { \prime } = \frac { \gamma _ { i } } { \Vert w _ { i } \Vert _ { 2 } } w _ { i } } \end{array}$ .
|
| 202 |
+
|
| 203 |
+
While spherical weight optimization naturally encompasses weight normalization, it can further benefit from batch normalization. When combined with batch normalization, Eq. (15) evolves into
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
y _ { i } = \phi \left( \gamma _ { i } \operatorname { B N } \left( w _ { i } \cdot x \right) + b _ { i } \right) ,
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+
where $\mathrm { B N } \left( { \cdot } \right)$ represents the transformation done by batch normalization without scaling and shifting. Here, $\gamma _ { i }$ serves as the scaling factor for both the normalized weight vector and batch normalization. At training time, the distribution of the input vector, $x$ , changes over time, slowing down the training of the sub-network composed by the upper layers. Salimans & Kingma (2016) observe that, such problem cannot be eliminated by normalizing the weight vectors alone, but can be substantially mitigated by combining weight normalization and mean-only batch normalization.
|
| 210 |
+
|
| 211 |
+
Additionally, in linear rectifier networks, the scaling factors, $\gamma _ { i }$ , can be removed (or set to 1), without changing the overall network function. Since $w _ { i } \cdot x$ is standardized by batch normalization, we have
|
| 212 |
+
|
| 213 |
+
$$
|
| 214 |
+
\mathbb { E } _ { x } \left[ \mathrm { B N } \left( \boldsymbol { w } _ { i } \cdot \boldsymbol { x } \right) ^ { 2 } \right] \approx 1 ,
|
| 215 |
+
$$
|
| 216 |
+
|
| 217 |
+
and hence
|
| 218 |
+
|
| 219 |
+
$$
|
| 220 |
+
\operatorname { V a r } _ { \boldsymbol { x } } \left[ \operatorname { B N } \left( \boldsymbol { w } _ { i } \cdot \boldsymbol { x } \right) + b _ { i } \right] \approx 1 .
|
| 221 |
+
$$
|
| 222 |
+
|
| 223 |
+
Therefore, $y _ { i }$ ’s that belong to the same layer, or different dimensions of $x$ that fed to the upper layer, will also have comparable variances, which potentially makes the weight updates of the upper layer more stable. For these reasons, we combine the use of spherical weight optimization and batch normalization, as shown in Eq. (17).
|
| 224 |
+
|
| 225 |
+
# 4 REGULARIZED SOFTMAX
|
| 226 |
+
|
| 227 |
+
For multi-class classification tasks, the softmax function is the de facto activation function for the output layer. Despite its simplicity and intuitive probabilistic interpretation, we observe a related problem to the ill-conditioning problem we have addressed. Similar to how different magnitudes of weight vectors result in different updates to the same network function, the learning signal backpropagated from the softmax layer varies with the overall magnitude of the logits.
|
| 228 |
+
|
| 229 |
+
Specifically, when using cross entropy as the surrogate loss with one-hot target vectors, the prediction is considered correct as long as arg $\mathrm { m a x } _ { c \in \mathcal { C } } \left( z _ { c } \right)$ is the target class, where $z _ { c }$ is the logit before the softmax activation, corresponding to category $c \in { \mathcal { C } }$ . Thus, the logits can be positively scaled together without changing the predictions, whereas the cross entropy and its derivatives will vary with the scaling factor. Concretely, denoting the scaling factor by $\eta$ , the gradient w.r.t. each logit is
|
| 230 |
+
|
| 231 |
+
$$
|
| 232 |
+
\frac { \partial L } { \partial z _ { \hat { c } } } = \eta \left[ \frac { \exp \left( \eta z _ { \hat { c } } \right) } { \sum _ { c \in \mathcal { C } } \exp \left( \eta z _ { c } \right) } - 1 \right] ,
|
| 233 |
+
$$
|
| 234 |
+
|
| 235 |
+
and
|
| 236 |
+
|
| 237 |
+
$$
|
| 238 |
+
\frac { \partial L } { \partial z _ { \bar { c } } } = \frac { \eta \exp \left( \eta z _ { \bar { c } } \right) } { \sum _ { c \in \mathcal { C } } \exp \left( \eta z _ { c } \right) } .
|
| 239 |
+
$$
|
| 240 |
+
|
| 241 |
+
where $\hat { c }$ is the target class, and ${ \bar { c } } \in { \mathcal { C } } \backslash \{ { \hat { c } } \}$ .
|
| 242 |
+
|
| 243 |
+
For Adam and ND-Adam, since the gradient w.r.t. each scalar or vector are normalized, the absolute magnitudes of Eq. (20a) and (20b) are irrelevant. Instead, the relative magnitudes make a difference here. When $\eta$ is small, we have
|
| 244 |
+
|
| 245 |
+
$$
|
| 246 |
+
\operatorname* { l i m } _ { \eta \to 0 } \left| \frac { \partial L / \partial z _ { \bar { c } } } { \partial L / \partial z _ { \hat { c } } } \right| = \frac { 1 } { | \mathcal { C } | - 1 } ,
|
| 247 |
+
$$
|
| 248 |
+
|
| 249 |
+
which indicates that, when the magnitude of the logits is small, softmax encourages the logit of the target class to increase, while equally penalizing that of the other classes. On the other end of the spectrum, assuming no two digits are the same, we have
|
| 250 |
+
|
| 251 |
+
$$
|
| 252 |
+
\operatorname* { l i m } _ { \eta \infty } | \frac { \partial L / \partial z _ { \bar { c } ^ { \prime } } } { \partial L / \partial z _ { \hat { c } } } | = 1 , \operatorname* { l i m } _ { \eta \infty } | \frac { \partial L / \partial z _ { \bar { c } ^ { \prime \prime } } } { \partial L / \partial z _ { \hat { c } } } | = 0 ,
|
| 253 |
+
$$
|
| 254 |
+
|
| 255 |
+
where $\bar { c } ^ { \prime } = \arg \operatorname* { m a x } _ { c \in \mathcal { C } \backslash \{ \hat { c } \} } \left( z _ { c } \right)$ , and $\bar { c } ^ { \prime \prime } \in \mathcal { C } \backslash \{ \hat { c } , \bar { c } ^ { \prime } \}$ . Eq. (22) indicates that, when the magnitude of the logits is large, softmax penalizes only the largest logit of the non-target classes. The latter case is related to the saturation problem of softmax discussed in Oland et al. (2017). However, they focus on the problem of small absolute gradient magnitude, which does not affect Adam and ND-Adam.
|
| 256 |
+
|
| 257 |
+
It is worth noting that both of these two cases can happen without the scaling factor. For instance, varying the norm of the weights of the softmax layer is equivalent to varying the value of $\eta$ , in terms of the relative magnitude of the gradient. In the case of small $\eta$ , the logits of all non-target classes are penalized equally, regardless of the difference in $\hat { z } - \bar { z }$ for different $\bar { z } \in \mathcal { C } \backslash \{ \hat { z } \}$ . However, it is more reasonable to penalize more the logits that are closer to $\hat { z }$ , which are more likely to cause misclassification. In the case of large $\eta$ , although the logit that is most likely to cause misclassification is strongly penalized, the logits of other non-target classes are ignored. As a result, the logits of the non-target classes tend to be similar at convergence, ignoring the fact that some classes are closer to each other than the others.
|
| 258 |
+
|
| 259 |
+
We propose two methods to exploit the prior knowledge that the magnitude of the logits should not be too small or too large. First, we can apply batch normalization to the logits. But instead of setting $\gamma _ { c }$ ’s as trainable variables, we consider them as a single hyperparameter, $\gamma _ { \mathcal { C } }$ , such that $\gamma _ { c } = \gamma _ { c } , \forall c \in \mathcal { C }$ . Tuning the value of $\gamma _ { \mathcal { C } }$ can lead to a better trade-off between the two extremes described by Eq. (21) and (22). The optimal value of $\gamma _ { \mathcal { C } }$ tends to remain the same for different optimizers or different network widths, but varies with dataset and network depth. We refer to this method as batch-normalized softmax (BN-Softmax).
|
| 260 |
+
|
| 261 |
+
Alternatively, since the magnitude of the logits tends to grow larger than expected (in order to minimize the cross entropy), we can apply L2-regularization to the logits by adding the following penalty to the loss function:
|
| 262 |
+
|
| 263 |
+
$$
|
| 264 |
+
L _ { \mathcal { C } } = \frac { \lambda _ { \mathcal { C } } } { 2 } \sum _ { c \in \mathcal { C } } z _ { c } ^ { 2 } ,
|
| 265 |
+
$$
|
| 266 |
+
|
| 267 |
+
where $\lambda _ { \mathcal { C } }$ is a hyperparameter to be tuned. Different from BN-Softmax, $\lambda _ { C }$ can be shared by different datasets and networks of different depths.
|
| 268 |
+
|
| 269 |
+
# 5 EXPERIMENTS
|
| 270 |
+
|
| 271 |
+
In this section, we provide empirical evidence for the analysis in Sec. 2.2, and evaluate the performance of ND-Adam and regularized softmax on CIFAR-10 and CIFAR-100.
|
| 272 |
+
|
| 273 |
+
# 5.1 THE EFFECT OF L2 WEIGHT DECAY
|
| 274 |
+
|
| 275 |
+
To empirically examine the effect of L2 weight decay, we train a wide residual network (WRN) (Zagoruyko & Komodakis, 2016b) of 22 layers, with a width of 7.5 times that of a vanilla ResNet. Using the notation in Zagoruyko & Komodakis (2016b), we refer to this network as WRN-22-7.5. We train the network on the CIFAR-10 dataset (Krizhevsky & Hinton, 2009), with a small modification to the original WRN architecture, and with a different learning rate annealing schedule. Specifically, for simplicity and slightly better performance, we replace the last fully connected layer with a convolutional layer with 10 output feature maps. I.e., we change the layers after the last residual block from BN-ReLU-GlobalAvgPool-FC-Softmax to
|
| 276 |
+
|
| 277 |
+
BN-ReLU-Conv-GlobalAvgPool-Softmax. In addition, for clearer comparisons, the learning rate is annealed according to a cosine function without restart (Loshchilov & Hutter, 2016; Gastaldi, 2017). We train the model for 80k iterations with a batch size of 128, similar to the settings in Zagoruyko & Komodakis (2016b). The experiments are based on a TensorFlow implementation of WRN (Wu, 2016).
|
| 278 |
+
|
| 279 |
+
As a common practice, we use SGD with a momentum of 0.9, the analysis for which is similar to that in Sec. 2.2. Due to the linearity of derivatives and momentum, $\Delta w _ { i }$ can be decomposed as $\Delta w _ { i } = \Delta w _ { i } ^ { l } + \Delta w _ { i } ^ { p }$ , where $\Delta w _ { i } ^ { l }$ and $\Delta w _ { i } ^ { p }$ are the components corresponding to the original loss function, $L \left( \cdot \right)$ , and the L2 penalty term (see Eq. (4)), respectively. Fig. 1a shows the ratio between the scalar projection of $\Delta \bar { w } _ { i } ^ { l }$ on $\bar { \Delta } w _ { i } ^ { p }$ and $\left. \Delta w _ { i } ^ { p } \right. _ { 2 }$ , which indicates how the tendency of $\Delta w _ { i } ^ { l }$ to increase $\lVert \boldsymbol { w } _ { i } \rVert _ { 2 }$ is compensated by $\Delta w _ { i } ^ { p }$ . Note that $\Delta w _ { i } ^ { p }$ points to the negative direction of $w _ { i }$ , even when momentum is used, since the direction change of $w _ { i }$ is slow. As shown in Fig. 1a, at the beginning of the training, $\Delta w _ { i } ^ { p }$ dominants and quickly adjusts $\lVert \boldsymbol { w } _ { i } \rVert _ { 2 }$ to its equilibrium value. During the middle stage of the training, the projection of $\Delta w _ { i } ^ { l }$ on $\Delta w _ { i } ^ { p }$ , and $\Delta w _ { i } ^ { p }$ almost cancel each other out. Then, near the end of the training, the gradient of $w _ { i }$ diminishes rapidly to near zero, making $\Delta w _ { i } ^ { p }$ dominant again. Therefore, Eq. (7) holds more accurately during the middle stage of the training.
|
| 280 |
+
|
| 281 |
+
In Fig. 1b, we show how the effective learning rate varies in different hyperparameter settings. By Eq. (7), $\left\| \Delta w _ { i } \right\| _ { 2 } / \left\| w _ { i } \right\| _ { 2 }$ is expected to remain the same as long as $\alpha \lambda$ stays constant, which is confirmed by the fact that the curve for $\alpha _ { 0 } = 0 . 1 , \lambda = 0 . 0 0 1$ overlaps with that for $\alpha _ { 0 } = 0 . 0 5 , \lambda =$ 0.002. However, comparing the curve for $\alpha _ { 0 } = 0 . 1 , \lambda = 0 . 0 0 1$ , with that for $\alpha _ { 0 } = 0 . 1 , \lambda =$ 0.0005, we can see that the value of $\| \Delta w _ { i } \| _ { 2 } / \| w _ { i } \| _ { 2 }$ does not change proportionally to $\alpha \lambda$ . On the other hand, by using ND-Adam, we can control the value of $\lVert \Delta w _ { i } \rVert _ { 2 } \dot { / } \lVert \dot { w } _ { i } \rVert _ { 2 }$ more precisely by adjusting the learning rate for weight vectors, $\alpha ^ { v }$ . For the same training step, changes in $\alpha ^ { v }$ lead to approximately proportional changes in $\| \Delta w _ { i } \| _ { 2 } / \| w _ { i } \| _ { 2 }$ , as shown by the two curves corresponding to ND-Adam in Fig. 1b.
|
| 282 |
+
|
| 283 |
+

|
| 284 |
+
(a) The scalar projection of $\Delta w _ { i } ^ { l }$ on $\Delta w _ { i } ^ { p }$ normalized by(b) The relative magnitude of the weight updates, or the $\left. \Delta w _ { i } ^ { p } \right. _ { 2 }$ . effective learning rate.
|
| 285 |
+
Figure 1: An illustration of how L2 weight decay and ND-Adam control the effective learning rate. The results are obtained from the 5th layer of the network, and other layers show similar results.
|
| 286 |
+
|
| 287 |
+
# 5.2 PERFORMANCE EVALUATION
|
| 288 |
+
|
| 289 |
+
To compare the generalization performance of SGD, Adam, and ND-Adam, we train the same WRN22-7.5 network on the CIFAR-10 and CIFAR-100 datasets. For SGD and ND-Adam, we first tune the hyperparameters for SGD $( \alpha _ { 0 } = 0 . 1 , \lambda = 0 . 0 0 1$ , momentum 0.9), then tune the initial learning rate of ND-Adam for weight vectors to match the effective learning rate to that of SGD $\alpha _ { 0 } ^ { v } = 0 . 0 5 )$ , as shown in Fig. 1b. While L2 weight decay can greatly affect the performance of SGD, it does not noticeably benefit Adam in our experiments. For Adam and ND-Adam, $\beta _ { 1 }$ and $\beta _ { 2 }$ are set to the default values of Adam, i.e., $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 9 9$ . Although the learning rate of Adam is usually set to a constant value, we observe better performance with the cosine learning rate schedule. The initial learning rate of Adam $( \alpha _ { 0 } )$ , and that of ND-Adam for scalar parameters $( \alpha _ { 0 } ^ { s } )$ are both tuned to 0.001. We use the same data augmentation scheme as used in Zagoruyko & Komodakis (2016b), including horizontal flips and random crops, but no dropout is used.
|
| 290 |
+
|
| 291 |
+
We first experiment with the use of trainable scaling parameters $( \gamma _ { i } )$ of batch normalization. As shown in Fig. 2b, at convergence, the test accuracies of ND-Adam are significantly improved upon that of vanilla Adam, and matches that of SGD. Note that at the early stage of training, the training losses of Adam drop dramatically as shown in Fig. 2a, and the test accuracies also increase more rapidly than that of ND-Adam and SGD. However, the test accuracies remain at a high level afterwards, which indicates that Adam tends to quickly find and get stuck in bad local minima that do not generalize well.
|
| 292 |
+
|
| 293 |
+
The average results of 3 runs are summarized in the first part of Table 1. Interestingly, compared to SGD, ND-Adam shows slightly better performance on CIFAR-10, but worse performance on CIFAR-100. This inconsistency may be related to the problem of softmax discussed in Sec. 4, that there is a lack of proper control over the magnitude of the logits. But overall, given comparable effective learning rates, ND-Adam and SGD show similar generalization performance. In this sense, the effective learning rate is a more natural learning rate measure than the learning rate hyperparameters.
|
| 294 |
+
|
| 295 |
+

|
| 296 |
+
Figure 2: The training losses and test accuracies of the same network trained with SGD, Adam, and ND-Adam. Batch normalization with scaling factors is used.
|
| 297 |
+
|
| 298 |
+
Next, we repeat the experiments with the use of BN-Softmax. As discussed in Sec. 3.2, $\gamma _ { i }$ ’s can be removed from a linear rectifier network, without changing the overall network function. Although this property does not strictly hold for residual networks due to the skip connections, we find that simply removing the scaling factors results in slightly improved generalization performance when using ND-Adam. However, the improvement is not consistent as it degrades performance of SGD. Interestingly, when BN-Softmax is further used, we observe consistent improvement over all three algorithms. Thus, we only report results for this setting. The scaling factor of the logits, $\gamma _ { \mathcal { C } }$ , is set to 2.5 for CIFAR-10, and 1 for CIFAR-100. As shown in the second part of Table 1, BN-Softmax significantly improves the performance of Adam and ND-Adam. Moreover, in this setting, we obtain the best generalization performance with ND-Adam, outperforming SGD and Adam on both CIFAR-10 and CIFAR-100.
|
| 299 |
+
|
| 300 |
+
While the TensorFlow implementation we use already provides an adequate test bed, we notice that it is different from the original implementation of WRN in several aspects. For instance, they use different nonlinearities (leaky ReLU vs. ReLU), and use different skip connections for downsampling (average pooling vs. strided convolution). A seemingly subtle but important difference is that, L2-regularization is applied not only to weight vectors, but also to the scales and biases of batch normalization in the original implementation, which leads to better generalization performance. For further comparison between SGD and ND-Adam, we reimplement ND-Adam and test its performance on a PyTorch version of the original implementation (Zagoruyko & Komodakis, 2016a).
|
| 301 |
+
|
| 302 |
+
Due to the aforementioned differences, we use a slightly different hyperparameter setting in this experiment. Specifically, for SGD $\lambda$ is set to 5e 4, while for ND-Adam $\lambda$ is set to 5e 6 (L2- regularization for biases), and both $\alpha _ { 0 } ^ { s }$ and $\alpha _ { 0 } ^ { v }$ are set to 0.04. In this case, regularizing softmax does not yield improved performance for SGD, since the L2-regularization applied to $\gamma _ { i }$ ’s and the last layer weights can serve a similar purpose. Thus, we only apply L2-regularized softmax for ND-Adam with $\lambda _ { C } = 0 . 0 0 1$ . The average results of 3 runs are summarized in Table 2. Note that the performance of SGD for WRN-28-10 is slightly better than that reported with the original implementation (i.e., 4.00 and 19.25), due to the modifications described in Sec. 5.1. In this experiment, SGD and ND-Adam show almost identical generalization performance.
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 3: The training losses and test accuracies of the same network trained with SGD, Adam, and ND-Adam. Batch normalization without scaling factors, and BN-Softmax are used.
|
| 306 |
+
Table 2: Test error rates of WRN-22-7.5 and WRN-28-10 networks on CIFAR-10 and CIFAR-100. Based on the original implementation of WRN.
|
| 307 |
+
|
| 308 |
+
Table 1: Test error rates of WRN-22-7.5 networks on CIFAR-10 and CIFAR-100. Based on a TensorFlow implementation of WRN.
|
| 309 |
+
|
| 310 |
+
<table><tr><td>CIFAR-10 Method Error (%)</td><td>CIFAR-100 Error (%)</td></tr><tr><td>BN w/ scaling factors</td></tr><tr><td>SGD 4.61 20.60</td></tr><tr><td>Adam 6.14 25.51</td></tr><tr><td>ND-Adam 4.53 21.45</td></tr><tr><td colspan="2">BN w/o scaling factors,BN-Softmax</td></tr><tr><td>SGD 4.49</td><td>20.18</td></tr><tr><td>Adam 5.43</td><td>22.48</td></tr><tr><td>ND-Adam 4.14</td><td>19.90</td></tr></table>
|
| 311 |
+
|
| 312 |
+
<table><tr><td>Method</td><td>CIFAR-10 Error (%)</td><td>CIFAR-100 Error (%)</td></tr><tr><td></td><td>WRN-22-7.5</td><td></td></tr><tr><td>SGD</td><td>3.84</td><td>19.24</td></tr><tr><td>ND-Adam</td><td>3.70</td><td>19.30</td></tr><tr><td>WRN-28-10</td><td></td><td></td></tr><tr><td>SGD</td><td>3.80</td><td>18.48</td></tr><tr><td>ND-Adam</td><td>3.70</td><td>18.42</td></tr></table>
|
| 313 |
+
|
| 314 |
+
# 6 CONCLUSION
|
| 315 |
+
|
| 316 |
+
In this paper, we have introduced ND-Adam, a tailored version of Adam for training DNNs, to bridge the generalization gap between Adam and SGD. ND-Adam is designed to preserve the direction of gradient for each weight vector, and produce the regularization effect of L2 weight decay in a more precise and principled way. Moreover, we have introduced regularized softmax, which limits the magnitude of softmax logits to provide better learning signals. By combining ND-Adam and regularized softmax, our experiments have shown significantly improved generalization performance, eliminating the gap between Adam and SGD. From a high-level view, our analysis and empirical results suggest the need for more precise control over the training process of DNNs.
|
| 317 |
+
|
| 318 |
+
# REFERENCES
|
| 319 |
+
|
| 320 |
+
Devansh Arpit, Stanisław Jastrz˛ebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, et al. A closer look at memorization in deep networks. arXiv preprint arXiv:1706.05394, 2017.
|
| 321 |
+
|
| 322 |
+
Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural networks. In ICML 2015, 2015.
|
| 323 |
+
|
| 324 |
+
Andrew Brock, Theodore Lim, JM Ritchie, and Nick Weston. Freezeout: Accelerate training by progressively freezing layers. arXiv preprint arXiv:1706.04983, 2017.
|
| 325 |
+
|
| 326 |
+
Lawrence Cayton. Algorithms for manifold learning. Univ. of California at San Diego Tech. Rep, pp. 1–17, 2005.
|
| 327 |
+
|
| 328 |
+
John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul):2121–2159, 2011.
|
| 329 |
+
|
| 330 |
+
Xavier Gastaldi. Shake-shake regularization of 3-branch residual networks. In ICLR 2017 Workshop, 2017.
|
| 331 |
+
|
| 332 |
+
Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 315–323, 2011.
|
| 333 |
+
|
| 334 |
+
Elad Hazan, Kfir Levy, and Shai Shalev-Shwartz. Beyond convexity: Stochastic quasi-convex optimization. In Advances in Neural Information Processing Systems, pp. 1594–1602, 2015.
|
| 335 |
+
|
| 336 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
|
| 337 |
+
|
| 338 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Flat minima. Neural Computation, 9(1):1–42, 1997.
|
| 339 |
+
|
| 340 |
+
Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. arXiv preprint arXiv:1709.01507, 2017.
|
| 341 |
+
|
| 342 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448–456, 2015.
|
| 343 |
+
|
| 344 |
+
Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. ICLR 2017, 2017.
|
| 345 |
+
|
| 346 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 347 |
+
|
| 348 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 349 |
+
|
| 350 |
+
Ilya Loshchilov and Frank Hutter. Sgdr: stochastic gradient descent with restarts. arXiv preprint arXiv:1608.03983, 2016.
|
| 351 |
+
|
| 352 |
+
Hariharan Narayanan and Sanjoy Mitter. Sample complexity of testing the manifold hypothesis. In Advances in Neural Information Processing Systems, pp. 1786–1794, 2010.
|
| 353 |
+
|
| 354 |
+
Behnam Neyshabur, Ruslan R Salakhutdinov, and Nati Srebro. Path-sgd: Path-normalized optimization in deep neural networks. In Advances in Neural Information Processing Systems, pp. 2422–2430, 2015.
|
| 355 |
+
|
| 356 |
+
Anders Oland, Aayush Bansal, Roger B Dannenberg, and Bhiksha Raj. Be careful what you backpropagate: A case for linear output activations & gradient boosting. arXiv preprint arXiv:1707.04199, 2017.
|
| 357 |
+
|
| 358 |
+
Salah Rifai, Yann N Dauphin, Pascal Vincent, Yoshua Bengio, and Xavier Muller. The manifold tangent classifier. In Advances in Neural Information Processing Systems, pp. 2294–2302, 2011.
|
| 359 |
+
|
| 360 |
+
Tim Salimans and Diederik P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In Advances in Neural Information Processing Systems, pp. 901–909, 2016.
|
| 361 |
+
|
| 362 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1–9, 2015.
|
| 363 |
+
|
| 364 |
+
Tijmen Tieleman and Geoffrey Hinton. Lecture 6.5—RmsProp: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural Networks for Machine Learning, 2012.
|
| 365 |
+
|
| 366 |
+
Ashia C Wilson, Rebecca Roelofs, Mitchell Stern, Nathan Srebro, and Benjamin Recht. The marginal value of adaptive gradient methods in machine learning. In Advances in Neural Information Processing Systems, 2017.
|
| 367 |
+
|
| 368 |
+
Neal Wu. A tensorflow implementation of wide residual networks, 2016. URL https:// github.com/tensorflow/models/tree/master/research/resnet.
|
| 369 |
+
|
| 370 |
+
Adams Wei Yu, Qihang Lin, Ruslan Salakhutdinov, and Jaime Carbonell. Normalized gradient with adaptive stepsize method for deep neural network training. arXiv preprint arXiv:1707.04822, 2017.
|
| 371 |
+
|
| 372 |
+
Sergey Zagoruyko and Nikos Komodakis. A pytorch implementation of wide residual networks, 2016a. URL https://github.com/szagoruyko/wide-residual-networks.
|
| 373 |
+
|
| 374 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016b.
|
| 375 |
+
|
| 376 |
+
Matthew D Zeiler. Adadelta: an adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012.
|
| 377 |
+
|
| 378 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In ICLR 2017, 2017.
|
md/train/HJgSwyBKvr/HJgSwyBKvr.md
ADDED
|
@@ -0,0 +1,693 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# WEAKLY SUPERVISED DISENTANGLEMENTWITH GUARANTEES
|
| 2 |
+
|
| 3 |
+
Rui $\mathbf { S h u } ^ { \dagger } \cdot$ ∗, Yining Chen†, Abhishek Kumar‡, Stefano Ermon†& Ben Poole‡
|
| 4 |
+
|
| 5 |
+
†Stanford University, $^ \ddag$ Google Brain †{ruishu,cynnjjs,ermon}@stanford.edu ‡{abhishk,pooleb}@google.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Learning disentangled representations that correspond to factors of variation in real-world data is critical to interpretable and human-controllable machine learning. Recently, concerns about the viability of learning disentangled representations in a purely unsupervised manner has spurred a shift toward the incorporation of weak supervision. However, there is currently no formalism that identifies when and how weak supervision will guarantee disentanglement. To address this issue, we provide a theoretical framework to assist in analyzing the disentanglement guarantees (or lack thereof) conferred by weak supervision when coupled with learning algorithms based on distribution matching. We empirically verify the guarantees and limitations of several weak supervision methods (restricted labeling, match-pairing, and rank-pairing), demonstrating the predictive power and usefulness of our theoretical framework.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Many real-world datasets can be intuitively described via a data-generating process that first samples an underlying set of interpretable factors, and then—conditional on those factors—generates an observed data point. For example, in image generation, one might first sample the object identity and pose, and then render an image with the object in the correct pose. The goal of disentangled representation learning is to learn a representation where each dimension of the representation corresponds to a distinct factor of variation in the dataset (Bengio et al., 2013). Learning such representations that align with the underlying factors of variation may be critical to the development of machine learning models that are explainable or human-controllable (Gilpin et al., 2018; Lee et al., 2019; Klys et al., 2018).
|
| 14 |
+
|
| 15 |
+
In recent years, disentanglement research has focused on the learning of such representations in an unsupervised fashion, using only independent samples from the data distribution without access to the true factors of variation (Higgins et al., 2017; Chen et al., 2018a; Kim & Mnih, 2018; Esmaeili et al., 2018). However, Locatello et al. (2019) demonstrated that many existing methods for the unsupervised learning of disentangled representations are brittle, requiring careful supervision-based hyperparameter tuning. To build robust disentangled representation learning methods that do not require large amounts of supervised data, recent work has turned to forms of weak supervision (Chen & Batmanghelich, 2019; Gabbay & Hoshen, 2019). Weak supervision can allow one to build models that have interpretable representations even when human labeling is challenging (e.g., hair style in face generation, or style in music generation). While existing methods based on weaklysupervised learning demonstrate empirical gains, there is no existing formalism for describing the theoretical guarantees conferred by different forms of weak supervision (Kulkarni et al., 2015; Reed et al., 2015; Bouchacourt et al., 2018).
|
| 16 |
+
|
| 17 |
+
In this paper, we present a comprehensive theoretical framework for weakly supervised disentanglement, and evaluate our framework on several datasets. Our contributions are several-fold.
|
| 18 |
+
|
| 19 |
+
2. We propose a set of definitions for disentanglement that can handle correlated factors and are inspired by many existing definitions in the literature (Higgins et al., 2018; Suter et al., 2018; Ridgeway & Mozer, 2018).
|
| 20 |
+
3. Using these definitions, we provide a conceptually useful and theoretically rigorous calculus of disentanglement.
|
| 21 |
+
4. We apply our theoretical framework of disentanglement to analyze three notable classes of weak supervision methods (restricted labeling, match pairing, and rank pairing). We show that although certain weak supervision methods (e.g., style-labeling in style-content disentanglement) do not guarantee disentanglement, our calculus can determine whether disentanglement is guaranteed when multiple sources of weak supervision are combined.
|
| 22 |
+
5. Finally, we perform extensive experiments to systematically and empirically verify our predicted guarantees.1
|
| 23 |
+
|
| 24 |
+
# 2 FROM UNSUPERVISED TO WEAKLY SUPERVISED DISTRIBUTION MATCHING
|
| 25 |
+
|
| 26 |
+
Our goal in disentangled representation learning is to identify a latent-variable generative model whose latent variables correspond to ground truth factors of variation in the data. To identify the role that weak supervision plays in providing guarantees on disentanglement, we first formalize the model families we are considering, the forms of weak supervision, and finally the metrics we will use to evaluate and prove components of disentanglement.
|
| 27 |
+
|
| 28 |
+
We consider data-generating processes where $S \in \mathbb { R } ^ { n }$ are the factors of variation, with distribution $p ^ { * } ( s )$ , and $X \in \mathbb { R } ^ { m }$ is the observed data point which is a deterministic function of $S$ , i.e., $X =$ $g ^ { * } ( S )$ . Many existing algorithms in unsupervised learning of disentangled representations aim to learn a latent-variable model with prior $p ( z )$ and generator $g$ , where $g ( Z ) \stackrel { d } { = } g ^ { * } ( S )$ . However, simply matching the marginal distribution over data is not enough: the learned latent variables $Z$ and the true generating factors $S$ could still be entangled with each other (Locatello et al., 2019).
|
| 29 |
+
|
| 30 |
+
To address the failures of unsupervised learning of disentangled representations, we leverage weak supervision, where information about the data-generating process is conveyed through additional observations. By performing distribution matching on an augmented space (instead of just on the observation $X$ ), we can provide guarantees on learned representations.
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 1: Augmented data distributions derived from weak supervision. Shaded nodes denote observed quantities, and unshaded nodes represent unobserved (latent) variables.
|
| 34 |
+
|
| 35 |
+
We consider three practical forms of weak supervision: restricted labeling, match pairing, and rank pairing. All of these forms of supervision can be thought of as augmented forms of the original joint distribution, where we partition the latent variables in two $S = ( S _ { I } , S _ { \backslash I } )$ , and either observe a subset of the latent variables or share latents between multiple samples. A visualization of these augmented distributions is presented in Figure 1, and below we detail each form of weak supervision.
|
| 36 |
+
|
| 37 |
+
In restricted labeling, we observe a subset of the ground truth factors, $S _ { I }$ in addition to $X$ . This allows us to perform distribution matching on $p ^ { * } ( s _ { I } , x )$ , the joint distribution over data and observed factors, instead of just the data, $p ^ { * } ( x )$ , as in unsupervised learning. This form of supervision is often leveraged in style-content disentanglement, where labels are available for content but not style (Kingma et al., 2014; Narayanaswamy et al., 2017; Chen et al., 2018b; Gabbay & Hoshen, 2019).
|
| 38 |
+
|
| 39 |
+
Match Pairing uses paired data, $( x , x ^ { \prime } )$ that share values for a known subset of factors, $I$ . For many data modalities, factors of variation may be difficult to explicitly label. Instead, it may be easier to collect pairs of samples that share the same underlying factor (e.g., collecting pairs of images of different people wearing the same glasses is easier than defining labels for style of glasses). Match pairing is a weaker form of supervision than restricted labeling, as the learning algorithm no longer depends on the underlying value $s _ { I }$ , and only on the indices of shared factors $I$ . Several variants of match pairing have appeared in the literature (Kulkarni et al., 2015; Bouchacourt et al., 2018; Ridgeway & Mozer, 2018), but typically focus on groups of observations in contrast to the paired setting we consider in this paper.
|
| 40 |
+
|
| 41 |
+
Rank Pairing is another form of paired data generation where the pairs $( x , x ^ { \prime } )$ are generated in an i.i.d. fashion, and an additional indicator variable $y$ is observed that determines whether the corresponding latent $s _ { i }$ is greater than $s _ { i } ^ { \prime }$ : $y = \mathbf { 1 } \left\{ s _ { i } \geq s _ { i } ^ { \prime } \right\}$ . Such a form of supervision is effective when it is easier to compare two samples with respect to an underlying factor than to directly collect labels (e.g., comparing two object sizes versus providing a ruler measurement of an object). Although supervision via ranking features prominently in the metric learning literature (McFee & Lanckriet, 2010; Wang et al., 2014), our focus in this paper will be on rank pairing in the context of disentanglement guarantees.
|
| 42 |
+
|
| 43 |
+
For each form of weak supervision, we can train generative models with the same structure as in Figure 1, using data sampled from the ground truth model and a distribution matching objective. For example, for match pairing, we train a generative model $( p ( z ) , g )$ such that the paired random variable $( \bar { g } ( Z _ { I } , Z _ { \backslash I } ) , g ( \bar { Z } _ { I } , Z _ { \backslash I } ^ { \bar { \prime } } ) )$ from the generator matches the distribution of the corresponding paired random variable $( g ^ { * } ( { \cal S } _ { I } , { \cal S } _ { \setminus I } ) , g ^ { * } ( { \cal S } _ { I } , { \cal S } _ { \setminus I } ^ { \prime } ) )$ from the augmented data distribution.
|
| 44 |
+
|
| 45 |
+
# 3 DEFINING DISENTANGLEMENT
|
| 46 |
+
|
| 47 |
+
To identify the role that weak supervision plays in providing guarantees on disentanglement, we introduce a set of definitions that are consistent with our intuitions about what constitutes “disentanglement” and amenable to theoretical analysis. Our new definitions decompose disentanglement into two distinct concepts: consistency and restrictiveness. Different forms of weak supervision can enable consistency or restrictiveness on subsets of factors, and in Section 4 we build up a calculus of disentanglement from these primitives. We discuss the relationship to prior definitions of disentanglement in Appendix A.
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
3.1 DECOMPOSING DISENTANGLEMENT INTO CONSISTENCY AND RESTRICTIVENESS
|
| 51 |
+
Figure 2: Illustration of disentanglement, consistency, and restrictiveness of $z _ { 1 }$ with respect to the factor of variation size. Each image of a shape represents the decoding $g ( z _ { 1 : 3 } )$ by the generative model. Each column denotes a fixed choice of $z _ { 1 }$ . Each row denotes a fixed choice of $\left( z _ { 2 } , z _ { 3 } \right)$ . A demonstration of consistency versus restrictiveness on models from disentanglement lib is available in Appendix B.
|
| 52 |
+
|
| 53 |
+
To ground our discussion of disentanglement, we consider an oracle that generates shapes with factors of variation for size $( S _ { 1 } )$ , shape $( S _ { 2 } )$ , and color $( S _ { 3 } )$ . How can we determine whether $Z _ { 1 }$ of our generative model “disentangles” the concept of size? Intuitively, one way to check whether $Z _ { 1 }$ of the generative model disentangles size $( S _ { 1 } )$ is to visually inspect what happens as we vary $Z _ { 1 }$ , $Z _ { 2 }$ , and $Z _ { 3 }$ , and see whether the resulting visualizations are consistent with Figure 2a. In doing so, our visual inspection checks for two properties:
|
| 54 |
+
|
| 55 |
+
1. When $Z _ { 1 }$ is fixed, the size $( S _ { 1 } )$ of the generated object never changes.
|
| 56 |
+
|
| 57 |
+
2. When only $Z _ { 1 }$ is changed, the change is restricted to the size $( S _ { 1 } )$ of the generated object, meaning that there is no change in $S _ { j }$ for $j \neq 1$ .
|
| 58 |
+
|
| 59 |
+
We argue that disentanglement decomposes into these two properties, which we refer to as generator consistency and generator restrictiveness. Next, we formalize these two properties.
|
| 60 |
+
|
| 61 |
+
Let $\mathcal { H }$ be a hypothesis class of generative models from which we assume the true data-generating function is drawn. Each element of the hypothesis class $\mathcal { H }$ is a tuple $( p ( s ) , g , e )$ , where $p ( s )$ describes the distribution over factors of variation, the generator $g$ is a function that maps from the factor space $S \in \mathbb { R } ^ { n }$ to the observation space $\mathcal { X } \in \mathbb { R } ^ { m }$ , and the encoder $e$ is a function that maps from ${ \mathcal { X } } \to S$ . $S$ and $X$ can consist of both discrete and continuous random variables. We impose a few mild assumptions on $\mathcal { H }$ (see Appendix I.1). Notably, we assume every factor of variation is exactly recoverable from the observation $X$ , i.e. $e ( g ( S ) ) = { \dot { S } }$ .
|
| 62 |
+
|
| 63 |
+
Given an oracle model $h ^ { \ast } = ( p ^ { \ast } , g ^ { \ast } , e ^ { \ast } ) \in \mathcal { H }$ , we would like to learn a model $h = ( p , g , e ) \in \mathcal { H }$ whose latent variables disentangle the latent variables in $h ^ { * }$ . We refer to the latent-variables in the oracle $h ^ { * }$ as $S$ and the alternative model $h$ ’s latent variables as $Z$ . If we further restrict $h$ to only those models where $g ( Z ) \stackrel { d } { = } g ^ { * } ( S )$ are equal in distribution, it is natural to align $Z$ and $S$ via $S = e ^ { * } \circ g ( Z )$ . Under this relation between $Z$ and $S$ , our goal is to construct definitions that describe whether the latent code $Z _ { i }$ disentangles the corresponding factor $S _ { i }$ .
|
| 64 |
+
|
| 65 |
+
Generator Consistency. Let $I$ denote a set of indices and $p _ { I }$ denote the generating process
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\begin{array} { c } { { z _ { I } \sim p ( z _ { I } ) } } \\ { { z _ { \backslash I } , z _ { \backslash I } ^ { \prime } \overset { \mathrm { i i d } } { \sim } p ( z _ { \backslash I } \mid z _ { I } ) . } } \end{array}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
This generating process samples $Z _ { I }$ once and then conditionally samples $Z _ { I }$ twice in an i.i.d. fashion. We say that $Z _ { I }$ is consistent with $S _ { I }$ if
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r } { \mathbb { E } _ { p _ { I } } \| e _ { I } ^ { * } \circ g ( z _ { I } , z _ { \setminus I } ) - e _ { I } ^ { * } \circ g ( z _ { I } , z _ { \setminus I } ^ { \prime } ) \| ^ { 2 } = 0 , } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $e _ { I } ^ { * }$ is the oracle encoder restricted to the indices $I$
|
| 78 |
+
|
| 79 |
+
Intuitively, Equation (3) states that, for any fixed choice of $Z _ { I }$ , resampling of $Z _ { \backslash I }$ will not influence the oracle’s measurement of the factors $S _ { I }$ . In other words, $S _ { I }$ is invariant to changes in $Z _ { \backslash I }$ . An illustration of a generative model where $Z _ { 1 }$ is consistent with size $( S _ { 1 } )$ is provided in Figure 2b. A notable property of our definition is that the prescribed sampling process $p _ { I }$ does not require the underlying factors of variation to be statistically independent. We characterize this property in contrast to previous definitions of disentanglement in Appendix A.
|
| 80 |
+
|
| 81 |
+
Generator Restrictiveness. Let $p _ { \setminus I }$ denote the generating process
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\begin{array} { c } { { z _ { \backslash I } \sim p ( z _ { \backslash I } ) } } \\ { { z _ { I } , z _ { I } ^ { \prime } \overset { \mathrm { i i d } } { \sim } p ( z _ { I } \mid z _ { \backslash I } ) . } } \end{array}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
We say that $Z _ { I }$ is restricted to $S _ { I }$ if
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r } { \mathbb { E } _ { p \setminus I } \| e \setminus ^ { * } \circ g ( z _ { I } , z _ { \setminus I } ) - e _ { \setminus I } ^ { * } \circ g ( z _ { I } ^ { \prime } , z _ { \setminus I } ) \| ^ { 2 } = 0 . } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Equation (6) states that, for any fixed choice of $Z _ { \backslash I }$ , resampling of $Z _ { I }$ will not influence the oracle’s measurement of the factors $S _ { \backslash I }$ . In other words, $\operatorname { \dot { \cal S } } _ { \lfloor I \rfloor }$ is invariant to changes in $Z _ { I }$ . Thus, changing $Z _ { I }$ is restricted to modifying only $S _ { I }$ . An illustration of a generative model where $Z _ { 1 }$ is restricted to size $( S _ { 1 } )$ is provided in Figure 2c.
|
| 94 |
+
|
| 95 |
+
Generator Disentanglement. We now say that $Z _ { I }$ disentangles $S _ { I }$ if $Z _ { I }$ is consistent with and restricted to $S _ { I }$ . If we denote consistency and restrictiveness via Boolean functions $C ( I )$ and $R ( I )$ , we can now concisely state that
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
D ( I ) : = C ( I ) \land R ( I ) ,
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where $D ( I )$ denotes whether $Z _ { I }$ disentangles $S _ { I }$ . An illustration of a generative model where $Z _ { 1 }$ disentangles size $( S _ { 1 } )$ is provided in Figure 2a. Note that while size increases monotonically with $Z _ { 1 }$ in the schematic figure, we wish to clarify that monotonicity is unrelated to the concepts of consistency and restrictiveness.
|
| 102 |
+
|
| 103 |
+
# 3.2 RELATION TO BIJECTIVITY-BASED DEFINITION OF DISENTANGLEMENT
|
| 104 |
+
|
| 105 |
+
Under our mild assumptions on $\mathcal { H }$ , distribution matching on $g ( Z ) \stackrel { d } { = } g ( S )$ combined with generator disentanglement on factor $I$ implies the existence of two invertible functions $f _ { I }$ and $f _ { \backslash I }$ such that the alignment via $S = e ^ { * } \circ g ( Z )$ decomposes into
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\biggl [ S _ { I } \biggr ] = \biggl [ f _ { I } \bigl ( Z _ { I } \bigr ) \biggr ] .
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
This expression highlights the connection between disentanglement and invariance, whereby $S _ { I }$ is only influenced by $Z _ { I }$ , and $S _ { \backslash I }$ is only influenced by $Z _ { \backslash I }$ . However, such a bijectivity-based definition of disentanglement does not naturally expose the underlying primitives of consistency and restrictiveness, which we shall demonstrate in our theory and experiments to be valuable concepts for describing disentanglement guarantees under weak supervision.
|
| 112 |
+
|
| 113 |
+
# 3.3 ENCODER-BASED DEFINITIONS FOR DISENTANGLEMENT
|
| 114 |
+
|
| 115 |
+
Our proposed definitions are asymmetric—measuring the behavior of a generative model against an oracle encoder. So far, we have chosen to present the definitions from the perspective of a learned generator $( p , g )$ measured against an oracle encoder $e ^ { * }$ . In this sense, they are generator-based definitions. We can also develop a parallel set of definitions for encoder-based consistency, restrictiveness, and disentanglement within our framework simply by using an oracle generator $( p ^ { * } , g ^ { * } )$ measured against a learned encoder $e$ . Below, we present the encoder-based perspective on consistency.
|
| 116 |
+
|
| 117 |
+
Encoder Consistency. Let $p _ { I } ^ { * }$ denote the generating process
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\begin{array} { c } { { s _ { I } \sim p ^ { * } ( s _ { I } ) } } \\ { { s _ { \backslash I } , s _ { \backslash I } ^ { \prime } \stackrel { \mathrm { i i d } } { \sim } p ^ { * } ( s _ { \backslash I } , \mid s _ { I } ) . } } \end{array}
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
This generating process samples $S _ { I }$ once and then conditionally samples $S _ { I }$ twice in an i.i.d. fashion. We say that $S _ { I }$ is consistent with $Z _ { I }$ if
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\begin{array} { r } { \mathbb { E } _ { p _ { I } ^ { * } } \| e _ { I } \circ g ^ { * } ( s _ { I } , s _ { \setminus I } ) - e _ { I } \circ g ^ { * } ( s _ { I } , s _ { \setminus I } ^ { \prime } ) \| ^ { 2 } = 0 . } \end{array}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
We now make two important observations. First, a valuable trait of our encoder-based definitions is that one can check for encoder consistency $/$ restrictiveness $/$ disentanglement as long as one has access to match pairing data from the oracle generator. This is in contrast to the existing disentanglement definitions and metrics, which require access to the ground truth factors (Higgins et al., 2017; Kumar et al., 2018; Kim & Mnih, 2018; Chen et al., 2018a; Suter et al., 2018; Ridgeway & Mozer, 2018; Eastwood & Williams, 2018). The ability to check for our definitions in a weakly supervised fashion is the key to why we can develop a theoretical framework using the language of consistency and restrictiveness. Second, encoder-based definitions are tractable to measure when testing on synthetic data, since the synthetic data directly serves the role of the oracle generator. As such, while we develop our theory to guarantee both generator-based and the encoder-based disentanglement, all of our measurements in the experiments will be conducted with respect to a learned encoder.
|
| 130 |
+
|
| 131 |
+
We make three remarks on notations. First, $D ( i ) : = D ( \{ i \} )$ . Second, $D ( \emptyset )$ evaluates to true. Finally, $D ( I )$ is implicitly dependent on either $( p , g , e ^ { * } )$ (generator-based) or $( p ^ { * } , g ^ { * } , e )$ (encoderbased). Where important, we shall make this dependency explicit (e.g., let $D ( I ; p , g , e ^ { * } )$ denote generator-based disentanglement). We apply these conventions to $C$ and $R$ analogously.
|
| 132 |
+
|
| 133 |
+
# 4 A CALCULUS OF DISENTANGLEMENT
|
| 134 |
+
|
| 135 |
+
There are several interesting relationships between restrictiveness and consistency. First, by definition, $C ( I )$ is equivalent to $\bar { \boldsymbol { R } } ( \backslash I )$ . Second, we can see from Figures 2b and $2 \mathrm { c }$ that $C ( I )$ and $R ( I )$ do not imply each other. Based on these observations and given that consistency and restrictiveness operate over subsets of the random variables, a natural question that arises is whether consistency or restrictiveness over certain sets of variables imply additional properties over other sets of variables.
|
| 136 |
+
|
| 137 |
+
We develop a calculus for discovering implied relationships between learned latent variables $Z$ and ground truth factors of variation $S$ given known relationships as follows.
|
| 138 |
+
|
| 139 |
+
<table><tr><td>Calculus of Disentanglement</td></tr><tr><td>Consistency and Restrictiveness C(I) R(I) R(I) C(I) C(I) ←→ R(\I)</td></tr><tr><td>Union Rules</td></tr><tr><td>C(i)∧C(J) => C(Iu J) R(I) ^ R(J) =→ R(I U J) Intersection Rules</td></tr><tr><td>C(I) ^ C(J) =→ C(I n J) R(I) ∧ R(J) =→ R(I n J)</td></tr><tr><td>Full Disentanglement</td></tr><tr><td>∧=1C(i) →A²=1D(i) ∧=1 R(i) →N=1D(i)</td></tr></table>
|
| 140 |
+
|
| 141 |
+
Our calculus provides a theoretically rigorous procedure for reasoning about disentanglement. In particular, it is no longer necessary to prove whether the supervision method of interest satisfies consistency and restrictiveness for each and every factor. Instead, it suffices to show that a supervision method guarantees consistency or restrictiveness for a subset of factors, and then combine multiple supervision methods via the calculus to guarantee full disentanglement. We can additionally use the calculus to uncover consistency or restrictiveness on individual factors when weak supervision is available only for a subset of variables. For example, achieving consistency on $S _ { 1 , 2 }$ and $S _ { 2 , 3 }$ implies consistency on the intersection $S _ { 2 }$ . Furthermore, we note that these rules are agnostic to using generator or encoder-based definitions. We defer the complete proofs to Appendix I.2.
|
| 142 |
+
|
| 143 |
+
# 5 FORMALIZING WEAK SUPERVISION WITH GUARANTEES
|
| 144 |
+
|
| 145 |
+
In this section, we address the question of whether disentanglement arises from the supervision method or model inductive bias. This challenge was first put forth by Locatello et al. (2019), who noted that unsupervised disentanglement is heavily reliant on model inductive bias. As we transition toward supervised approaches, it is crucial that we formalize what it means for disentanglement to be guaranteed by weak supervision.
|
| 146 |
+
|
| 147 |
+
Sufficiency for Disentanglement. Let $\mathcal { P }$ denote a family of augmented distributions. We say that a weak supervision method $\mathbf { S } : \mathcal { H } \to \mathcal { P }$ is sufficient for learning a generator whose latent codes $Z _ { I }$ disentangle the factors $S _ { I }$ if there exists a learning algorithm $\mathcal { A } : \mathcal { P } \mathcal { H }$ such that for any choice of $( p ^ { * } ( s ) , \bar { g ^ { * } } , e ^ { * } ) \in \mathcal { H }$ , the procedure $\mathcal { A } \circ \mathbf { S } ( p ^ { \ast } ( s ) , \mathbf { \bar { { g } } } ^ { \ast } , \mathbf { \bar { { e } } } ^ { \ast } )$ returns a model $( p ( z ) , g , e )$ for which both $D ( I ; p , g , e ^ { * } )$ and $D ( I ; p ^ { * } , g ^ { * } , e )$ hold, and $g ( Z ) \stackrel { d } { = } g ^ { * } ( S )$ .
|
| 148 |
+
|
| 149 |
+
The key insight of this definition is that we force the strategy and learning algorithm pair $( \mathbf { S } , { \mathcal { A } } )$ to handle all possible oracles drawn from the hypothesis class $\mathcal { H }$ . This prevents the exploitation of model inductive bias, since any bias from the learning algorithm $\mathcal { A }$ toward a reduced hypothesis class $\hat { \mathcal { H } } \subset \mathcal { H }$ will result in failure to handle oracles in the complementary hypothesis class $\mathcal { \bar { H } } \backslash \mathcal { \hat { H } }$ .
|
| 150 |
+
|
| 151 |
+
The distribution matching requirement $g ( Z ) \stackrel { d } { = } g ^ { * } ( S )$ ensures latent code informativeness, i.e., preventing trivial solutions where the latent code is uninformative (see Proposition 6 for formal statement). Intuitively, distribution matching paired with a deterministic generator guarantees invertibility of the learned generator and encoder, enforcing that $Z _ { I }$ cannot encode less information than $S _ { I }$ (e.g., only encoding age group instead of numerical age) and vice versa.
|
| 152 |
+
|
| 153 |
+
# 6 ANALYSIS OF WEAK SUPERVISION METHODS
|
| 154 |
+
|
| 155 |
+
We now apply our theoretical framework to three practical weak supervision methods: restricted labeling, match pairing, and rank pairing. Our main theoretical findings are that: (1) these methods can be applied in a targeted manner to provide single factor consistency or restrictiveness guarantees; (2) by enforcing consistency (or restrictiveness) on all factors, we can learn models with strong disentanglement performance. Correspondingly, Figure 3 and Figure 5 are our main experimental results, demonstrating that these theoretical guarantees have predictive power in practice.
|
| 156 |
+
|
| 157 |
+
# 6.1 THEORETICAL GUARANTEES FROM WEAK SUPERVISION
|
| 158 |
+
|
| 159 |
+
We prove that if a training algorithm successfully matches the generated distribution to data distribution generated via restricted labeling, match pairing, or rank pairing of factors $S _ { I }$ , then $Z _ { I }$ is guaranteed to be consistent with $S _ { I }$ :
|
| 160 |
+
|
| 161 |
+
Theorem 1. Given any oracle $( p ^ { \ast } ( s ) , g ^ { \ast } , e ^ { \ast } ) \in \mathcal { H }$ , consider the distribution-matching algorithm $\mathcal { A }$ that selects a model $( p ( z ) , g , e ) \in \mathcal { H }$ such that:
|
| 162 |
+
|
| 163 |
+
1. $( g ^ { * } ( S ) , S _ { I } ) \overset { d } { = } ( g ( Z ) , Z _ { I } )$ (Restricted Labeling); or
|
| 164 |
+
2. $\left( g ^ { \ast } ( S _ { I } , S _ { \setminus I } ) , g ^ { \ast } ( S _ { I } , S _ { \setminus I } ^ { \prime } ) \right) \stackrel { d } { = } \left( g ( Z _ { I } , Z _ { \setminus I } ) , g ( Z _ { I } , Z _ { \setminus I } ^ { \prime } ) \right) ( M a t c h P a i r i n g ) ; o r$
|
| 165 |
+
3. $\begin{array} { r } { ( g ^ { * } ( S ) , g ^ { * } ( S ^ { \prime } ) , \mathbf { 1 } \left\{ S _ { I } \leq S _ { I } ^ { \prime } \right\} ) \stackrel { d } { = } ( g ( Z ) , g ( Z ^ { \prime } ) , \mathbf { 1 } \left\{ Z _ { I } \leq Z _ { I } ^ { \prime } \right\} ) ( R a n k ~ P a i r i n g ) . } \end{array}$
|
| 166 |
+
|
| 167 |
+
Then $( p , g )$ satisfies $C ( I ; p , g , e ^ { * } )$ and $e$ satisfies $C ( I ; p ^ { * } , g ^ { * } , e )$ .
|
| 168 |
+
|
| 169 |
+
Theorem 1 states that distribution-matching under restricted labeling, match pairing, or rank pairing of $S _ { I }$ guarantees both generator and encoder consistency for the learned generator and encoder respectively. We note that while the complement rule $C ( I ) \implies R ( \backslash I )$ further guarantees that $Z _ { \backslash I }$ is restricted to $S _ { \backslash I }$ , we can prove that the same supervision does not guarantee that $Z _ { I }$ is restricted to $S _ { I }$ (Theorem 2). However, if we additionally have restricted labeling for $S _ { \backslash I }$ , or match pairing for $S _ { \backslash I }$ , then we can see from the calculus that we will have guaranteed $R ( I ) \land { \dot { C } } ( I )$ , thus implying disentanglement of factor $I$ . We also note that while restricted labeling and match pairing can be applied on a set of factors at once (i.e. $| I | \geq 1 )$ , rank pairing is restricted to one-dimensional factors for which an ordering exists. In the experiments below, we empirically verify the theoretical guarantees provided in Theorem 1.
|
| 170 |
+
|
| 171 |
+
# 6.2 EXPERIMENTS
|
| 172 |
+
|
| 173 |
+
We conducted experiments on five prominent datasets in the disentanglement literature: Shapes3D (Kim & Mnih, 2018), dSprites (Higgins et al., 2017), Scream-dSprites (Locatello et al., 2019), SmallNORB (LeCun et al., 2004), and Cars3D (Reed et al., 2015). Since some of the underlying factors are treated as nuisance variables in SmallNORB and Scream-dSprites, we show in Appendix C that our theoretical framework can be easily adapted accordingly to handle such situations. We use generative adversarial networks (GANs, Goodfellow et al. (2014)) for learning $( p , g )$ but any distribution matching algorithm (e.g., maximum likelihood training in tractable models, or VI in latent-variable models) could be applied. Our results are collected over a broad range of hyperparameter configurations (see Appendix H for details).
|
| 174 |
+
|
| 175 |
+
Since existing quantitative metrics of disentanglement all measure the performance of an encoder with respect to the true data generator, we trained an encoder post-hoc to approximately invert the learned generator, and measured all quantitative metrics (e.g., mutual information gap) on the encoder. Our theory assumes that the learned generator must be invertible. While this is not true for conventional GANs, our empirical results show that this is not an issue in practice (see Appendix G).
|
| 176 |
+
|
| 177 |
+
We present three sets of experimental results: (1) Single-factor experiments, where we show that our theory can be applied in a targeted fashion to guarantee consistency or restrictiveness of a single factor. (2) Consistency versus restrictiveness experiments, where we show the extent to which single-factor consistency and restrictiveness are correlated even when the models are only trained to maximize one or the other. (3) Full disentanglement experiments, where we apply our theory to fully disentangle all factors. A more extensive set of experiments can be found in the Appendix.
|
| 178 |
+
|
| 179 |
+
# 6.2.1 SINGLE-FACTOR CONSISTENCY AND RESTRICTIVENESS
|
| 180 |
+
|
| 181 |
+
We empirically verify that single-factor consistency or restrictiveness can be achieved with the supervision methods of interest. Note there are two special cases of match pairing: one where $S _ { i }$ is the only factor that is shared between $x$ and $x ^ { \prime }$ and one where $S _ { i }$ is the only factor that is changed. We distinguish these two conditions as share pairing and change pairing, respectively. Theorem 1 shows that restricted labeling, share pairing, and rank pairing of the $i ^ { \mathrm { { t h } } }$ factor are each sufficient supervision strategies for guaranteeing consistency on $S _ { i }$ . Change pairing at $S _ { i }$ is equivalent to share pairing at $S _ { \backslash i }$ ; the complement rule $C ( I ) \Longleftrightarrow R ( \backslash I )$ allows us to conclude that change pairing guarantees restrictiveness. The first four heatmaps in Figure 3 show the results for restricted labeling, share pairing, change pairing, and rank pairing. The numbers shown in the heatmap are the normalized consistency and restrictiveness scores. We define the normalized consistency score as
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
Figure 3: Heatmap visualization of ablation studies that measure either single-factor consistency or single-factor restrictiveness as a function of various supervision methods, conducted on Shapes3D. Our theory predicts the diagonal components to achieve the highest scores. Note that share pairing, change pairing, and change pair intersection are special cases of match pairing.
|
| 185 |
+
|
| 186 |
+
$$
|
| 187 |
+
\widetilde { c } ( I ; p ^ { * } , g ^ { * } , e ) = 1 - \frac { \mathbb { E } _ { p _ { I } ^ { * } } \| e _ { I } \circ g ^ { * } ( s _ { I } , s _ { \setminus I } ) - e _ { I } \circ g ^ { * } ( s _ { I } , s _ { \setminus I } ^ { \prime } ) \| ^ { 2 } } { \mathbb { E } _ { s , s ^ { \prime } \sim p ^ { * } } \| e _ { I } \circ g ^ { * } ( s ) - e _ { I } \circ g ^ { * } ( s ^ { \prime } ) \| ^ { 2 } } .
|
| 188 |
+
$$
|
| 189 |
+
|
| 190 |
+
This score is bounded on the interval $[ 0 , 1 ]$ (a consequence of Lemma 1) and is maximal when $C ( I : p ^ { * } , g ^ { * } , e )$ is satisfied. This normalization procedure is similar in spirit to the Interventional Robustness score in Suter et al. (2018). The normalized restrictiveness score $\tilde { r }$ can be analogously defined. In practice, we estimate this score via Monte Carlo estimation.
|
| 191 |
+
|
| 192 |
+
The final heatmap in Figure 3 demonstrates the calculus of intersection. In practice, it may be easier to acquire paired data where multiple factors change simultaneously. If we have access to two kinds of datasets, one where $S _ { I }$ are changed and one where $S _ { J }$ are changed, our calculus predicts that training on both datasets will guarantee restrictiveness on $S _ { I \cap J }$ . The final heatmap shows six such intersection settings and measures the normalized restrictiveness score; in all but one setting, the results are consistent with our theory. We show in Figure 7 that this inconsistency is attributable to the failure of the GAN to distribution-match due to sensitivity to a specific hyperparameter.
|
| 193 |
+
|
| 194 |
+
# 6.2.2 CONSISTENCY VERSUS RESTRICTIVENESS
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 4: Correlation plot and scatterplots demonstrating the empirical relationship between $\tilde { c } ( i )$ and $\tilde { r } ( i )$ across all 864 models trained on Shapes3D.
|
| 198 |
+
|
| 199 |
+
We now determine the extent to which consistency and restrictiveness are correlated in practice. In Figure 4, we collected all 864 Shapes3D models that we trained in Section 6.2.1 and measured the consistency and restrictiveness of each model on each factor, providing both the correlation plot and scatterplots of $\tilde { c } ( i )$ versus $\tilde { r } ( i )$ . Since the models trained in Section 6.2.1 only ever targeted the consistency or restrictiveness of a single factor, and since our calculus demonstrates that consistency and restrictiveness do not imply each other, one might a priori expect to find no correlation in Figure 4. Our results show that the correlation is actually quite strong. Since this correlation is not guaranteed by our choice of weak supervision, it is necessarily a consequence of model inductive bias. We believe this correlation between consistency and restrictiveness to have been a general source of confusion in the disentanglement literature, causing many to either observe or believe that restricted labeling or share pairing on $S _ { i }$ (which only guarantees consistency) is sufficient for disentangling $S _ { i }$ (Kingma et al., 2014; Chen & Batmanghelich, 2019; Gabbay & Hoshen, 2019; Narayanaswamy et al., 2017). It remains an open question why consistency and restrictiveness are so strongly correlated when training existing models on real-world data.
|
| 200 |
+
|
| 201 |
+
# 6.2.3 FULL DISENTANGLEMENT
|
| 202 |
+
|
| 203 |
+

|
| 204 |
+
Figure 5: Disentanglement performance of a vanilla GAN, share pairing GAN, change pairing GAN, rank pairing GAN, and fully-labeled GAN, as measured by the mutual information gap across several datasets. A comprehensive set of performance evaluations on existing disentanglement metrics is available in Figure 13.
|
| 205 |
+
|
| 206 |
+
If we have access to share / change / rank-pairing data for each factor, our calculus states that it is possible to guarantee full disentanglement. We trained our generative model on either complete share pairing, complete change pairing, or complete rank pairing, and measured disentanglement performance via the discretized mutual information gap (Chen et al., 2018a; Locatello et al., 2019). As negative and positive controls, we also show the performance of an unsupervised GAN and a fully-supervised GAN where the latents are fixed to the ground truth factors of variation. Our results in Figure 5 empirically verify that combining single-factor weak supervision datasets leads to consistently high disentanglement scores.
|
| 207 |
+
|
| 208 |
+
# 7 CONCLUSION
|
| 209 |
+
|
| 210 |
+
In this work, we construct a theoretical framework to rigorously analyze the disentanglement guarantees of weak supervision algorithms. Our paper clarifies several important concepts, such as consistency and restrictiveness, that have been hitherto confused or overlooked in the existing literature, and provides a formalism that precisely distinguishes when disentanglement arises from supervision versus model inductive bias. Through our theory and a comprehensive set of experiments, we demonstrated the conditions under which various supervision strategies guarantee disentanglement. Our work establishes several promising directions for future research. First, we hope that our formalism and experiments inspire greater theoretical and scientific scrutiny of the inductive biases present in existing models. Second, we encourage the search for other learning algorithms (besides distribution-matching) that may have theoretical guarantees when paired with the right form of supervision. Finally, we hope that our framework enables the theoretical analysis of other promising weak supervision methods.
|
| 211 |
+
|
| 212 |
+
# ACKNOWLEDGMENTS
|
| 213 |
+
|
| 214 |
+
We would like to thank James Brofos and Honglin Yuan for their insightful discussions on the theoretical analysis in this paper, and Aditya Grover and Hung H. Bui for their helpful feedback during the course of this project.
|
| 215 |
+
|
| 216 |
+
# REFERENCES
|
| 217 |
+
|
| 218 |
+
Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE transactions on pattern analysis and machine intelligence, 35(8):1798–1828, 2013.
|
| 219 |
+
|
| 220 |
+
Diane Bouchacourt, Ryota Tomioka, and Sebastian Nowozin. Multi-level variational autoencoder: Learning disentangled representations from grouped observations. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 221 |
+
|
| 222 |
+
Junxiang Chen and Kayhan Batmanghelich. Weakly supervised disentanglement by pairwise similarities. arXiv preprint arXiv:1906.01044, 2019.
|
| 223 |
+
|
| 224 |
+
Tian Qi Chen, Xuechen Li, Roger B Grosse, and David K Duvenaud. Isolating sources of disentanglement in variational autoencoders. Advances in Neural Information Processing Systems, pp. 2610–2620, 2018a.
|
| 225 |
+
|
| 226 |
+
Yutian Chen, Yannis Assael, Brendan Shillingford, David Budden, Scott Reed, Heiga Zen, Quan Wang, Luis C Cobo, Andrew Trask, Ben Laurie, et al. Sample efficient adaptive text-to-speech. arXiv preprint arXiv:1809.10460, 2018b.
|
| 227 |
+
|
| 228 |
+
Cian Eastwood and Christopher KI Williams. A framework for the quantitative evaluation of disentangled representations. ICLR, 2018.
|
| 229 |
+
|
| 230 |
+
Babak Esmaeili, Hao Wu, Sarthak Jain, Alican Bozkurt, Narayanaswamy Siddharth, Brooks Paige, Dana H Brooks, Jennifer Dy, and Jan-Willem van de Meent. Structured disentangled representations. arXiv preprint arXiv:1804.02086, 2018.
|
| 231 |
+
|
| 232 |
+
Aviv Gabbay and Yedid Hoshen. Latent optimization for non-adversarial representation disentanglement. arXiv preprint arXiv:1906.11796, 2019.
|
| 233 |
+
|
| 234 |
+
Leilani H Gilpin, David Bau, Ben Z Yuan, Ayesha Bajwa, Michael Specter, and Lalana Kagal. Explaining explanations: An overview of interpretability of machine learning. In 2018 IEEE 5th International Conference on data science and advanced analytics (DSAA), pp. 80–89. IEEE, 2018.
|
| 235 |
+
|
| 236 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014.
|
| 237 |
+
|
| 238 |
+
Luigi Gresele, Paul K Rubenstein, Arash Mehrjou, Francesco Locatello, and Bernhard Scholkopf.¨ The incomplete rosetta stone problem: Identifiability results for multi-view nonlinear ica. arXiv preprint arXiv:1905.06642, 2019.
|
| 239 |
+
|
| 240 |
+
Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. ICLR, 2(5):6, 2017.
|
| 241 |
+
|
| 242 |
+
Irina Higgins, David Amos, David Pfau, Sebastien Racaniere, Loic Matthey, Danilo Rezende, and Alexander Lerchner. Towards a definition of disentangled representations. arXiv preprint arXiv:1812.02230, 2018.
|
| 243 |
+
|
| 244 |
+
Hyunjik Kim and Andriy Mnih. Disentangling by factorising. ICML, 2018.
|
| 245 |
+
|
| 246 |
+
Durk P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. Advances in neural information processing systems, pp. 3581–3589, 2014.
|
| 247 |
+
|
| 248 |
+
Jack Klys, Jake Snell, and Richard Zemel. Learning latent subspaces in variational autoencoders. In Advances in Neural Information Processing Systems, pp. 6444–6454, 2018.
|
| 249 |
+
|
| 250 |
+
Tejas D Kulkarni, William F Whitney, Pushmeet Kohli, and Josh Tenenbaum. Deep convolutional inverse graphics network. In Advances in neural information processing systems, pp. 2539–2547, 2015.
|
| 251 |
+
|
| 252 |
+
Abhishek Kumar, Prasanna Sattigeri, and Avinash Balakrishnan. Variational inference of disentangled latent concepts from unlabeled observations. In ICLR, 2018.
|
| 253 |
+
|
| 254 |
+
Yann LeCun, Fu Jie Huang, Leon Bottou, et al. Learning methods for generic object recognition with invariance to pose and lighting. In CVPR (2), pp. 97–104. Citeseer, 2004.
|
| 255 |
+
|
| 256 |
+
Hsin-Ying Lee, Hung-Yu Tseng, Qi Mao, Jia-Bin Huang, Yu-Ding Lu, Maneesh Singh, and MingHsuan Yang. Drit++: Diverse image-to-image translation via disentangled representations. arXiv preprint arXiv:1905.01270, 2019.
|
| 257 |
+
|
| 258 |
+
Francesco Locatello, Stefan Bauer, Mario Lucic, Sylvain Gelly, Bernhard Scholkopf, and Olivier ¨ Bachem. Challenging common assumptions in the unsupervised learning of disentangled representations. ICML, 2019.
|
| 259 |
+
|
| 260 |
+
Brian McFee and Gert R Lanckriet. Metric learning to rank. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), pp. 775–782, 2010.
|
| 261 |
+
|
| 262 |
+
Takeru Miyato and Masanori Koyama. cgans with projection discriminator. arXiv preprint arXiv:1802.05637, 2018.
|
| 263 |
+
|
| 264 |
+
Siddharth Narayanaswamy, T Brooks Paige, Jan-Willem Van de Meent, Alban Desmaison, Noah Goodman, Pushmeet Kohli, Frank Wood, and Philip Torr. Learning disentangled representations with semi-supervised deep generative models. In Advances in Neural Information Processing Systems, pp. 5925–5935, 2017.
|
| 265 |
+
|
| 266 |
+
Scott E Reed, Yi Zhang, Yuting Zhang, and Honglak Lee. Deep visual analogy-making. In Advances in neural information processing systems, pp. 1252–1260, 2015.
|
| 267 |
+
|
| 268 |
+
Karl Ridgeway and Michael C Mozer. Learning deep disentangled embeddings with the f-statistic loss. Advances in Neural Information Processing Systems, pp. 185–194, 2018.
|
| 269 |
+
|
| 270 |
+
Raphael Suter, Dorde Miladinovic, Stefan Bauer, and Bernhard Scholkopf. Interventional robustness ¨ of deep latent variable models. ICML, 2018.
|
| 271 |
+
|
| 272 |
+
Jiang Wang, Yang Song, Thomas Leung, Chuck Rosenberg, Jingbin Wang, James Philbin, Bo Chen, and Ying Wu. Learning fine-grained image similarity with deep ranking. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1386–1393, 2014.
|
| 273 |
+
|
| 274 |
+
# APPENDIX
|
| 275 |
+
|
| 276 |
+
Our appendix consists of nine sections. We provide a brief summary of each section below.
|
| 277 |
+
|
| 278 |
+
Appendix A: We elaborate on the connections between existing definitions of disentanglement and our definitions of consistency / restrictiveness / disentanglement. In particular, we highlight three notable properties of our definitions not present in many existing definitions.
|
| 279 |
+
|
| 280 |
+
Appendix B: We evaluate our consistency and restrictiveness metrics on the 10800 models in the disentanglement lib, and identify models where consistency and restrictiveness are not correlated.
|
| 281 |
+
|
| 282 |
+
Appendix C: We adapt our definitions to be able to handle nuisance variables. We do so through a simple modification of the definition of restrictiveness.
|
| 283 |
+
|
| 284 |
+
Appendix D: We show several additional single-factor experiments. We first address one of the results in the main text that is not consistent with our theory, and explain why it can be attributed to hyperparameter sensitivity. We next unwrap the heatmaps into more informative boxplots.
|
| 285 |
+
|
| 286 |
+
Appendix E: We provide an additional suite of consistency versus restrictiveness experiments by comparing the effects of training with share pairing (which guarantees consistency), change pairing (which guarantees restrictiveness), and both.
|
| 287 |
+
|
| 288 |
+
Appendix F: We provide full disentanglement results on all five datasets as measured according to six different metrics of disentanglement found in the literature.
|
| 289 |
+
|
| 290 |
+
Appendix G: We show visualizations of a weakly supervised generative model trained to achieve full disentanglement.
|
| 291 |
+
|
| 292 |
+
Appendix H: We describe the set of hyperparameter configurations used in all our experiments.
|
| 293 |
+
|
| 294 |
+
Appendix I: We provide the complete set of assumptions and proofs for our theoretical framework.
|
| 295 |
+
|
| 296 |
+
# A CONNECTIONS TO EXISTING DEFINITIONS
|
| 297 |
+
|
| 298 |
+
Numerous definitions of disentanglement are present in the literature (Higgins et al., 2017; 2018; Kim & Mnih, 2018; Suter et al., 2018; Ridgeway & Mozer, 2018; Eastwood & Williams, 2018; Chen et al., 2018a). We mostly defer to the terminology suggested by Ridgeway & Mozer (2018), which decomposes disentanglement into modularity, compactness, and explicitness. Modularity means a latent code $Z _ { i }$ is predictive of at most one factor of variation $S _ { j }$ . Compactness means a factor of variation $S _ { i }$ is predicted by at most one latent code $Z _ { j }$ . And explicitness means a factor of variation $S _ { j }$ is predicted by the latent codes via a simple transformation (e.g. linear). Similar to Eastwood & Williams (2018); Higgins et al. (2018), we suggest a further decomposition of Ridgeway & Mozer (2018)’s explicitness into latent code informativeness and latent code simplicity. In this paper, we omit latent code simplicity from consideration. Since informativeness of the latent code is already enforced by our requirement that $g ( Z )$ is equal in distribution to $g ^ { * } ( S )$ (see Proposition 6), we focus on comparing our proposed concepts of consistency and restrictiveness to modularity and compactness. We make note of three important distinctions.
|
| 299 |
+
|
| 300 |
+
Restrictiveness is not synonymous with either modularity or compactness. In Figure 2c, it is evident the factor of variation size is not predictable any individual $Z _ { i }$ (conversely, $Z _ { 1 }$ is not predictable from any individual factor $S _ { i }$ ). As such, $Z _ { 1 }$ is neither a modular nor compact representation of size, despite being restricted to size. To our knowledge, no existing quantitative definition of disentanglement (or its decomposition) specifically measures restrictiveness.
|
| 301 |
+
|
| 302 |
+
Consistency and restrictiveness are invariant to statistically dependent factors of variation. Many existing definitions of disentanglement are instantiated by measuring the mutual information between $Z$ and $S$ . For example, Ridgeway & Mozer (2018) defines that a latent code $Z _ { i }$ to be “ideally modular” if it has high mutual information with a single factor $S _ { j }$ and zero mutual information with all other factors $S _ { \backslash j }$ . This presents a issue when the true factors of variation themselves are statistically dependent; even if $Z _ { 1 } = S _ { 1 }$ , the latent code $Z _ { 1 }$ would violate modularity if $S _ { 1 }$ itself has positive mutual information with $S _ { 2 }$ . Consistency and restrictiveness circumvent this issue by relying on conditional resampling. Consistency, for example, only measures the extent to which $S _ { I }$ is invariant to resampling of $Z _ { \backslash I }$ when conditioned on $Z _ { I }$ and is thus achieved as long as $s _ { I }$ is a function of only $z _ { I }$ —irrespective of whether $s _ { I }$ and $s _ { \backslash I }$ are statistically dependent. In this regard, our definitions draw inspiration from Suter et al. (2018)’s intervention-based definition but replaces the need for counterfactual reasoning with the simpler conditional sampling. Because we do not assume the factors of variation are statistically independent, our theoretical analysis is also distinct from the closely-related match pairing analysis in Gresele et al. (2019).
|
| 303 |
+
|
| 304 |
+
Consistency and restrictiveness arise in weak supervision guarantees. One of our goals is to propose definitions that are amenable to theoretical analysis. As we can see in Section 4, consistency and restrictiveness serve as the core primitive concepts that we use to describe disentanglement guarantees conferred by various forms of weak supervision.
|
| 305 |
+
|
| 306 |
+
# B EVALUATING CONSISTENCY AND RESTRICTIVENESS ON DISENTANGLEMENT-LIB MODELS
|
| 307 |
+
|
| 308 |
+
To better understand the empirical relationship between consistency and restrictiveness, we calculated the normalized consistency and restrictiveness scores on the suite of 12800 models from disentanglement lib for each ground-truth factor. By using the normalized consistency and restrictiveness scores as probes, we were able to identify models that achieve high consistency but low restrictiveness (and vice versa). In Fig. 6, we highlight two models that are either consistent or restrictive for object color on the Shapes3D dataset.
|
| 309 |
+
|
| 310 |
+

|
| 311 |
+
Figure 6: Visualization of two models from disentanglement lib (model ids 11964 and 12307), matching the schematic in Fig. 2. For each panel, we visualize an interpolation along a single latent across rows, with each row corresponding to a fixed set of values for all other factors. In Fig. 6a, we can see that this factor consistenly represents object color, i.e. each column of images has the same object color, but as we move along rows we see that other factors change as well, e.g. object type, thus this factor is not restricted to object color. In Fig. 6b, we see that varying the factor along each row results in changes to object color but to no other attributes. However if we look across columns, we see that the representation of color changes depending on the setting of other factors, thus this factor is not consistent for object color.
|
| 312 |
+
|
| 313 |
+
# C HANDLING NUISANCE VARIABLES
|
| 314 |
+
|
| 315 |
+
Our theoretical framework can handle nuisance variables, i.e., variables we cannot measure or perform weak supervision on. It may be impossible to label, or provide match-pairing on that factor of variation. For example, while many features of an image are measurable (such as brightness and coloration), we may not be able to measure certain factors of variation or generate data pairs where these factors are kept constant. In this case, we can let one additional variable $\eta$ act as nuisance variable that captures all additional sources of variation / stochasticity.
|
| 316 |
+
|
| 317 |
+
Formally, suppose the full set of true factors is $S \cup \{ \eta \} \in \mathbb { R } ^ { n + 1 }$ . We define $\eta$ -consistency $C _ { \eta } ( I ) =$ $C ( I )$ and $\eta$ -restrictiveness $R _ { \eta } ( I ) = R ( I \cup \{ \eta \} )$ . This captures our intuition that, with nuisance variable, for consistency, we still want changes to $Z _ { \backslash I } \cup \{ \eta \}$ to not modify $S _ { I }$ ; for restrictiveness, we want changes to $Z _ { I } \cup \{ \eta \}$ to only modify $S _ { I } \cup \{ \eta \}$ . We define $\eta$ -disentanglement as $D _ { \eta } ( I ) =$ $C _ { \eta } ( I ) \land R _ { \eta } ( I )$ .
|
| 318 |
+
|
| 319 |
+
All of our calculus still holds where we substitute $C _ { \eta } ( I ) , R _ { \eta } ( I ) , D _ { \eta } ( I )$ for $C ( I ) , R ( I ) , D ( I )$ ; we prove one of the new full disentanglement rule as an illustration:
|
| 320 |
+
|
| 321 |
+
Proposition 1. ${ \textstyle \bigwedge } _ { i = 1 } ^ { n } C _ { \eta } ( i ) \Longleftrightarrow { \textstyle \bigwedge } _ { i = 1 } ^ { n } D _ { \eta } ( i )$
|
| 322 |
+
|
| 323 |
+
Proof. On the one hand, ${ \textstyle \bigwedge } _ { i = 1 } ^ { n } C _ { \eta } ( i ) \Longleftrightarrow { \textstyle \bigwedge } _ { i = 1 } ^ { n } C ( i ) \implies C ( 1 : n ) \implies R ( \eta )$ . On the other hand, ${ \textstyle \bigwedge } _ { i = 1 } ^ { n } C ( i ) \implies { \textstyle \bigwedge } _ { i = 1 } ^ { n } D ( i ) \implies { \textstyle \bigwedge } _ { i = 1 } ^ { n } R ( i )$ . Therefore $L H S ~ \Longrightarrow ~ \forall i \in [ n ] , R ( i ) \land$ $R ( \eta ) \implies R _ { \eta } ( i )$ . The reverse direction is trivial. □
|
| 324 |
+
|
| 325 |
+
In (Locatello et al., 2019), the “instance” factor in SmallNORB and the background image factor in Scream-dSprites are treated as nuisance variables. By Proposition 1, as long as we perform weak supervision on all of the non-nuisance variables (via sharing-pairing, say) to guarantee their consistency with respect to the corresponding true factor of variation, we still have guaranteed full disentanglement despite the existence of nuisance variable and the fact that we cannot measure or perform weak supervision on nuisance variable.
|
| 326 |
+
|
| 327 |
+
# D SINGLE-FACTOR EXPERIMENTS
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 7: This is the same plot as Figure 7, but where we restrict our hyperparameter sweep to always set extra dense $=$ False. See Appendix H for details about hyperparameter sweep.
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure 8: Restricted pairing guarantees consistency. Each plot shows the normalized consistency score of each model for each factor of variation. Our theory predicts each boxplot highlighted in red to achieve the highest consistency. Due to the prevalence of restricted pairing in the existing literature, we chose to only conduct the single-factor restricted labeling experiment on Shapes3D.
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure 9: Change pairing guarantees restrictiveness. Each plot shows normalized restrictiveness score of each model for each factor of variation (row) across different datasets (columns). Different colors indicate models trained with change pairing on different factors. The appropriatelysupervised model for each factor is marked in red.
|
| 337 |
+
|
| 338 |
+

|
| 339 |
+
Figure 10: Share pairing guarantees consistency. Each plot shows normalized consistency score of each model for each factor of variation (row) across different datasets (columns). Different colors indicate models trained with share pairing on different factors. The appropriately-supervised model for each factor is marked in red.
|
| 340 |
+
|
| 341 |
+

|
| 342 |
+
Figure 11: Rank pairing guarantees consistency. Each plot shows normalized consistency score of each model for each factor of variation (row) across different datasets (columns). Different colors indicate models trained with rank pairing on different factors. The appropriately-supervised model for each factor is marked in red.
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
Figure 12: Normalized consistency vs. restrictiveness score of different models on each factor (row) across different datasets (columns). In many of the plots, we see that models trained via changesharing (blue) achieve higher restrictiveness; models trained via share-sharing (orange) achieve higher consistency; models trained via both techniques (green) simultaneously achieve restrictiveness and consistency in most cases.
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 13: Disentanglement performance of a vanilla GAN, share pairing GAN, change pairing GAN, rank pairing GAN, and fully-labeled GAN, as measured by multiple disentanglement metrics in existing literature (rows) across multiple datasets (columns). According to almost all metrics, our weakly supervised models surpass the baseline, and in some cases, even outperform the fully-labeled model.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure 14: Performance of a vanilla GAN (blue), share pairing GAN (orange), change pairing GAN (green), rank pairing GAN (red), and fully-labeled GAN (purple), as measured by normalized consistency score of each factor (rows) across multiple datasets (columns). Factors $\{ 3 , 4 , 5 \}$ in the first column shows that distribution matching to all six change / share pairing datasets is particularly challenging for the models when trained on certain hyperparameter choices. However, since consistency and restrictiveness can be measured in weakly supervised settings, it suffices to use these metrics for hyperparameter selection. We see in Figure 16 and Appendix G that using consistency and restrictiveness for hyperparameter selection serves as a viable weakly-supervised surrogate for existing fully-supervised disentanglement metrics.
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 15: Performance of a vanilla GAN (blue), share pairing GAN (orange), change pairing GAN (green), rank pairing GAN (red), and fully-labeled GAN (purple), as measured by normalized restrictiveness score of each factor (rows) across multiple datasets (columns). Since restrictiveness and consistency are complementary, we see that the anomalies in Figure 14 are reflected in the complementary factors in this figure.
|
| 355 |
+
|
| 356 |
+

|
| 357 |
+
Figure 16: Scatterplot of existing disentanglement metrics versus average normalized consistency and restrictiveness. Whereas existing disentanglement metrics are fully-supervised, it is possible to measure average normalized consistency and restrictiveness with weakly supervised data (sharepairing and match-pairing respectively), making it viable to perform hyperparameter tuning under weakly supervised conditions.
|
| 358 |
+
|
| 359 |
+
# G FULL DISENTANGLEMENT VISUALIZATIONS
|
| 360 |
+
|
| 361 |
+
As a demonstration of the weakly-supervised generative models, we visualize our best-performing match-pairing generative models (as selected according to the normalized consistency score averaged across all the factors). Recall from Figures 2a to 2c that, to visually check for consistency and restrictiveness, it is important that we not only ablate a single factor (across the column), but also show that the factor stays consistent (down the row). Each block of $3 \times 1 2$ images in Figures 17 to 21 checks for disentanglement of the corresponding factor. Each row is constructed by random sampling of $Z _ { \backslash i }$ and then ablating $Z _ { i }$ .
|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
Figure 17: Cars3D. Ground truth factors: elevation, azimuth, object type.
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
|
| 370 |
+

|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure 18: Shapes3D. Ground truth factors: floor color, wall color, object color, object size, object type, and azimuth.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 19: dSprites. Ground truth factors: shape, scale, orientation, X-position, Y-position.
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 20: Scream-dSprites. Ground truth factors: shape, scale, orientation, X-position, Y-position.
|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
|
| 387 |
+

|
| 388 |
+
|
| 389 |
+

|
| 390 |
+
Figure 21: SmallNORB. Ground truth factors: category, elevation, azimuth, lighting condition.
|
| 391 |
+
|
| 392 |
+
# H HYPERPARAMETERS
|
| 393 |
+
|
| 394 |
+
Table 1: We trained a probablistic Gaussian encoder to approximately invert the generative model. The encoder is not trained jointly with the generator, but instead trained separately from the generative model (i.e. encoder gradient does not backpropagate to generative model). During training, the encoder is only exposed to data generated by the learned generative model.
|
| 395 |
+
|
| 396 |
+
Table 2: Generative model architecture.
|
| 397 |
+
|
| 398 |
+
<table><tr><td>Encoder</td></tr><tr><td>4 × 4 spectral norm conv. 32. lReLU 4 × 4 spectral norm conv. 32. IReLU</td></tr><tr><td>4 × 4 spectral norm conv. 64. lReLU</td></tr><tr><td>4 × 4 spectral norm conv. 64. lReLU flatten</td></tr><tr><td>128 spectral norm dense. lReLU</td></tr><tr><td>2 × z-dim spectral norm dense</td></tr></table>
|
| 399 |
+
|
| 400 |
+
<table><tr><td>Generator</td></tr><tr><td>128 dense.ReLU.batchnorm. 1024 dense.ReLU.batchnorm. 4 × 4 × 64 reshape.</td></tr><tr><td>4 × 4 conv. 64.lReLU.batchnorm.</td></tr><tr><td>4 × 4 conv. 32.lReLU.batchnorm.</td></tr><tr><td>4 × 4 conv. 32.lReLU.batchnorm. 4 × 4 conv. 3. sigmoid</td></tr></table>
|
| 401 |
+
|
| 402 |
+
Table 3: Discriminator used for restricted labeling. Parts in red are part of hyperparameter search.
|
| 403 |
+
|
| 404 |
+
<table><tr><td rowspan=1 colspan=1>Discriminator Body</td></tr><tr><td rowspan=1 colspan=1>4 × 4 spectral norm conv. 32 × width. lReLU4 × 4 spectral norm conv. 32 × width. lReLU4 × 4 spectral norm conv. 64 × width. lReLU4 × 4 spectral norm conv. 64 × width. lReLUflatten if extra dense: 128 × width spectral norm dense. IReLU</td></tr><tr><td rowspan=1 colspan=1>Discriminator Auxiliary Channel for Label</td></tr><tr><td rowspan=1 colspan=1>128 × width spectral norm dense. IReLUIf extra dense: 128 × width spectral norm dense. lReLU</td></tr><tr><td rowspan=1 colspan=1>Discriminator head</td></tr><tr><td rowspan=1 colspan=1>concatenate body and auxiliary.128 × width spectral norm dense. iReLU128 × width spectral norm dense.lReLU1 spectral norm dense with bias.</td></tr></table>
|
| 405 |
+
|
| 406 |
+
Table 4: Discriminator used for match pairing. We use a projection discriminator (Miyato & Koyama, 2018) and thus have an unconditional and conditional head. Parts in red are part of hyperparameter search.
|
| 407 |
+
|
| 408 |
+
<table><tr><td>Discriminator Body Applied Separately to x and x'</td></tr><tr><td>4 × 4 spectral norm conv. 32 × width. IReLU</td></tr><tr><td>4 × 4 spectral norm conv. 32 × width. IReLU 4 × 4 spectral norm conv. 64 × width. IReLU</td></tr><tr><td>4 × 4 spectral norm conv. 64 × width. lReLU flatten</td></tr><tr><td> If extra dense: 128 × width spectral norm dense. lReLU</td></tr><tr><td>concatenate the pair. 128 × width spectral norm dense. lReLU</td></tr><tr><td>128 × width spectral norm dense. lReLU</td></tr><tr><td></td></tr><tr><td>Unconditional Head</td></tr><tr><td>1 spectral norm dense with bias Conditional Head</td></tr></table>
|
| 409 |
+
|
| 410 |
+
Table 5: Discriminator used for rank pairing. For rank-pairing, we use a special variant of the projection discriminator, where the conditional logit is computed via taking the difference between the two pairs and multiplying by $y \in \{ - 1 , + 1 \}$ . The discriminator is thus implicitly taking on the role of an adversarially trained encoder that checks for violations of the ranking rule in the embedding space. Parts in red are part of hyperparameter search.
|
| 411 |
+
|
| 412 |
+
<table><tr><td>Discriminator Body Applied Separately to x and x'</td></tr><tr><td>4 × 4 spectral norm conv. 32 × width. lReLU 4 × 4 spectral norm conv. 32 × width. IReLU</td></tr><tr><td>4 × 4 spectral norm conv. 64 × width. lReLU</td></tr><tr><td>4 × 4 spectral norm conv. 64 × width. lReLU flatten</td></tr><tr><td>If extra dense: 128 × width spectral norm dense. lReLU concatenate the pair.</td></tr><tr><td>Unconditional Head Applied Separately to x and x'</td></tr><tr><td>1 spectral norm dense with bias.</td></tr><tr><td>Conditional Head Applied Separately to x and x'</td></tr><tr><td>y-dim spectral norm dense.</td></tr></table>
|
| 413 |
+
|
| 414 |
+
For all models, we use the Adam optimizer with $\beta _ { 1 } = 0 . 5 , \beta _ { 2 } = 0 . 9 9 9$ and set the generator learning rate to $1 \times 1 0 ^ { - 3 }$ . We use a batch size of 64 and set the leaky ReLU negative slope to 0.2.
|
| 415 |
+
|
| 416 |
+
To demonstrate some degree of robustness to hyperparameter choices, we considered five different ablations:
|
| 417 |
+
|
| 418 |
+
1. Width multiplier on the discriminator network $( \{ 1 , 2 \} )$
|
| 419 |
+
2. Whether to add an extra fully-connected layer to the discriminator $( \{ \mathrm { T r u e } , \mathrm { F a l s e } \} )$ .
|
| 420 |
+
3. Whether to add a bias term to the head $\langle \mathrm { T r u e } , \mathrm { F a l s e } \rangle \rangle$ .
|
| 421 |
+
4. Whether to use two-time scale learning rate by setting encoder+discriminator learning rate
|
| 422 |
+
multipler to $( \{ 1 , 2 \} )$ .
|
| 423 |
+
5. Whether to use the default PyTorch or Keras initialization scheme in all models.
|
| 424 |
+
|
| 425 |
+
As such, each of our experimental setting trains a total of 32 distinct models. The only exception is the intersection experiments where we fixed the width multiplier to 1.
|
| 426 |
+
|
| 427 |
+
To give a sense of the scale of our experimental setup, note that the 864 models in Figure 4 originate as follows:
|
| 428 |
+
|
| 429 |
+
1. 32 hyperparameter conditions $\times 6$ restricted labeling conditions.
|
| 430 |
+
2. 32 hyperparameter conditions $\times 6$ match pairing conditions.
|
| 431 |
+
3. 32 hyperparameter conditions $\times 6$ share pairing conditions.
|
| 432 |
+
4. 32 hyperparameter conditions $\times 6$ rank pairing conditions.
|
| 433 |
+
5. 16 hyperparameter conditions $\times 6$ intersection conditions.
|
| 434 |
+
|
| 435 |
+
# I PROOFS
|
| 436 |
+
|
| 437 |
+
# I.1 ASSUMPTIONS ON $\mathcal { H }$
|
| 438 |
+
|
| 439 |
+
Assumption 1. Let $D \subseteq [ n ]$ indexes discrete random variables $S _ { D }$ . Assume that the remaining random variables $S _ { C } = S _ { \backslash D }$ have probability density function $p ( s _ { C } | s _ { D } )$ for any set of values $s _ { D }$ where $p ( S _ { D } = s _ { D } ) > 0$ .
|
| 440 |
+
|
| 441 |
+
Assumption 2. Without loss of generality, suppose $S _ { 1 : n } = [ S _ { C } , S _ { D } ]$ is ordered by concatenating the continuous variables with the discrete variables. Let $\bar { \mathcal { B } ( s _ { D } ) } \ : = \ : [ \mathrm { i n t } ( \mathrm { s u p p } ( p ( s _ { C } \ : | \ : s _ { D } ) ) ) , s _ { D } ]$ denote the interior of the support of the continuous conditional distribution of $S _ { C }$ concatenated with its conditioning variable $s _ { D }$ drawn from $S _ { D }$ . With a slight abuse of notation, let $B ( S ) =$ $\textstyle \bigcup _ { s _ { D } : p ( s _ { D } > 0 ) } B ( s _ { D } )$ . We assume $B ( S )$ is zig-zag connected, i.e., for any $I , J \subseteq [ n ]$ , for any two points $s _ { 1 : n } , s _ { 1 : n } ^ { \prime } \in B ( S )$ that only differ in coordinates in $I \cup J$ , there exists a path $\{ s _ { 1 : n } ^ { t } \} _ { t = 0 : T }$ contained in $B ( S )$ such that
|
| 442 |
+
|
| 443 |
+
$$
|
| 444 |
+
\begin{array} { r l } & { s _ { 1 : n } ^ { 0 } = s _ { 1 : n } } \\ & { ~ s _ { 1 : n } ^ { T } = s _ { 1 : n } ^ { \prime } } \\ & { \forall 0 \leq t < T , \mathrm { e i t h e r } s _ { \setminus \ I } ^ { t } = s _ { \setminus I } ^ { t + 1 } \mathrm { o r } s _ { \setminus J } ^ { t } = s _ { \setminus J } ^ { t + 1 } , } \end{array}
|
| 445 |
+
$$
|
| 446 |
+
|
| 447 |
+
Intuitively, this assumption allows transition from $s _ { 1 : n }$ to $s _ { 1 : n } ^ { \prime }$ via a series of modifications that are only in $I$ or only in $J$ . Note that zig-zag connectedness is necessary for restrictiveness union (Proposition 3) and consistency intersection (Proposition 4). Fig. 22 gives examples where restrictiveness union is not satisfied when zig-zag connectedness is violated.
|
| 448 |
+
|
| 449 |
+
Assumption 3. For arbitrary coordinate $j \in [ m ]$ of $g$ that maps to a continuous variable $X _ { j }$ , we assume that $g _ { j } ( s )$ is continuous at $s$ , $\forall s \in B ( S )$ ; For arbitrary coordinate $j \in [ m ]$ of $g$ that maps to a discrete variable $X _ { j }$ , $\forall s _ { D }$ where $p ( \boldsymbol { s } _ { D } ) > 0$ , we assume that $g _ { j } ( s )$ is constant over each connected component of $\operatorname { i n t } ( \operatorname { s u p p } ( p ( s _ { C } \mid s _ { D } ) )$ .
|
| 450 |
+
|
| 451 |
+
Define $B ( X )$ analogously to $B ( S )$ . Symmetrically, for arbitrary coordinate $i \in [ n ]$ of $e$ that maps to a continuous variable $S _ { i }$ , we assume that $e _ { i } ( x )$ is continuous at $x$ $\ u , \forall x \in B ( X )$ ; For arbitrary coordinate $i \in [ n ]$ of $e$ that maps to a discrete $S _ { i }$ , $\forall x _ { D }$ where $p ( x _ { D } ) > 0$ , we assume that $e _ { i } ( x )$ is constant over each connected component of $\operatorname { i n t } ( \operatorname { s u p p } ( p ( x _ { C } \mid x _ { D } ) )$ .
|
| 452 |
+
|
| 453 |
+
Assumption 4. Assume that every factor of variation is recoverable from the observation $\mathcal { X }$ . Formally, $( p , g , e )$ satisfies the following property
|
| 454 |
+
|
| 455 |
+
$$
|
| 456 |
+
\mathbb { E } _ { p ( s _ { 1 : n } ) } \| e \circ g ( s _ { 1 : n } ) - s _ { 1 : n } \| ^ { 2 } = 0 .
|
| 457 |
+
$$
|
| 458 |
+
|
| 459 |
+
# I.2 CALCULUS OF DISENTANGLEMENT
|
| 460 |
+
|
| 461 |
+
# I.2.1 EXPECTED-NORM REDUCTION LEMMA
|
| 462 |
+
|
| 463 |
+
Lemma 1. Let $x , y$ be two random variables with distribution $p$ , $f ( x , y )$ be arbitrary function. Then
|
| 464 |
+
|
| 465 |
+
$$
|
| 466 |
+
\begin{array} { r } { \mathbb { E } _ { x \sim p ( x ) } \mathbb { E } _ { y , y ^ { \prime } \sim p ( y | x ) } \| f ( x , y ) - f ( x , y ^ { \prime } ) \| ^ { 2 } \leq \mathbb { E } _ { ( x , y ) , ( x ^ { \prime } , y ^ { \prime } ) \sim p ( x , y ) } \| f ( x , y ) - f ( x ^ { \prime } , y ^ { \prime } ) \| ^ { 2 } . } \end{array}
|
| 467 |
+
$$
|
| 468 |
+
|
| 469 |
+
Proof. Assume w.l.o.g that $\mathbb { E } _ { ( x , y ) \sim p ( x , y ) } f ( x , y ) = 0$
|
| 470 |
+
|
| 471 |
+
$$
|
| 472 |
+
\begin{array} { r l } & { L H S = 2 \mathbb { E } _ { ( x , y ) \sim p ( x , y ) } \| f ( x , y ) \| ^ { 2 } - 2 \mathbb { E } _ { x \sim p ( x ) } \mathbb { E } _ { y , y ^ { \prime } \sim p ( y | x ) } f ( x , y ) ^ { T } f ( x , y ^ { \prime } ) } \\ & { \qquad = 2 \mathbb { E } _ { ( x , y ) \sim p ( x , y ) } \| f ( x , y ) \| ^ { 2 } - 2 \mathbb { E } _ { x \sim p ( x ) } \mathbb { E } _ { y \sim p ( y | x ) } f ( x , y ) ^ { T } \mathbb { E } _ { y ^ { \prime } \sim p ( y | x ) } f ( x , y ^ { \prime } ) } \\ & { \qquad = 2 \mathbb { E } _ { ( x , y ) \sim p ( x , y ) } \| f ( x , y ) \| ^ { 2 } - 2 \mathbb { E } _ { x \sim p ( x ) } \| \mathbb { E } _ { y \sim p ( y | x ) } f ( x , y ) \| ^ { 2 } } \\ & { \qquad \le 2 \mathbb { E } _ { ( x , y ) \sim p ( x , y ) } \| f ( x , y ) \| ^ { 2 } } \\ & { \qquad = 2 \mathbb { E } _ { ( x , y ) \sim p ( x , y ) } \| f ( x , y ) \| ^ { 2 } - 2 \| \mathbb { E } _ { ( x , y ) \sim p ( x , y ) } f ( x , y ) \| ^ { 2 } } \\ & { \qquad = 2 \mathbb { E } _ { ( x , y ) \sim p ( x , y ) } \| f ( x , y ) \| ^ { 2 } - 2 \mathbb { E } _ { ( x , y ) , ( x ^ { \prime } , y ^ { \prime } ) \sim p ( x , y ) } f ( x , y ) ^ { T } f ( x ^ { \prime } , y ^ { \prime } ) } \\ & { \qquad = R H S . } \end{array}
|
| 473 |
+
$$
|
| 474 |
+
|
| 475 |
+
# I.2.2 CONSISTENCY UNION
|
| 476 |
+
|
| 477 |
+
Let $L = I \cap J , K = \backslash ( I \cup J )$ , $M = I - L , N = J - L .$ .
|
| 478 |
+
Proposition 2. $C ( I ) \land C ( J ) \implies C ( I \cup J )$ .
|
| 479 |
+
|
| 480 |
+
Proof.
|
| 481 |
+
|
| 482 |
+
$$
|
| 483 |
+
\begin{array} { r } { C ( I ) \implies \mathbb { E } _ { z _ { M } , z _ { L } } \mathbb { E } _ { z _ { N } , z _ { N } ^ { \prime } , z _ { K } , z _ { K } ^ { \prime } } \lVert r _ { I } \circ G ( z _ { M } , z _ { L } , z _ { N } , z _ { K } ) - r _ { I } \circ G ( z _ { M } , z _ { L } , z _ { N } ^ { \prime } , z _ { K } ^ { \prime } ) \rVert ^ { 2 } = 0 . } \end{array}
|
| 484 |
+
$$
|
| 485 |
+
|
| 486 |
+
For any fixed value of $z _ { M } , z _ { L }$ ,
|
| 487 |
+
|
| 488 |
+
$$
|
| 489 |
+
\begin{array} { r l } & { \mathbb { E } _ { z _ { N } , z _ { N } ^ { \prime } , z _ { K } , z _ { K } ^ { \prime } } \| r _ { I } \circ G ( z _ { M } , z _ { L } , z _ { N } , z _ { K } ) - r _ { I } \circ G ( z _ { M } , z _ { L } , z _ { N } ^ { \prime } , z _ { K } ^ { \prime } ) \| ^ { 2 } } \\ & { \geq \mathbb { E } _ { z _ { N } } \mathbb { E } _ { z _ { K } , z _ { K } ^ { \prime } } \| r _ { I } \circ G ( z _ { M } , z _ { L } , z _ { N } , z _ { K } ) - r _ { I } \circ G ( z _ { M } , z _ { L } , z _ { N } , z _ { K } ^ { \prime } ) \| ^ { 2 } . } \end{array}
|
| 490 |
+
$$
|
| 491 |
+
|
| 492 |
+
by plugging in $x = z _ { N } , y = z _ { K }$ into Lemma 1. Therefore
|
| 493 |
+
|
| 494 |
+
$$
|
| 495 |
+
\begin{array} { r } { C ( I ) \implies \mathbb { E } _ { z _ { M } , z _ { L } , z _ { N } } \mathbb { E } _ { z _ { K } , z _ { K } ^ { \prime } } \| r _ { I } \circ G ( z _ { M } , z _ { L } , z _ { N } , z _ { K } ) - r _ { I } \circ G ( z _ { M } , z _ { L } , z _ { N } , z _ { K } ^ { \prime } ) \| ^ { 2 } = 0 . } \end{array}
|
| 496 |
+
$$
|
| 497 |
+
|
| 498 |
+
Similarly we have
|
| 499 |
+
|
| 500 |
+
$$
|
| 501 |
+
\begin{array} { r l } & { C ( J ) \implies \mathbb { E } _ { z _ { M } , z _ { L } , z _ { N } } \mathbb { E } _ { z _ { K } , z _ { K } ^ { \prime } } \| r _ { J } \circ G ( z _ { M } , z _ { L } , z _ { N } , z _ { K } ) - r _ { J } \circ G ( z _ { M } , z _ { L } , z _ { N } , z _ { K } ^ { \prime } ) \| ^ { 2 } = 0 } \\ & { \qquad \implies \mathbb { E } _ { z _ { M } , z _ { L } , z _ { N } } \mathbb { E } _ { z _ { K } , z _ { K } ^ { \prime } } \| r _ { N } \circ G ( z _ { M } , z _ { L } , z _ { N } , z _ { K } ) - r _ { N } \circ G ( z _ { M } , z _ { L } , z _ { N } , z _ { K } ^ { \prime } ) \| ^ { 2 } = 0 . } \end{array}
|
| 502 |
+
$$
|
| 503 |
+
|
| 504 |
+
As $I \cap N = \emptyset$ , $I \cup N = I \cup J$ , adding the above two equations gives us $C ( I \cup J )$ .
|
| 505 |
+
|
| 506 |
+
# I.2.3 RESTRICTIVENESS UNION
|
| 507 |
+
|
| 508 |
+

|
| 509 |
+
Figure 22: Zig-zag connectedness is necessary for restriveness union. Here $n = m = 3$ . Colored areas indicate the support of $p ( z _ { 1 } , z _ { 2 } )$ ; the marked numbers indicate the measurement of $s _ { 3 }$ given $( z _ { 1 } , z _ { 2 } )$ . Left two panels satisfy zig-zag connectedness (the paths are marked in gray) while the right two do not (indeed $R ( 1 ) \wedge R ( \bar { 2 } ) \not \Rightarrow R ( \bar { \{ 1 , 2 \} } ) )$ . In the right-most panel, any zig-zag path connecting two points from blue and orange areas has to pass through boundary of the support (disallowed).
|
| 510 |
+
|
| 511 |
+
Similarly define index sets $L , K , M , N$
|
| 512 |
+
|
| 513 |
+
Proposition 3. Under assumptions specified in Appendix I.1, $R ( I ) \land R ( J ) \implies R ( I \cup J )$ .
|
| 514 |
+
|
| 515 |
+
Proof. Denote $f = e _ { K } ^ { * } \circ g$ . We claim that
|
| 516 |
+
|
| 517 |
+
$$
|
| 518 |
+
\begin{array} { r l } & { R ( I ) \Longleftrightarrow \mathbb { E } _ { z _ { \backslash I } } \mathbb { E } _ { z _ { I } , z _ { I } ^ { \prime } } \Vert f ( z _ { I } , z _ { \backslash I } ) - f ( z _ { I } ^ { \prime } , z _ { \backslash I } ) \Vert ^ { 2 } = 0 . } \\ & { \qquad \Longleftrightarrow \forall ( z _ { I } , z _ { \backslash I } ) , ( z _ { I } ^ { \prime } , z _ { \backslash I } ) \in \mathcal { B } ( Z ) , f ( z _ { I } , z _ { \backslash I } ) = f ( z _ { I } ^ { \prime } , z _ { \backslash I } ) . } \end{array}
|
| 519 |
+
$$
|
| 520 |
+
|
| 521 |
+
We first prove the backward direction: When we draw $z _ { \backslash I } \sim p ( z _ { \backslash I } ) , z _ { I } , z _ { I } ^ { \prime } \sim p ( z _ { I } | z _ { \backslash I } )$ , let $E _ { 1 }$ denote the event that $( z _ { I } , z _ { \backslash I } ) \notin B ( Z )$ , and $E _ { 2 }$ denote the event that $( z _ { I } ^ { \prime } , z _ { \backslash I } ) \notin B ( Z )$ . Reorder the indices of $( z _ { I } , z _ { \backslash I } )$ as $( z _ { C } , z _ { D } )$ . The probability that $( z _ { I } , z _ { \backslash I } ) \notin B ( Z )$ (i.e., $z _ { C }$ is on the boundary of $B ( z _ { D } ) )$ ) is 0. Therefore $\operatorname* { P r } [ E _ { 1 } ] = \operatorname* { P r } [ E _ { 2 } ] = 0$ . Therefore $\operatorname* { P r } [ E _ { 1 } \cup E _ { 2 } ] \leq \operatorname* { P r } [ E _ { 1 } ] + \operatorname* { P r } [ E _ { 2 } ] = 0$ , i.e., with probability 1, $\| f ( z _ { I } , z _ { \setminus I } ) - f ( z _ { I } ^ { \prime } , z _ { \setminus I } ) \| ^ { 2 } = 0$ .
|
| 522 |
+
|
| 523 |
+
Now we prove the forward direction: Assume for the sake of contradiction that $\exists ( z _ { I } , z _ { \backslash I } ) , ( \bar { z } _ { I } ^ { \prime } , z _ { \backslash I } ) \in \mathcal { B } ( Z )$ such that $f ( z _ { I } , z _ { \backslash I } ) < f ( z _ { I } ^ { \prime } , z _ { \backslash I } )$ . Denote $U = I \cap D$ , $V = I \cap C$ , $W = \backslash I \cap D$ , $Q = \backslash I \cap C$ . We have $f ( z _ { U } , z _ { V } , z _ { W } , z _ { Q } ) < f ( z _ { U } ^ { \prime } , z _ { V } ^ { \prime } , z _ { W } , z _ { Q } )$ . Since $f$ is continuous (or constant) at $( z _ { U } , z _ { V } , z _ { W } , z _ { Q } )$ in the interior of $B ( [ z _ { U } , \bar { z } _ { W } ] )$ , and $f$ is also continuous (or constant) at $\left( z _ { U } ^ { \prime } , z _ { V } ^ { \prime } , z _ { W } , z _ { Q } \right)$ in the interior of $B \big ( \big [ z _ { U } ^ { \prime } , z _ { W } \big ] \big )$ , we can draw open balls of radius $r > 0$ around each point, i.e., $B _ { r } ( \tilde { z } _ { V } , z _ { Q } ) \subset B ( [ z _ { U } , z _ { W } ] )$ and $\vec { B _ { r } } ( z _ { V } ^ { \prime } , z _ { Q } ) \subset \vec { B } ( [ \bar { z } _ { U } ^ { \prime } , z _ { W } ] )$ , where
|
| 524 |
+
|
| 525 |
+
$$
|
| 526 |
+
\begin{array} { r } { \forall ( z _ { V } ^ { * } , z _ { Q } ^ { * } ) \in B _ { r } ( z _ { V } , z _ { Q } ) , \forall ( z _ { V } ^ { \Delta } , z _ { Q } ^ { \Delta } ) \in B _ { r } ( z _ { V } ^ { \prime } , z _ { Q } ) , f ( z _ { U } , z _ { V } ^ { * } , z _ { W } , z _ { Q } ^ { * } ) < f ( z _ { U } ^ { \prime } , z _ { V } ^ { \Delta } , z _ { W } , z _ { Q } ^ { \Delta } ) . } \end{array}
|
| 527 |
+
$$
|
| 528 |
+
|
| 529 |
+
When we draw $z _ { \backslash I } \sim p ( z _ { \backslash I } ) , z _ { I } , z _ { I } ^ { \prime } \sim p ( z _ { I } | z _ { \backslash I } )$ , let $C$ denote the event that $\left( z _ { I } , z _ { \backslash I } \right) \ =$ $( z _ { V } ^ { \ast } , z _ { U } , z _ { Q } ^ { \# } , z _ { W } )$ , $\begin{array} { r l r } { ( z _ { I } ^ { \prime } , z _ { \backslash I } ) } & { { } = } & { ( z _ { V } ^ { \Delta } , z _ { U } ^ { \prime } , z _ { Q } ^ { \# } , z _ { W } ) } \end{array}$ where $\begin{array} { r l r } { ( z _ { V } ^ { * } , z _ { Q } ^ { \# } ) } & { { } \in } & { B _ { r } ( z _ { V } , z _ { Q } ) } \end{array}$ and $\begin{array} { r l r } { ( z _ { V } ^ { \Delta } , z _ { Q } ^ { \# } ) } & { { } \in } & { B _ { r } ( z _ { V } ^ { \prime } , z _ { Q } ) } \end{array}$ . Since both balls have positive volume, $\mathrm { P r } [ C ] ~ > ~ 0$ . However, $\| f ( z _ { I } , z _ { \setminus I } ) - f ( z _ { I } ^ { \prime } , z _ { \setminus I } ) \| ^ { 2 } > 0$ whenever event $C$ happens, which contradicts $R ( I )$ . Therefore $\forall ( z _ { I } , z _ { \setminus I } ) , ( z _ { I } ^ { \prime } , z _ { \setminus I } ) \in \mathcal { B } ( Z ) , f ( z _ { I } , z _ { \setminus I } ) = f ( z _ { I } ^ { \prime } , z _ { \setminus I } )$ .
|
| 530 |
+
|
| 531 |
+
We have shown that
|
| 532 |
+
|
| 533 |
+
$$
|
| 534 |
+
\begin{array} { r } { \{ ( I ) \Longleftrightarrow \forall ( z _ { M } , z _ { L } , z _ { N } , z _ { K } ) , ( z _ { M } ^ { \prime } , z _ { L } ^ { \prime } , z _ { N } , z _ { K } ) \in \mathcal { B } ( Z ) , f ( z _ { M } , z _ { L } , z _ { N } , z _ { K } ) = f ( z _ { M } ^ { \prime } , z _ { L } ^ { \prime } , z _ { N } , z _ { K } ) . } \end{array}
|
| 535 |
+
$$
|
| 536 |
+
|
| 537 |
+
Similarly
|
| 538 |
+
|
| 539 |
+
$$
|
| 540 |
+
\begin{array} { r l r } & { } & { R ( J ) \Longleftrightarrow \forall ( z _ { M } , z _ { L } , z _ { N } , z _ { K } ) , ( z _ { M } , z _ { L } ^ { \prime } , z _ { N } ^ { \prime } , z _ { K } ) \in \mathcal { B } ( Z ) , f ( z _ { M } , z _ { L } , z _ { N } , z _ { K } ) = f ( z _ { M } , z _ { L } ^ { \prime } , z _ { N } ^ { \prime } , z _ { K } ) } \\ & { } & { \mathrm { ~ } \mathrm ( 3 4 ) } \\ & { } & \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm { ~ } \mathrm \end{array}
|
| 541 |
+
$$
|
| 542 |
+
|
| 543 |
+
Let the zig-zag path between $\left( z _ { M } , z _ { L } , z _ { N } , z _ { K } \right)$ and $\begin{array} { r l r } { ( z _ { M } ^ { \prime } , z _ { L } ^ { \prime } , z _ { N } ^ { \prime } , z _ { K } ) } & { { } \in } & { B ( Z ) } \end{array}$ be $\{ ( z _ { M } ^ { t } , z _ { L } ^ { t } , z _ { N } ^ { t } , z _ { K } ) \} _ { t = 0 } ^ { T }$ . Repeatedly applying the equivalent conditions of $R ( I )$ and $R ( J )$ gives us
|
| 544 |
+
|
| 545 |
+
$$
|
| 546 |
+
\begin{array} { r } { { ^ { \mathrm { r } } ( z _ { M } , z _ { L } , z _ { N } , z _ { K } ) } = f ( z _ { M } ^ { 1 } , z _ { L } ^ { 1 } , z _ { N } ^ { 1 } , z _ { K } ) = \cdot \cdot \cdot = f ( z _ { M } ^ { T - 1 } , z _ { L } ^ { T - 1 } , z _ { N } ^ { T - 1 } , z _ { K } ) = f ( z _ { M } ^ { \prime } , z _ { L } ^ { \prime } , z _ { N } ^ { \prime } , z _ { K } ) . } \end{array}
|
| 547 |
+
$$
|
| 548 |
+
|
| 549 |
+
# I.3 CONSISTENCY AND RESTIVENESS INTERSECTION
|
| 550 |
+
|
| 551 |
+
Proposition 4. Under the same assumptions as restrictiveness union, $C ( I ) \land C ( J ) \implies C ( I \cap J )$
|
| 552 |
+
|
| 553 |
+
Proof.
|
| 554 |
+
|
| 555 |
+
$$
|
| 556 |
+
\begin{array} { r } { C ( I ) \wedge C ( J ) \implies R ( \backslash I ) \wedge R ( \backslash J ) } \\ { \implies R ( \backslash I \cup \backslash J ) } \\ { \implies C ( \backslash ( \backslash J \cup \backslash J ) ) } \\ { \implies C ( I \cap J ) . } \end{array}
|
| 557 |
+
$$
|
| 558 |
+
|
| 559 |
+
Proposition 5. $R ( I ) \land R ( J ) \implies R ( I \cap J )$ .
|
| 560 |
+
|
| 561 |
+
Proof is analogous to Proposition 4.
|
| 562 |
+
|
| 563 |
+
# I.4 DISTRIBUTION MATCHING GUARANTEES LATENT CODE INFORMATIVENESS
|
| 564 |
+
|
| 565 |
+
Proposition 6. If $( p ^ { * } , g ^ { * } , e ^ { * } ) \in \mathcal { H }$ , and $( p , g , e ) \in \mathcal { H }$ , and $g ^ { * } ( S ) \ { \stackrel { d } { = } } \ g ( Z )$ , then there exists a continuous function $r$ such that
|
| 566 |
+
|
| 567 |
+
$$
|
| 568 |
+
\mathbb { E } _ { p ( s _ { 1 : n } ) } \| r \circ e \circ g ^ { * } ( s ) - s \| = 0 .
|
| 569 |
+
$$
|
| 570 |
+
|
| 571 |
+
Proof. We show that $r = e ^ { * } \circ g$ satisfies Proposition 6. By Assumption 4,
|
| 572 |
+
|
| 573 |
+
$$
|
| 574 |
+
\begin{array} { r } { \mathbb { E } _ { s } \| e ^ { * } \circ g ^ { * } ( s ) - s \| ^ { 2 } = 0 . } \\ { \mathbb { E } _ { z } \| e \circ g ( z ) - z \| ^ { 2 } = 0 . } \end{array}
|
| 575 |
+
$$
|
| 576 |
+
|
| 577 |
+
By the same reasoning as in the proof of Proposition 3,
|
| 578 |
+
|
| 579 |
+
$$
|
| 580 |
+
\begin{array} { r l } & { \mathbb { E } _ { s } \| e ^ { * } \circ g ^ { * } ( s ) - s \| ^ { 2 } = 0 \implies \forall s \in \mathcal { B } ( S ) , e ^ { * } \circ g ^ { * } ( s ) = s . } \\ & { \quad \mathbb { E } _ { z } \| e \circ g ( z ) - z \| ^ { 2 } = 0 \implies \forall z \in \mathcal { B } ( Z ) , e \circ g ( z ) = z . } \end{array}
|
| 581 |
+
$$
|
| 582 |
+
|
| 583 |
+
Let $s \sim p ( s )$ . We claim that $\mathrm { P r } [ E _ { 1 } ] = 1$ , where $E _ { 1 }$ denote the event that $\exists z \in B ( Z )$ such that $g ^ { * } ( s ) = g ( z )$ . Suppose to the contrary that there is a measure-non-zero set $S \subseteq s u p p ( p ( s ) )$ such that $\forall s \in S$ , no $z \in B ( Z )$ satisfies $g ^ { * } ( s ) = g ( z )$ . Let ${ \mathcal { X } } = \{ g ( s ) : s \in { \mathcal { S } } \}$ . As $g ^ { * } ( S ) \stackrel { d } { = } g ( Z )$ , $\operatorname* { P r } _ { s } [ g ^ { * } ( s ) \in \mathcal { X } ] = \operatorname* { P r } _ { z } [ g ( z ) \in \mathcal { X } ] > 0$ . Therefore $\exists \mathcal { Z } \subseteq s u p p ( p ( z ) ) - B ( Z )$ such that $\mathcal { X } \subseteq \{ g ( z ) :$ $z \in { \mathcal { Z } } ) \}$ . But $s u p p ( p ( z ) ) - B ( Z )$ has measure 0. Contradiction.
|
| 584 |
+
|
| 585 |
+
When we draw $s$ , let $E _ { 2 }$ denote the event that $s \in B ( S )$ . $\mathrm { P r } [ E _ { 2 } ] = 1$ , so $\operatorname* { P r } [ E _ { 1 } \land E _ { 2 } ] = 1$ . When $E _ { 1 } \wedge E _ { 2 }$ happens, $e ^ { * } \circ g \circ e \circ g ^ { * } ( s ) = e ^ { * } \circ g \circ e \circ g ( z ) = e ^ { * } \circ g ( z ) = e ^ { * } \circ g ^ { * } ( s ) = s$ . Therefore
|
| 586 |
+
|
| 587 |
+
$$
|
| 588 |
+
\mathbb { E } _ { s } \| e ^ { * } \circ g \circ e \circ g ^ { * } ( s ) - s \| = 0 .
|
| 589 |
+
$$
|
| 590 |
+
|
| 591 |
+
# I.5 WEAK SUPERVISION GUARANTEE
|
| 592 |
+
|
| 593 |
+
Theorem 1. Given any oracle $( p ^ { \ast } ( s ) , g ^ { \ast } , e ^ { \ast } ) \in \mathcal { H }$ , consider the distribution-matching algorithm $\mathcal { A }$ that selects a model $( p ( z ) , g , e ) \in \mathcal { H }$ such that:
|
| 594 |
+
|
| 595 |
+
$$
|
| 596 |
+
\left( g ^ { \ast } ( S _ { I } , S _ { \setminus I } ) , g ^ { \ast } ( S _ { I } , S _ { \setminus I } ^ { \prime } ) \right) \stackrel { d } { = } \left( g ( Z _ { I } , Z _ { \setminus I } ) , g ( Z _ { I } , Z _ { \setminus I } ^ { \prime } ) \right) ( M a t c h P a i r i n g ) ; o r
|
| 597 |
+
$$
|
| 598 |
+
|
| 599 |
+
$$
|
| 600 |
+
\begin{array} { r } { ( g ^ { * } ( S ) , g ^ { * } ( S ^ { \prime } ) , \mathbf { 1 } \left\{ S _ { I } \leq S _ { I } ^ { \prime } \right\} ) \stackrel { d } { = } ( g ( Z ) , g ( Z ^ { \prime } ) , \mathbf { 1 } \left\{ Z _ { I } \leq Z _ { I } ^ { \prime } \right\} ) ( R a n k ~ P a i r i n g ) . } \end{array}
|
| 601 |
+
$$
|
| 602 |
+
|
| 603 |
+
Then $( p , g )$ satisfies $C ( I ; p , g , e ^ { * } )$ and e satisfies $C ( I ; p ^ { * } , g ^ { * } , e )$ .
|
| 604 |
+
|
| 605 |
+
Proof. We prove the three cases separately:
|
| 606 |
+
|
| 607 |
+
1. Since $( x _ { d } , s _ { I } ) \overset { d } { = } ( x _ { g } , z _ { I } )$ , consider the measurable function
|
| 608 |
+
|
| 609 |
+
$$
|
| 610 |
+
f ( a , b ) = \| e _ { I } ^ { * } ( a ) - b \| ^ { 2 } .
|
| 611 |
+
$$
|
| 612 |
+
|
| 613 |
+
We have
|
| 614 |
+
|
| 615 |
+
$$
|
| 616 |
+
\begin{array} { r } { \mathbb { E } \| e _ { I } ^ { * } ( x _ { d } ) - s _ { I } \| ^ { 2 } = \mathbb { E } \| e _ { I } ^ { * } ( x _ { g } ) - z _ { I } \| ^ { 2 } = 0 . } \end{array}
|
| 617 |
+
$$
|
| 618 |
+
|
| 619 |
+
By the same reasoning as in the proof of Proposition 3,
|
| 620 |
+
|
| 621 |
+
$$
|
| 622 |
+
\begin{array} { r } { \mathbb { E } _ { z } \| e _ { I } ^ { * } \circ g ( z ) - z _ { I } \| ^ { 2 } = 0 \implies \forall z \in \mathcal { B } ( Z ) , e _ { I } ^ { * } \circ g ( z ) = z _ { I } . } \end{array}
|
| 623 |
+
$$
|
| 624 |
+
|
| 625 |
+
Therefore
|
| 626 |
+
|
| 627 |
+
$$
|
| 628 |
+
\begin{array} { r } { \mathbb { E } _ { z _ { I } } \mathbb { E } _ { z _ { \searrow I } , z _ { \searrow I } ^ { \prime } } \Vert e _ { I } ^ { * } \circ g ( z _ { I } , z _ { \searrow I } ) - e _ { I } ^ { * } \circ g ( z _ { I } , z _ { \searrow I } ^ { \prime } ) \Vert ^ { 2 } = 0 . } \end{array}
|
| 629 |
+
$$
|
| 630 |
+
|
| 631 |
+
i.e., $g$ satisfies $C ( I ; p , g , e ^ { * } )$ . By symmetry, $e$ satisfies $C ( I ; p ^ { * } , g ^ { * } , e )$ .
|
| 632 |
+
|
| 633 |
+
2.
|
| 634 |
+
|
| 635 |
+
$$
|
| 636 |
+
\begin{array} { r l r } & { } & { \left( g ^ { * } ( S _ { I } , S _ { \setminus I } ) , g ^ { * } ( S _ { I } , S _ { \setminus I } ^ { \prime } ) \right) \stackrel { d } { = } \left( g ( Z _ { I } , Z _ { \setminus I } ) , g ( Z _ { I } , Z _ { \setminus I } ^ { \prime } ) \right) \ ( 5 1 ) \qquad } \\ & { \implies \lVert e _ { I } ^ { * } \circ g ^ { * } ( S _ { I } , S _ { \setminus I } ) - e _ { I } ^ { * } \circ g ^ { * } ( S _ { I } , S _ { \setminus I } ^ { \prime } ) \rVert ^ { 2 } \stackrel { d } { = } \lVert e _ { I } ^ { * } \circ g ( Z _ { I } , Z _ { \setminus I } ) - e _ { I } ^ { * } \circ g ( Z _ { I } , Z _ { \setminus I } ^ { \prime } ) \rVert ^ { 2 } } \end{array}
|
| 637 |
+
$$
|
| 638 |
+
|
| 639 |
+
$$
|
| 640 |
+
\begin{array} { r l r } & { } & { \implies \mathbb { E } _ { z _ { I } } \mathbb { E } _ { z _ { \setminus I } , z _ { \setminus I } ^ { \prime } } \lVert e _ { I } ^ { * } \circ g ( z _ { I } , z _ { \setminus I } ) - e _ { I } ^ { * } \circ g ( z _ { I } , z _ { \setminus I } ^ { \prime } ) \rVert ^ { 2 } = 0 . } \end{array}
|
| 641 |
+
$$
|
| 642 |
+
|
| 643 |
+
So $g$ satisfies $C ( I ; p , g , e ^ { * } )$ . By symmetry, $e$ satisfies $C ( I ; p ^ { * } , g ^ { * } , e )$ .
|
| 644 |
+
|
| 645 |
+
3. Let $I = \{ i \}$ , $f = e _ { I } ^ { * } { \circ } g$ . Distribution matching implies that, with probability 1 over random draws of $Z , Z ^ { \prime }$ , the following event $P$ happens:
|
| 646 |
+
|
| 647 |
+
$$
|
| 648 |
+
Z _ { I } < = Z _ { I } ^ { \prime } \Longrightarrow f ( Z ) < = f ( Z ^ { \prime } ) .
|
| 649 |
+
$$
|
| 650 |
+
|
| 651 |
+
$$
|
| 652 |
+
\mathbb { E } _ { z , z ^ { \prime } } \mathbf { 1 } [ \lnot P ] = 0 .
|
| 653 |
+
$$
|
| 654 |
+
|
| 655 |
+
Let $W = \backslash I \cap D , Q = \backslash I \cap \backslash D$ . We showed in the proof of Proposition 3 that
|
| 656 |
+
|
| 657 |
+
$$
|
| 658 |
+
C ( I ) \Longleftrightarrow \forall ( z _ { I } , z _ { W } , z _ { Q } ) , ( z _ { I } , z _ { W } ^ { \prime } , z _ { Q } ^ { \prime } ) \in \mathcal { B } ( Z ) , f ( z _ { I } , z _ { W } , z _ { Q } ) = f ( z _ { I } , z _ { W } ^ { \prime } , z _ { Q } ^ { \prime } ) .
|
| 659 |
+
$$
|
| 660 |
+
|
| 661 |
+
We prove by contradiction. Suppose $\exists ( z _ { I } , z _ { W } , z _ { Q } ) , ( z _ { I } , z _ { W } ^ { \prime } , z _ { Q } ^ { \prime } ) \ \in \ B ( Z )$ such that $f ( z _ { I } , z _ { W } , z _ { Q } ) < f ( z _ { I } , z _ { W } ^ { \prime } , z _ { Q } ^ { \prime } )$ .
|
| 662 |
+
|
| 663 |
+
(a) Case $1 \colon Z _ { I }$ is discrete.
|
| 664 |
+
|
| 665 |
+
Since $f$ is constant both at $( z _ { I } , z _ { W } , z _ { Q } )$ in the interior of $B ( \left[ z _ { I } , z _ { W } \right] )$ , and at $( z _ { I } , z _ { W } ^ { \prime } , z _ { Q } ^ { \prime } )$ in the interior of $B ( [ z _ { I } , z _ { W } ^ { \prime } ] )$ , we can draw open balls of radius $r > 0$ around each point, i.e., $B _ { r } ( z _ { Q } ) \subset B ( [ z _ { I } , z _ { W } ] )$ and $B _ { r } ( z _ { Q } ^ { \prime } ) \subset B ( [ z _ { I } , z _ { W } ^ { \prime } ] )$ , where
|
| 666 |
+
|
| 667 |
+
$$
|
| 668 |
+
\forall z _ { Q } ^ { * } \in B _ { r } ( z _ { Q } ) , \forall z _ { Q } ^ { \Delta } \in B _ { r } ( z _ { Q } ^ { \prime } ) , f ( z _ { I } , z _ { W } , z _ { Q } ^ { * } ) < f ( z _ { I } , z _ { W } ^ { \prime } , z _ { Q } ^ { \Delta } ) .
|
| 669 |
+
$$
|
| 670 |
+
|
| 671 |
+
When we draw $z , z ^ { \prime } \sim p ( z )$ , let $C$ denote the event that this specific value of $z _ { I }$ is picked for both $z , z ^ { \prime }$ , and we picked $z _ { \backslash I } \in B _ { r } ( z _ { Q } ^ { \prime } )$ , $z _ { \backslash I } ^ { \prime } \in B _ { r } ( \bar { z } _ { Q } )$ . Since both balls have positive volume, $\mathrm { P r } [ C ] > 0$ . However, $P$ does not happen whenever event $C$ happens, since $z _ { I } = z _ { I } ^ { \prime }$ but ${ \bar { f } } ( z ) > f ( z ^ { \prime } )$ , which contradicts $\mathrm { P r } [ P ] = 1$ .
|
| 672 |
+
|
| 673 |
+
(b) Case 2: $z _ { I }$ is continuous. Similar to case 1, we can draw open balls of radius $r > 0$ around each point, i.e., $B _ { r } ( z _ { I } , z _ { Q } ) \subset B ( z _ { W } )$ and $B _ { r } ( z _ { I } , \bar { z } _ { Q } ^ { \prime } ) \subset B ( z _ { W } ^ { \prime } )$ , where
|
| 674 |
+
|
| 675 |
+
$$
|
| 676 |
+
\forall ( z _ { I } ^ { \star } , z _ { Q } ^ { \star } ) \in B _ { r } ( z _ { I } , z _ { Q } ) , \forall ( z _ { I } ^ { \Delta } , z _ { Q } ^ { \Delta } ) \in B _ { r } ( z _ { I } , z _ { Q } ^ { \prime } ) , f ( z _ { I } ^ { \star } , z _ { W } , z _ { Q } ^ { \star } ) < f ( z _ { I } ^ { \Delta } , z _ { W } ^ { \prime } , z _ { Q } ^ { \Delta } ) .
|
| 677 |
+
$$
|
| 678 |
+
|
| 679 |
+
Let $H ^ { 1 } = \{ ( z _ { I } ^ { * } , z _ { Q } ^ { * } ) \in B _ { r } ( z _ { I } , z _ { Q } ) : z _ { I } ^ { * } > = z _ { I } \}$ , $H ^ { 2 } = \{ ( z _ { I } ^ { \Delta } , z _ { Q } ^ { \Delta } ) \in B _ { r } ( z _ { I } , z _ { Q } ^ { \prime } ) :$ $z _ { I } ^ { \Delta } ~ < = ~ z _ { I } \}$ . When we draw $z , z ^ { \prime } \sim p ( z )$ , let $C$ denote the event that we picked $z ^ { \bar { \prime } } \in H ^ { 1 } \times \{ z _ { W } \}$ , $z \in H ^ { 2 } \times \{ z _ { W } ^ { \prime } \}$ . Since $\dot { H } ^ { 1 } , H ^ { 2 }$ have positive volume, $\mathrm { P r } [ C ] > 0$ However, $P$ does not happen whenever event $C$ happens, since $z _ { I } < = z _ { I } ^ { \prime }$ but $f ( z ) >$ $f ( z ^ { \prime } )$ , which contradicts $\mathrm { P r } [ P ] = 1$ .
|
| 680 |
+
|
| 681 |
+
Therefore we showed
|
| 682 |
+
|
| 683 |
+
$$
|
| 684 |
+
\forall ( z _ { I } , z _ { W } , z _ { Q } ) , ( z _ { I } , z _ { W } ^ { \prime } , z _ { Q } ^ { \prime } ) \in \mathcal { B } ( Z ) , f ( z _ { I } , z _ { W } , z _ { Q } ) = f ( z _ { I } , z _ { W } ^ { \prime } , z _ { Q } ^ { \prime } ) ,
|
| 685 |
+
$$
|
| 686 |
+
|
| 687 |
+
i.e., $g$ satisfies $C ( I ; p , g , e ^ { * } )$ . By symmetry, $e$ satisfies $C ( I ; p ^ { * } , g ^ { * } , e )$ .
|
| 688 |
+
|
| 689 |
+
# I.6 WEAK SUPERVISION IMPOSSIBILITY RESULT
|
| 690 |
+
|
| 691 |
+
Theorem 2. Weak supervision via restricted labeling, match pairing, or ranking on $s _ { I }$ is not sufficient for learning a generative model whose latent code $Z _ { I }$ is restricted to $S _ { I }$ .
|
| 692 |
+
|
| 693 |
+
Proof. We construct the following counterexample. Let $n = m = 3$ and $I = \{ 1 \}$ . The data generation process is $s _ { 1 } \sim \mathrm { u n i f } ( [ 0 , 2 \pi ) )$ , $( s _ { 2 } , s _ { 3 } ) \sim \operatorname { \bar { u n i f } } ( \{ ( x , y ) : x ^ { 2 } + y ^ { 2 } \leq 1 \} )$ ), $\bar { g ^ { * } } ( s ) = [ s _ { 1 } , s _ { 2 } , s _ { 3 } ]$ . Consider a generator $z _ { 1 } \sim \mathrm { u n i f } ( [ 0 , 2 \pi ) )$ , $( s _ { 2 } , s _ { 3 } ) \ \sim \ \mathrm { u n i f } ( \{ ( x , y ) \ : \ x ^ { 2 } + y ^ { 2 } \ \leq \ 1 \} )$ , $g ( z ) =$ $[ z _ { 1 } , \cos { ( z _ { 1 } ) } z _ { 2 } - \sin { ( z _ { 1 } ) } z _ { 3 } , \sin { ( z _ { 1 } ) } z _ { 2 } + \cos { ( z _ { 1 } ) } z _ { 3 } ]$ . Then $\left( x _ { d } , s _ { I } \right) \overset { d } { = } \left( x _ { g } , z _ { I } \right)$ but $R ( I ; p , g , e ^ { * } )$ and $R ( I ; p ^ { * } , g ^ { * } , e )$ does not hold. The same counterexample is applicable for match pairing and rank pairing. □
|
md/train/HklRKpEKDr/HklRKpEKDr.md
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP COORDINATION GRAPHS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
This paper introduces the deep coordination graph (DCG) for collaborative multiagent reinforcement learning. DCG strikes a flexible trade-off between representational capacity and generalization by factorizing the joint value function of all agents according to a coordination graph into payoffs between pairs of agents. The value can be maximized by local message passing along the graph, which allows training of the value function end-to-end with $Q$ -learning. Payoff functions are approximated with deep neural networks and parameter sharing improves generalization over the state-action space. We show that DCG can solve challenging predator-prey tasks that are vulnerable to the relative overgeneralization pathology and in which all other known value factorization approaches fail.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
One of the central challenges in cooperative multi-agent reinforcement learning (MARL, Oliehoek & Amato, 2016) is coping with the size of the joint action space, which grows exponentially in the number of agents. For example, this paper evaluates tasks where eight agents each have six actions to choose from, yielding a joint action space with more than a million actions. Efficient MARL methods must thus be able to generalize over large joint action spaces, in the same way that convolutional neural networks allow deep RL to generalize over large visual state spaces.
|
| 12 |
+
|
| 13 |
+
Even though few benchmark tasks actually require agent policies to be independently executable, one common approach to coping with large action spaces is to decentralize the decision policy and/or value function. For example, Figure 1a shows how the joint value function can be factorized into utility functions that each depend only on the actions of one agent (Sunehag et al., 2018; Rashid et al., 2018). Consequently, the joint value function can be efficiently maximized if each agent simply selects the action that maximizes its corresponding utility function. This factorization can represent any deterministic policy and thus can represent at least one optimal policy. However, that policy may not be learnable due to a game-theoretic pathology called relative overgeneralization1 (Panait et al., 2006): during exploration other agents act randomly and punishment caused by uncooperative agents may outweigh rewards that would be achievable with coordinated actions. If the employed value function does not have the representational capacity to distinguish the values of coordinated and uncoordinated actions, an optimal policy cannot be learned.
|
| 14 |
+
|
| 15 |
+
However, Castellini et al. (2019) show that higher-order factorization of the value function works surprisingly well in one-shot games that are vulnerable to relative overgeneralization, even if each factor depends on the actions of only a small subset of agents. Such a higher-order factorization can be expressed as an undirected coordination graph (CG, Guestrin et al., 2002a), where each vertex represents one agent and each (hyper-)edge one payoff function over the joint action space of the connected agents. Figure 1b shows a CG with pairwise edges and the corresponding value factorization. Depending on the CG topology, the value can thus depend nontrivially on the actions of all agents, yielding a richer representation. Although the value can no longer be maximized by each agent individually, the greedy action can be found using message passing along the edges (also known as belief propagation, Pearl, 1988). Sparse cooperative $Q$ -learning (Kok & Vlassis, 2006) applies CGs to MARL but does not scale to modern benchmarks, as each payoff function ( $f ^ { 1 2 }$ and $f ^ { 2 3 }$ in Figure 1b) is represented as a table over the state and joint action space of the connected agents. Castellini et al. (2019) use neural networks to approximate payoff functions, but only in one-shot games, and still require a unique function for each edge in the CG. Consequently, each agent group, represented by an edge, must still experience all corresponding action combinations, which can require executing a significant subset of the joint action space.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Examples of value factorization for 3 agents: (a) sum of independent utilities (as in VDN, Sunehag et al., 2018) corresponds to an unconnected CG. QMIX uses a monotonic mixture of utilities instead of a sum (Rashid et al., 2018); (b) sum of pairwise payoffs (Castellini et al., 2019), which correspond to pairwise edges; (c) no factorization (as in QTRAN, Son et al., 2019) corresponds to one hyper-edge connecting all agents. Factorization allows parameter sharing between factors, shown next to the CG, which can dramatically improve the algorithm’s sample complexity.
|
| 19 |
+
|
| 20 |
+
To address these issues, this paper proposes the deep coordination graph (DCG), a deep RL algorithm that scales to modern benchmark tasks. DCG represents the value function as a CG with pairwise payoffs2 (Figure 1b) and individual utilities (Figure 1a). This improves the representational capacity beyond state-of-the-art value factorization approaches like VDN (Sunehag et al., 2018) and QMIX (Rashid et al., 2018). To achieve scalability, DCG employs parameter sharing between payoffs and utilities. Parameter sharing has long been a staple of factorized MARL. Methods like VDN and QMIX condition an agent’s utility on its history, that is, its past observations and actions, and share the parameters of all utility functions. Experiences of one agent are thus used to train all. This can dramatically improve the sample efficiency compared to unfactored methods (Foerster et al., 2016; 2018; Lowe et al., 2017; Schroder de Witt et al., 2019; Son et al., 2019), which correspond to ¨ a CG with one hyper-edge connecting all agents (Figure 1c). DCG takes parameter sharing one step further by approximating all payoff functions with the same neural network. To allow unique outputs for each payoff, the network is conditioned on a learned embedding of the participating agents’ histories. This requires only one linear layer more than VDN and has thus less parameters as QMIX.
|
| 21 |
+
|
| 22 |
+
DCG is trained end-to-end with deep $Q$ -learning (DQN, Mnih et al., 2015), but uses message passing to coordinate greedy action selection between all agents in the graph. For $k$ message passes over $n$ agents with $m$ actions each, the time complexity of maximization is only $\mathcal { O } ( k m ( n + \bar { m } ) | \mathcal { E } | )$ , where $\begin{array} { r } { | \mathcal { E } | \leq \frac { n ^ { 2 } - n } { 2 } } \end{array}$ is the number of (pairwise) edges, compared to $\mathcal { O } ( m ^ { n } )$ for DQN without factorization.
|
| 23 |
+
|
| 24 |
+
We compare DCG’s performance with that of other MARL $Q$ -learning algorithms in a challenging family of predator-prey tasks that require coordinated actions. Here DCG is the only algorithm that solves the harder tasks. We also investigate the influence of graph topologies on the performance.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
A general overview over cooperative deep MARL can be found in OroojlooyJadid & Hajinezhad (2019). Independent $Q$ -learning (IQL Tan, 1993) decentralizes the agents’ policy by modeling each agent as an independent $Q$ -learner. However, the task from the perspective of a single agent becomes nonstationary as other agents change their policies. To address this, Foerster et al. (2017) show how to stabilize IQL when using experience replay buffers. Another approach to decentralized agents is centralized training and decentralized execution (Foerster et al., 2016) with a factorized value function. Value decomposition networks (VDN, Sunehag et al., 2018) performs central $Q$ -learning with a value function that is the sum of independent utility functions for each agent (Figure 1a). The greedy policy can be executed by maximizing each utility independently. QMIX (Rashid et al., 2018) improves upon this approach by combining the agents’ utilities with a mixing network, which is monotonic in the utilities and depends on the global state. This allows different mixtures in different states and the central value can be maximized independently due to monotonicity. All of these approaches are derived in Appendix A.1 and can use parameter sharing between the value/utility functions. However, they represent the joint value with independent values/utilities and are therefore susceptible to the relative overgeneralization pathology. We demonstrate this by comparing DCG with all the above algorithms.
|
| 29 |
+
|
| 30 |
+
Another straightforward way to decentralize in MARL is to define the joint policy as a product of independent agent policies. This lends itself to the actor-critic framework, where the critic is discarded during execution and can therefore condition on the global state and all agents’ actions during training. Examples are MADDPG (Lowe et al., 2017) for continuous actions and COMA (Foerster et al., 2018) for discrete actions. Wei et al. (2018) specifically investigate the relative overgeneralization pathology in continuous multi-agent tasks and show improvement over MADDPG by introducing policy entropy regularization. MACKRL (Schroder de Witt et al., 2019) follows the approach in ¨ Foerster et al. (2018), but uses common knowledge to coordinate agents during centralized training. Son et al. (2019) define QTRAN, which also has a centralized critic but uses a greedy actor w.r.t. a VDN factorized function. The corresponding utility functions are distilled from the critic under constraints that ensure proper decentralization. Bohmer et al. (2019) present another approach to ¨ decentralize a centralized value function, which is locally maximized by coordinate ascent and decentralized by training IQL agents from the same replay buffer. Centralized joint $Q$ -value functions do not allow to share parameters to the same extent as value factorization, and we compare DCG to QTRAN to demonstrate the advantage in sample efficiency. That being said, DCG value factorization can in principle be applied to any of the above centralized critics to equally improve sample efficiency at the same cost of representational capacity. We leave this to future work.
|
| 31 |
+
|
| 32 |
+
Other work deals with gigantic numbers of agents, which requires additional assumptions to reduce the sample complexity. For example, Yang et al. (2018) introduce mean-field multi-agent learning (MF-MARL), which factorizes a tabular value function for hundreds of agents into pairwise payoff functions between neighbors in a uniform grid of agents. These payoffs share parameters similar to DCG. Chen et al. (2018) introduce a value factorization for a similar setup based on a low-rank approximation of the joint value. This approach is restricted by uniformity assumptions between agents, but uses otherwise parameter sharing similar to DCG. The value function cannot be maximized globally and must be locally maximized with coordinate ascent. These techniques are designed for much larger sets of agents and do not perform well in the usual MARL settings considered in this paper. While they use similar parameter sharing techniques as DCG, we do therefore not compare against them.
|
| 33 |
+
|
| 34 |
+
Coordination graphs (CG) have been extensively studied in multi-agent robotics with given payoffs (e.g. Rogers et al., 2011; Yedidsion et al., 2018). Sparse cooperative $Q$ -learning (SCQL, Kok & Vlassis, 2006) uses CG in discrete state and action spaces by representing all utility and payoff functions as tables. However, the tabular approach restricts practical application of SCQL to tasks with few agents and small state and action spaces. Castellini et al. (2019) use neural networks to approximate payoff functions, but only in one-shot games, and still require a unique function for each edge in the CG. DCG expands greatly upon these works by introducing parameter sharing between all payoffs (as in VDN/QMIX), conditioning on local information (as in MF-MARL) and evaluating in more complex tasks that are vulnerable to relative overgeneralization.
|
| 35 |
+
|
| 36 |
+
# 3 BACKGROUND
|
| 37 |
+
|
| 38 |
+
In this pa(Oliehoek we assume a Amato, 2016). c-POMDP for denotes a fini $n$ agents or cont $\langle \mathcal { S } , \{ \mathcal { A } ^ { i } \} _ { i = 1 } ^ { n } , P , r , \{ \mathcal { O } ^ { i } \} _ { i = 1 } ^ { n } , \{ \sigma ^ { i } \} _ { i = 1 } ^ { n } , n , \gamma \rangle$ $\&$ $s$ $\mathcal { A } ^ { i }$ the discrete set of actions available to agent $i$ . At discrete time $t$ , the next state $s _ { t + 1 } \in S$ is drawn from transition kernel $s _ { t + 1 } \sim P ( \cdot | s _ { t } , \mathbf { a } _ { t } )$ , conditioned on the current state $s _ { t } \in S$ and joint action $\pmb { a } _ { t } \in \mathcal { A } : = \mathcal { A } ^ { 1 } \times . . . \times \dot { \mathcal { A } } ^ { n }$ of all agents. A transition yields collaborative reward $r _ { t } : = r ( s _ { t } , { \bf a } _ { t } )$ , and $\gamma \in [ 0 , 1 )$ denotes the discount factor. Each agent $i$ observes the state only partially by drawing observations $o _ { t } ^ { i } \in \mathcal { O } ^ { i }$ from its observation kernel $\quad \overline { { o _ { t } ^ { i } } } \sim \sigma ^ { i } ( \cdot | s _ { t } ) .$ . The history of agent $i$ ’s observations $o _ { t } ^ { i } \in \mathcal { O } ^ { i }$ and actions $a _ { t } ^ { i } \in \mathcal { A } ^ { i }$ is in the following denoted as $\tau _ { t } ^ { i } : = ( o _ { 0 } ^ { i } , a _ { 0 } ^ { i } , o _ { 1 } ^ { i } , \ldots , o _ { t - 1 } ^ { i } , a _ { t - 1 } ^ { i } , o _ { t } ^ { i } ) \in$ $( \mathcal { O } ^ { i } \times \mathcal { A } ^ { i } ) ^ { t } \times \mathcal { O } ^ { i }$ . Without loss of generality, this paper restricts itself to episodic tasks, which yield episodes $( s _ { 0 } , \{ o _ { 0 } ^ { i } \} _ { i = 1 } ^ { n } , { \pmb a } _ { 0 } , r _ { 0 } , . . . , \bar { s } _ { T } , \{ o _ { T } ^ { i } \} _ { i = 1 } ^ { n } )$ of varying (but finite) length $T$ .
|
| 39 |
+
|
| 40 |
+
# 3.1 DEEP $Q$ -LEARNING
|
| 41 |
+
|
| 42 |
+
The goal of collaborative multi-agent reinforcement learning (MARL) is to find an optimal policy $\pi ^ { * } : \mathbf { \bar { \mathcal { S } } } \times \mathcal { A } [ 0 , 1 ]$ , that chooses joint actions $\mathbf { \boldsymbol { a } } _ { t } \in \mathcal { A }$ such that the expected discounted sum of future reward is maximized. This can be achieved by estimating the optimal $Q$ -value function3:
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\begin{array} { r l r } { q ^ { * } ( a | s ) } & { { } : = } & { \mathbb { E } _ { \pi ^ { * } } \Big [ \displaystyle \sum _ { t = 0 } ^ { T - 1 } \gamma ^ { t } r _ { t } \big | \operatorname* { \Pi } _ { a _ { 0 } = a } ^ { s _ { 0 } = s } \Big ] \quad = \quad r ( s , a ) + \gamma \int P ( s ^ { \prime } | s , a ) \operatorname* { m a x } q ^ { * } ( \cdot | s ^ { \prime } ) d s ^ { \prime } . } \end{array}
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
The optimal policy $\pi ^ { * } ( \cdot | s _ { t } )$ chooses greedily the action $a \in { \mathcal { A } }$ that maximizes the corresponding optimal $Q$ -value ${ \boldsymbol { q } } ^ { * } ( { \boldsymbol { \mathbf { \mathit { a } } } } | s _ { t } )$ . In fully observable discrete state and action spaces, $q ^ { * }$ can be learned in the limit from interactions with the environment (Watkins & Dayan, 1992). For large or continuous state spaces, $q ^ { * }$ can only be approximated, e.g., with a deep neural network $q _ { \theta }$ (DQN, Mnih et al., 2015), parameterized by $\theta$ , by minimizing the mean-squared Bellman loss with gradient descent:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\begin{array} { r l r } { \mathcal { L } _ { \mathrm { { p q N } } } } & { : = } & { \mathbb { E } \Big [ \frac { 1 } { T } \sum _ { t = 0 } ^ { T - 1 } \Big ( r _ { t } + \gamma \operatorname* { m a x } q _ { \bar { \theta } } ( \cdot | s _ { t + 1 } ) - q _ { \theta } ( a _ { t } | s _ { t } ) \Big ) ^ { 2 } \Big | \left\{ s _ { t } , a _ { t } , r _ { t } , s _ { t + 1 } \right\} _ { t = 0 } ^ { T } \sim D \Big ] . } \end{array}
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
The expectation is estimated with samples from an experience replay buffer $D$ holding previously observed episodes (Lin, 1992), and $\bar { \theta }$ denotes the parameter of a separate target network, which is periodically replaced with a copy of $\theta$ to improve stability. Double $Q$ -learning further stabilizes training by choosing the next action greedily w.r.t. the current network $q _ { \theta }$ , i.e., $q _ { \bar { \theta } } \big ( \arg \operatorname* { m a x } q _ { \theta } \big ( \cdot | s _ { t + 1 } \big ) \big | s _ { t + 1 } \big )$ instead of the target network max $q _ { \bar { \theta } } ( \cdot | s _ { t + 1 } )$ (van Hasselt et al., 2016).
|
| 55 |
+
|
| 56 |
+
In partially observable environments, the learned policy cannot condition on the state $s _ { t }$ . Instead, Hausknecht & Stone (2015) approximate a $Q$ -function that conditions on the agent’s history $\tau _ { t } : =$ $\{ \tau _ { t } ^ { i } \} _ { i = 1 } ^ { n }$ , i.e., $q _ { \theta } ( \mathbf { a } | \tau _ { t } )$ , by conditioning a recurrent neural network (e.g., a GRU, Chung et al., 2014) on the agents’ observations $\pmb { o } _ { t } : = ( o _ { t } ^ { 1 } , \overline { { \cdot \cdot \cdot , o _ { t } ^ { n } } } )$ and last actions $\mathbf { \delta } _ { a _ { t - 1 } }$ , that is, $q _ { \theta } ( { \pmb a } | h _ { t } )$ conditions on the recurrent network’s hidden state $\begin{array} { r } { h _ { \psi } \big ( \pmb { h } _ { t } \big | \pmb { h } _ { t - 1 } , \pmb { o } _ { t } , \pmb { a } _ { t - 1 } \big ) } \end{array}$ , where $h _ { 0 }$ is initialized with zeros.
|
| 57 |
+
|
| 58 |
+
Applying DQN to multi-agent tasks quickly becomes infeasible, due to the combinatorial explosion of state and action spaces. Moreover, DQN value functions cannot be maximized without evaluating all possible actions. To allow MARL $Q$ -learning with efficient maximization, various algorithms based on value factorization have been developed. We derive IQL (Tan, 1993), VDN (Sunehag et al., 2018), QMIX (Rashid et al., 2018) and QTRAN (Son et al., 2019) in Appendix A.1.
|
| 59 |
+
|
| 60 |
+
# 3.2 COORDINATION GRAPHS
|
| 61 |
+
|
| 62 |
+
An undirected coordination graph (CG, Guestrin et al., 2002a) $\mathcal { G } = \langle \nu , \mathcal { E } \rangle$ contains a vertex $v _ { i } \in \mathcal V$ for each agent $1 \leq i \leq n$ and a set of undirected edges $\{ i , j \} \in { \mathcal { E } }$ between vertices $v _ { i }$ and $v _ { j }$ . The graph is usually specified before training, but Guestrin et al. (2002b) suggest that the graph could also depend on the state, that is, each state can have its own unique CG. A CG induces a factorization4 of the $Q$ -function into utility functions $f ^ { i }$ and payoff functions $f ^ { i j }$ (Fig. 1a and 1b):
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { r l r } { q ^ { \mathrm { c G } } ( s _ { t } , { \pmb a } ) } & { { } : = } & { \frac { 1 } { | \mathcal { V } | } \displaystyle \sum _ { v ^ { i } \in \mathcal { V } } f ^ { i } ( { \ b a } ^ { i } | s _ { t } ) + \frac { 1 } { | \mathcal { E } | } \displaystyle \sum _ { \{ i , j \} \in \mathcal { E } } f ^ { i j } ( { \ b a } ^ { i } , { \ b a } ^ { j } | s _ { t } ) . } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
The special case $\varepsilon = \varnothing$ yields VDN, but each additional edge enables the representation of the value of the actions of a pair of agents and can thus help to avoid relative overgeneralization. Prior work also considered higher order coordination where the payoff functions depend on arbitrary sets of actions (Guestrin et al., 2002a; Kok & Vlassis, 2006; Castellini et al., 2019), corresponding to graphs with hyper-edges (Figure 1c). For the sake of simplicity we restrict ourselves here to pairwise edges, which yield at most $\begin{array} { r } { | \mathcal { E } | \le \frac { 1 } { 2 } ( n ^ { 2 } - n ) } \end{array}$ edges, in comparison to up to $\frac { n ! } { d ! \ : ( n - d ) ! }$ hyper-edges of degree $d$ . The induced $Q$ -function $q ^ { \mathrm { c G } }$ can be maximized locally using max-plus, also known as belief propagation (Pearl, 1988). At time $t$ each node sends messages $\mu _ { t } ^ { i j } ( a ^ { j } ) \in \mathbb { R }$ over all adjacent edges $\{ i , j \} \in { \mathcal { E } }$ , which can be computed locally:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\begin{array} { r l r } { \mu _ { t } ^ { i j } ( a ^ { j } ) } & { } & { \displaystyle \operatorname* { m a x } _ { a ^ { i } } \{ \frac { 1 } { | \mathcal { V } | } f ^ { i } ( a ^ { i } | s _ { t } ) + \frac { 1 } { | \mathcal { E } | } f ^ { i j } ( a ^ { i } , a ^ { j } | s _ { t } ) + \sum _ { \{ k , i \} \in \mathcal { E } } \mu _ { t } ^ { k i } ( a ^ { i } ) - \mu _ { t } ^ { j i } ( a ^ { i } ) \} . } \end{array}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
This process repeats for a number of iterations, after which each agent $i$ can locally find the action $a _ { * } ^ { i }$ that maximizes the estimated $Q$ -value:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\begin{array} { r l r } { a _ { * } ^ { i } } & { { } : = } & { \underset { a ^ { i } } { \arg \operatorname* { m a x } } \left\{ \frac { 1 } { | \mathcal { V } | } f ^ { i } ( a ^ { i } | s _ { t } ) + \sum _ { \left\{ k , i \right\} \in \mathcal { E } } \mu _ { t } ^ { k i } ( a ^ { i } ) \right\} . } \end{array}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Convergence of messages is guaranteed for acyclic CGs (Pearl, 1988; Wainwright et al., 2004), but messages can diverge in cyclic graphs, for example fully connected CGs. Subtracting a normalization constant $\begin{array} { r } { c _ { i j } : = \dot { \sum _ { a } } \mu _ { t } ^ { i j } \bar { ( a ) ^ { } } / \left| \mathcal { A } ^ { i } \right| } \end{array}$ from each message $\mu ^ { i j }$ before it is sent often leads to convergence in practice (Murphy et al., 1999; Crick & Pfeffer, 2002; Yedidia et al., 2003). See Algorithm 3 in the appendix for details.
|
| 81 |
+
|
| 82 |
+
# 4 METHOD
|
| 83 |
+
|
| 84 |
+
We now introduce the deep coordination graph (DCG), which learns the utility and payoff functions of a coordination graph $\langle \mathcal { V } , \mathcal { E } \rangle$ with deep neural networks. A direct implementation as in Castellini et al. (2019) would learn a separate network for each function $f ^ { i }$ and $f ^ { i j }$ . However, properly approximating these $Q$ -values requires observing the joint actions of each agent pair in the edge set $\mathcal { E }$ , which for dense graphs can be a significant subset of the joint action space of all agents $\mathcal { A }$ . We address this issue by focusing on an architecture that shares parameters across functions and restricts them to locally available information, i.e., to the histories of the participating agents.
|
| 85 |
+
|
| 86 |
+
Sunehag et al. (2018) introduces parameter sharing between the agents’ utility functions $f ^ { i } ( u ^ { i } | s _ { t } ) \approx$ $f _ { \theta } ^ { v } ( u ^ { i } | \bar { \tau _ { t } ^ { i } } )$ to dramatically improve the sample efficiency of VDN. Agents can have different action spaces $\mathcal { A } ^ { i }$ but the choice of unavailable actions during maximization can be prevented by setting the utilities of unavailable actions to $- \infty$ . Specialized roles for individual agents can be achieved by conditioning $f _ { \theta } ^ { v }$ on the agent’s role, or more generally on the agent’s ID (Foerster et al., 2018; Rashid et al., 2018). The DCG uses the same utility functions and adds payoff functions specified by pairwise edges in a given CG (Guestrin et al., 2002a). We take inspiration from highly scalable methods (Yang et al., 2018; Chen et al., 2018) and improve over SCQL (Kok & Vlassis, 2006) and the approach of Castellini et al. (2019) by incorporating the following design principles:
|
| 87 |
+
|
| 88 |
+
i. restricting the payoffs $f ^ { i j } ( a ^ { i } , a ^ { j } | \tau _ { t } ^ { i } , \tau _ { t } ^ { j } )$ to local information of agents $i$ and $j$ only;
|
| 89 |
+
ii. sharing parameters between all payoff and utility functions through a common RNN;
|
| 90 |
+
iii. low-rank approximation of payoff matrices $f ^ { i j } ( \cdot , \cdot | \tau _ { t } ^ { i } , \tau _ { t } ^ { j } )$ for large action spaces;
|
| 91 |
+
iv. allowing transfer/generalization to different CG (as suggested in Guestrin et al., 2002b);
|
| 92 |
+
v. allowing the use of privileged information like the global state during training.
|
| 93 |
+
|
| 94 |
+
Restricting the payoff’s input (i) and sharing parameters (ii) improves sample efficiency significantly. As in Sunehag et al. (2018), all utilities are computed with the same neural network $f _ { \theta } ^ { i } ( u ^ { i } \overline { { | } } \tau _ { t } ^ { i } ) \approx f _ { \theta } ^ { v } ( u ^ { i } | \mathbf { \boldsymbol { h } } _ { t } ^ { i } )$ , but unlike Castellini et al. (2019), all payoffs are computed with the same neural network $f ^ { i j } ( a ^ { i } , a ^ { j } | \tau _ { t } ^ { i } , \tau _ { t } ^ { j } ) \approx f _ { \phi } ^ { e } ( a ^ { i } , a ^ { j } | { \pmb h } _ { t } ^ { i } , { \pmb h } _ { t } ^ { j } )$ , too. Both share parameters though a common RNN $\pmb { h } _ { t } ^ { i } : = h _ { \psi } ( \cdot | \pmb { h } _ { t - 1 } ^ { i } , o _ { t } ^ { i } , a _ { t - 1 } ^ { i } )$ , which is initialized with $h _ { 0 } ^ { i } : = h _ { \psi } ( \cdot | \mathbf { 0 } , o _ { 0 } ^ { i } , \mathbf { 0 } )$ .
|
| 95 |
+
|
| 96 |
+
Modeling the payoff function $f _ { \phi } ^ { e }$ similar to DQN (Mnih et al., 2015) yields $| { \mathcal { A } } ^ { i } \times { \mathcal { A } } ^ { j } |$ separate outputs for edge $\{ i , j \}$ . For example, each agent in a StarCraft 2 map with 8 enemies has 13 actions (SMAC, Samvelyan et al., 2019), which yields 169 outputs of $f _ { \phi } ^ { e }$ . As only executed actions-pairs are updated during Q-learning, the parameters of many outputs remain unchanged for long stretches of time, while the underlying $\mathsf { R N N } h _ { \psi }$ keeps evolving. This can slow down training and affect message passing. To reduce the number of parameters and improve the frequency in which they are updated, we propose a low-rank approximation of the payoff (iv) with rank $K$ , similar to Chen et al. (2018):
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
f _ { \phi } ^ { e } ( a ^ { i } , a ^ { j } | h _ { t } ^ { i } , h _ { t } ^ { j } ) \quad : = \quad \sum _ { k = 1 } ^ { K } \hat { f } _ { \hat { \phi } } ^ { e } ( a ^ { i } , k | h _ { t } ^ { i } , h _ { t } ^ { j } ) \bar { f } _ { \hat { \phi } } ^ { e } ( a ^ { j } , k | h _ { t } ^ { i } , h _ { t } ^ { j } ) .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
The approximation can be computed in one forward-pass with $K ( | \mathcal { A } ^ { i } | + | \mathcal { A } ^ { j } | )$ outputs and parameters $\phi : = \{ \hat { \phi } , \bar { \phi } \}$ . Note that a rank $K = \operatorname* { m i n } \{ | \mathcal { A } ^ { i } | , | \mathcal { A } ^ { j } | \}$ approximation does not restrict the output’s expressiveness, while lower ranks share parameters and updates to speed up learning.
|
| 103 |
+
|
| 104 |
+
Generalization (or zero-shot transfer) of the learned functions onto new CGs in (iv) poses some practical design challenges. To be applicable to different graphs/topologies, DCG must be invariant to reshuffling of agent indices. This requires the payoff matrix $\pmb { f } ^ { i j }$ , of dimensionality $| { \mathcal { A } } ^ { i } | \times | { \mathcal { A } } ^ { j } |$ , to be the same as $\bar { ( } f ^ { j i } ) ^ { \top }$ with swapped inputs. We enforce invariance by computing the function $f _ { \phi } ^ { e }$ for both combinations and use the average between the two. Note that this retains the ability to learn asymmetric payoff matrices $\mathbf { \ } f ^ { i j } \neq ( \mathbf { \ } f ^ { i j } ) ^ { \top }$ . However, this paper does not evaluate (iv) and we leave the transfer of a learned DCG onto different graphs to future work. The DCG $Q$ -value function is:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\begin{array} { r l r } { q _ { \theta \phi \psi } ^ { \mathrm { D C G } } ( \tau _ { t } , a ) } & { : = } & \frac { 1 } { | \mathcal { V } | } \displaystyle \sum _ { i = 1 } ^ { n } \underbrace { f _ { \theta } ^ { v } ( a ^ { i } | h _ { t } ^ { i } ) } _ { f _ { i , a ^ { i } } ^ { v } } + \frac { 1 } { 2 | \mathcal { E } | } \displaystyle \sum _ { \{ i , j \} \in \mathcal { E } } \left( \underbrace { f _ { \phi } ^ { e } ( a ^ { i } , a ^ { j } | h _ { t } ^ { i } , h _ { t } ^ { j } ) + f _ { \phi } ^ { e } ( a ^ { j } , a ^ { i } | h _ { t } ^ { j } , h _ { t } ^ { i } ) } _ { f _ { \{ i , j \} , a ^ { i } \} ^ { v } } \right) . } \end{array}
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
Moreover, some tasks allow access to privileged information like the global state $s _ { t } ~ \in ~ S$ during training (but not execution). We therefore propose in (v) to use this information in a privileged bias function $v _ { \varphi } : \mathcal { S } \mathbb { R }$ with parameters $\varphi$ , that is, $q _ { \theta \phi \psi \varphi } ^ { \mathrm { D C G - V } } \big ( s _ { t } , \pmb { \tau } _ { t } , \pmb { a } \big ) : = q _ { \theta \phi \psi } ^ { \mathrm { D C G } } ( \pmb { \tau } _ { t } , \pmb { a } ) + \bar { \upsilon } _ { \varphi } \big ( s _ { t } \big )$ .
|
| 111 |
+
|
| 112 |
+
We train DCG end-to-end with the DQN loss in (2) and Double $Q$ -learning (van Hasselt et al., 2016). Given the tensors $f ^ { \mathrm { v } } \in \mathbb { R } ^ { | \nu | \times A }$ and $\pmb { f } ^ { \mathrm { E } } \in \mathbb { R } ^ { | \mathcal { E } | \times A \times A }$ , $A : = | \cup _ { i } { \mathcal { A } } ^ { i } |$ , where all unavailable actions are set to $- \infty$ , the $Q$ -value can be maximized by message passing as defined in (4) and (5). The detailed procedure of computing the tensors (Algorithm 1), the $Q$ -value (Algorithm 2) and greedy action selection (Algorithm 3) is given in the appendix. Note that no gradients flow through the message passing loop, as DQN maximizes only the bootstrapped future value.
|
| 113 |
+
|
| 114 |
+
The key benefit of DCG lies in its ability to prevent relative overgeneralization during the exploration of agents: take the example of two hunters who have cornered their prey. The prey is dangerous and attempting to catch it alone can lead to serious injuries. From the perspective of each hunter, the expected reward for an attack depends on the actions of the other agent, who will initially behave randomly. If the punishment for attacking alone outweighs the reward for catching the prey, agents that cannot represent the value for joint actions (QMIX, VDN, IQL) cannot learn the optimal policy. However, estimating a value function over the joint action space (as in QTRAN) can be equally prohibitive, as it requires many more samples for the same prediction quality. DCG provides a flexible function class between these extremes that can be tailored to the task at hand.
|
| 115 |
+
|
| 116 |
+
# 5 VALIDATION
|
| 117 |
+
|
| 118 |
+
In this section we compare the performance of DCG with various topologies (see Table 1) to the state-of-the-art algorithms QTRAN (Son et al., 2019), QMIX (Rashid et al., 2018), VDN (Sunehag et al., 2018) and IQL (Tan, 1993). We also evaluate a CG baseline similar to Castellini et al. (2019), which conditions on a shared RNN which summarizes all agents’ histories. All algo rithms are implemented in the multi-agent framework PYMARL (Samvelyan et al., 2019).
|
| 119 |
+
|
| 120 |
+
<table><tr><td rowspan=1 colspan=1>DCG</td></tr><tr><td rowspan=1 colspan=1>CYCLE</td></tr><tr><td rowspan=1 colspan=1>LINE</td></tr><tr><td rowspan=1 colspan=1>STAR</td></tr><tr><td rowspan=1 colspan=1>VDN</td></tr></table>
|
| 121 |
+
|
| 122 |
+
Table 1: Tested graph topologies for DCG.
|
| 123 |
+
|
| 124 |
+
We evaluate these methods in two complex grid-world tasks: the first formulates the relative overgeneralization problem as a family of predator-prey tasks and the second investigates how artificial decentralization can hurt tasks that demand non-local coordination between agents. In the latter case, decentralized value functions (QMIX, VDN, IQL) cannot learn coordinated action selection between agents that cannot see each other directly and thus converge to a sub-optimal policy. We also evaluate DCG and DCG-V in StarCraft 2 micromanagement tasks from the StarCraft MultiAgent Challenge (SMAC, Samvelyan et al., 2019).
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 2: Influence of punishment $p$ for attempts to catch prey alone on greedy test episode return (mean and shaded standard error, [number of seeds]) in a coordination task where 8 agents hunt 8 prey (dotted line denotes best possible return). Note that fully connected DCG (DCG, solid) are able to represent the value of joint actions and coordinate maximization, which leads to a better performance for larger $p$ , where DCG without edges (VDN, dashed) has to fail eventually $( p < - 1 )$ .
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 3: Greedy test episode return for the coordination task of Figure 2 with punishment $p = - 2$ : (a) comparison to baseline algorithms; (b) comparison between DCG topologies. Note that QMIX, IQL, VDN and CG (dashed) do not solve the task (return 0) due to relative overgeneralization and that QTRAN learns very slowly due to the large action space. The reliability of DCG depends on the CGtopology: all seeds with fully connected DCG solved the task, but the high standard error for CYCLE, LINE and STAR topologies is caused by some seeds succeeding while others fail completely.
|
| 131 |
+
|
| 132 |
+
# 5.1 RELATIVE OVERGENERALIZATION
|
| 133 |
+
|
| 134 |
+
To model the challenge of relative overgeneralization, we consider a partially observable grid-world predator-prey task: 8 agents have to hunt 8 prey in a $1 0 \times 1 0$ grid. Each agent can either move in one of the 4 compass directions, remain still, or try to catch any adjacent prey. Impossible actions, that is, moves into an occupied target position or catching when there is no adjacent prey, are treated as unavailable. The prey moves by randomly selecting one available movement or remains motionless if all surrounding positions are occupied. If two adjacent agents execute the catch action, a prey is caught and both the prey and the catching agents are removed from the grid. An agent’s observation is a $5 \times 5$ sub-grid centered around it, with one channel showing agents and another indicating prey. Removed agents and prey are no longer visible and removed agents receive a special observation of all zeros. An episode ends if all agents have been removed or after 200 time steps. Capturing a prey is rewarded $r = 1 0$ , but unsuccessful attempts by single agents are punished by a negative reward $p$ . The task is similar to one proposed by Son et al. (2019), but significantly more complex, both in terms of the optimal policy and in the number of agents.
|
| 135 |
+
|
| 136 |
+
To demonstrate the effect of relative overgeneralization, Figure 2 shows the average return of greedy test episodes for varying punishment $p$ as mean and standard error over 8 independent runs. Without punishment $( p = 0$ in Figure 2a), fully connected DCG (DCG, solid) performs as well as DCG without edges (VDN, dashed). However, for stronger punishment VDN becomes more and more unreliable, which is visible in the large standard errors in Figures 2b and 2c, until it fails completely for $p \leq - 1 . 5$ in Figure 2d. This is due to relative overgeneralization, as VDN cannot represent the values of joint actions during exploration. DCG, on the other hand, learns only slightly slower with punishment and converges otherwise reliably to the optimal solution (dotted line).
|
| 137 |
+
|
| 138 |
+
Figure 3a shows how well DCG performs in comparison with the baseline algorithms in Appendix A.1 for a strong punishment of $p = - 2$ . Note that QMIX, IQL and VDN completely fail to learn the task (return 0) due to their restrictive value factorization. While CG could in principle learn the same policy as DCG, the lack of parameter sharing appears to slow down learning dramatically here, which yields no reward in the first million transitions. QTRAN estimates the values with a centralized function, which conditions on all agents’ actions, and can therefore learn the task. However, QTRAN requires much more samples than DCG before a useful policy can be learned, due to the size of the joint action space. This is in line with the findings of Son et al. (2019), which required much more samples to learn a task with four agents than with two and also show the characteristic dip in performance with more agents. In comparison with both QTRAN and CG, fully connected DCG (DCG) learn near-optimal policies remarkably fast and reliable.
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 4: Greedy test episode return (mean and shaded standard error, [number of seeds]) in a non-decentralizable task where 8 agents hunt 8 prey: (a) comparison to baseline algorithms; (b) comparison between DCG topologies. The prey turns randomly into punishing ghosts, which are indistinguishable from normal prey. The prey status is only visible at an indicator that is placed randomly at each episode in one of the grid’s corners. QTRAN, QMIX, IQL and VDN learn decentralized policies, which are at best suboptimal in this task (around lower dotted line). Fully connected DCG and CG can learn a near-optimal policy (upper dotted line denotes best possible return), but a lack of parameter sharing slows down CG and yields sub-optimal performance in comparison to DCG.
|
| 142 |
+
|
| 143 |
+
We also investigated the performance of various DCG topologies defined in Table 1. Figure 3b shows that in particular the reliability of the achieved test episode return depends strongly on the graph topology. While all seeds of fully connected DCG succeed (DCG), DCG with CYCLE, LINE and STAR topologies have varying means while exhibiting large standard errors. The high deviations are caused by some runs finding near-optimal policies, while others fail completely (return 0). One possible explanation is that for the failed seeds the rewarded experiences, observed in the initial exploration, are only amongst agents that do not share a payoff function. Due to the relative overgeneralization pathology, the learned greedy policy no longer explores ‘catch’ actions and existing payoff functions cannot experience the reward for coordinated actions anymore. It is therefore not surprising that fully connected graphs perform best, as they represent the largest function class and require the fewest assumptions. The topology had also little influence on the runtime of DCG, due to efficient batching on the GPU. The tested fully connected DCG only considers pairwise edges. Hyper-edges between more than two agents (Figure 1c) would yield even richer value representations, but would also require more samples to sufficiently approximate the payoff functions. This effect can be seen in the much slower learning QTRAN results in Figure 3a.
|
| 144 |
+
|
| 145 |
+
# 5.2 ARTIFICIAL DECENTRALIZATION
|
| 146 |
+
|
| 147 |
+
The choice of decentralized value functions is in most cased motivated by the huge joint action spaces and not because the task actually requires decentralized execution: it is an artificial decentralization. While this often works surprisingly well, we want to investigate how existing algorithms deal with tasks that cannot be fully decentralized. One obvious case in which decentralization must fail is when the optimal policy cannot be represented by utility functions alone. For example, decentralized policies behave suboptimally in tasks where the optimal policy must condition on multiple agents’ observations in order to achieve the best return. Payoff functions in DCG, on the other hand, condition on pairs of agents and can thus represent a richer class of policies. Note that dependencies on more agents can be modeled as hyper-edges in the DCG (Figure 1c), but this hurts the sample efficiency as discussed above.
|
| 148 |
+
|
| 149 |
+
We evaluate the advantage of a richer policy class with a variation of the above predator-prey task. Inspired by the video game PACMAN, at each turn a fair coin flip decides randomly whether all prey are turned into dangerous ghosts. To disentangle the effects of relative overgeneralization, prey can be caught by only one agent (without punishment), yielding a reward of $r = 1$ . However, if the agent captures a ghost, the team is punished with $r = - 1$ . Ghosts are indistinguishable from normal prey, except for a special indicator that is placed in a random corner at the beginning of each episode. The indicator signals on an additional channel of the agents’ observations whether the prey are currently ghosts. Due to the short visibility range of the agents, the indicator is only visible in one of the 9 positions closest to its corner.
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 5: Low-rank payoff approximation for the tasks in (a) Figure 3 and (b) Figure 4. The inlay in (a) magnifies the area of the gray box. Note that in (a) all approximation ranks learn much faster than full DCG, and rank $2 - 4$ also have better performance.
|
| 153 |
+
|
| 154 |
+
Figure 4a shows the performance of QTRAN, QMIX, IQL and VDN, all of which have decentralized policies, in comparison to fully connected DCG and CG. The baseline algorithms have to learn a policy that first identifies the location of the indicator and then herds prey into that corner, where the agent is finally able to catch it without risk. By contrast, DCG and CG can learn a policy where one agent finds the indicator, allowing all agents that share an edge to condition their payoffs on that agent’s current observation. As a result, this policy can catch prey much more reliably, as seen in the high performance of DCG compared to all baseline algorithms. Interestingly, as CG conditions on all agents’ histories, the baseline shows an advantage in the beginning but then learns much slower and reaches a significantly lower performance. We also investigate the influence of the DCG topologies of Table 1, shown in Figure 4b. Note that while other topologies do not reach the same performance as fully connected DCG, they still reach a policy that significantly outperforms all baseline algorithms, around the same performance as fully connected CG.
|
| 155 |
+
|
| 156 |
+
# 5.3 LOW-RANK APPROXIMATION
|
| 157 |
+
|
| 158 |
+
While the above experiments already show a significant advantage of DCG with independent payoff outputs for each action pair, we observed some serious performance issues on StarCraft 2 maps with this architecture. The most likely cause is the difference in the number of actions per agent: predator-prey agents choose between $| \dot { \mathcal { A } } ^ { i } | = 6$ actions, whereas SMAC agents on comparable maps with 8 enemies have $\vert \mathcal { A } \vert = 1 3$ actions. While payoff matrices with 36 outputs in predator-prey appear reasonable to learn, 169 outputs in StarCraft 2 would require significantly more samples to estimate the payoff of each joint-action properly.
|
| 159 |
+
|
| 160 |
+
Figure 5 shows the influence of low-rank payoff approximation (Equation 6 with $K \in \{ 1 , \ldots , 4 \} )$ on both predator-prey tasks from previous subsections. One can see in Figure 5a that any low-rank approximation (DCG (rank $K$ )) significantly improves the sample efficiency over the default architecture with independent payoff for each action pair (DCG (full)). Only rank $K = 1$ leads to slightly lower performance, which can be seen in the inlay plot. We conclude that rank $K \geq 2$ is needed to represent the true values, but rank $K = 1$ already suffices to overcome the relative overgeneralization pathology. The improvement in Figure 5b is less impressive, but shows that even rank $K = 1$ approximation (DCG (rank 1)) yields slight performance gains over DCG (full).
|
| 161 |
+
|
| 162 |
+
# 5.4 STARCRAFT 2
|
| 163 |
+
|
| 164 |
+
The default architecture of DCG with independent payoff for each action pair performed poorly in StarCraft 2. We therefore tested $K = 1$ low-rank payoff approximation DCG with (DCG-V) and without (DCG) privileged information bias function $v _ { \varphi }$ , as described in Section 4, on six StarCraft 2 maps (from SMAC, Samvelyan et al., 2019). The learning curves for all StarCraft 2 maps are given in Figure 6. We expected DCG to only yield an advantage on maps which struggle with the relative overgeneralization pathology or some related issue. In this light it is somewhat surprising that both DCG and $\mathrm { D C G - V }$ outperform VDN on almost all maps. $\mathrm { D C G - V }$ performs at least as good as DCG and clearly outperforms it on some maps, which demonstrates that privileged information is clearly useful. As expected, a direct comparison with the state-of-the-art method QMIX depends strongly on the StarCraft 2 map. On the one hand, DCG-V clearly outperforms QMIX on MMM2 (Figure 6a), which is classified as super hard by SMAC. We also learn much faster on the easy map so many baneling (Figure 6b). On the other hand, QMIX performs better on the hard map $3 s \_ { \tt V S - } 5 z$ (Figure 6d), which might be due to the low number of 3 agents. For this few agents, the added representational capacity of DCG may not improve the task as much as the non-linear state-dependent mixing of QMIX. However, it is hard to pin-point why state dependent mixing is an advantage here.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 6: Cumulative reward for test episodes on SMAC maps (mean and shaded standard error, [number of seeds]) for QMIX, VDN and fully connected DCG with rank $K = 1$ payoff approximation (DCG (rank 1)) and additional state-dependent bias function (DCG-V (rank 1)).
|
| 168 |
+
|
| 169 |
+
We conclude from these results that that some maps (like MMM2) clearly benefit from the improved coordination and value representation of DCG, while in most others DCG-V is on par with QMIX.
|
| 170 |
+
|
| 171 |
+
# 6 CONCLUSIONS & FUTURE WORK
|
| 172 |
+
|
| 173 |
+
This paper introduced the deep coordination graph (DCG), an architecture for value factorization that is specified by a coordination graph (CG) and can be maximized by message passing. We evaluated deep $Q$ -learning with DCG and show that the architecture enables learning of tasks where relative overgeneralization causes all decentralized baselines to fail, whereas centralized critics are much less sample efficient than DCG. We also demonstrated that artificial decentralization can lead to suboptimal behavior in all compared methods except DCG. Our method significantly improves over existing CG methods, which we demonstrate experimentally as well. Fully connected DCG performed best in all experiments and should be preferred in the absence of prior knowledge about the task. Additionally, we introduced a low-rank payoff approximation for large action spaces and a privileged bias function (DCG-V). Evaluated on StarCraft 2 micromanagement tasks, DCG-V performs competitive with the state-of-the-art QMIX. Although not evaluated in this paper, DCG should be able to transfer/generalize to different graphs/topologies and can also be defined for higher-order dependencies. This would in principle allow the training of DCG on dynamically generated graphs, including hyper-edges with varying degrees. We plan to investigate this in future work.
|
| 174 |
+
|
| 175 |
+
# REFERENCES
|
| 176 |
+
|
| 177 |
+
Bohmer, W., Rashid, T., and Whiteson, S. Exploration with unreliable intrinsic reward in multi- ¨ agent reinforcement learning. CoRR, abs/1906.02138, 2019. URL http://arxiv.org/ abs/1906.02138. Presented at the ICML Exploration in Reinforcement Learning workshop.
|
| 178 |
+
|
| 179 |
+
Castellini, J., Oliehoek, F. A., Savani, R., and Whiteson, S. The representational capacity of actionvalue networks for multi-agent reinforcement learning. In Proceedings of the 18th International Conference on Autonomous Agents and MultiAgent Systems, AAMAS ’19, pp. 1862–1864, 2019. URL http://www.ifaamas.org/Proceedings/aamas2019/pdfs/p1862.pdf.
|
| 180 |
+
|
| 181 |
+
Chen, Y., Zhou, M., Wen, Y., Yang, Y., Su, Y., Zhang, W., Zhang, D., Wang, J., and Liu, H. Factorized q-learning for large-scale multi-agent systems. CoRR, abs/1809.03738, 2018. URL http://arxiv.org/abs/1809.03738.
|
| 182 |
+
|
| 183 |
+
Chung, J., Gulcehre, C., Cho, K., and Bengio, Y. Empirical evaluation of gated recurrent neural networks on sequence modeling. In NIPS Workshop on Deep Learning, 2014. URL http: //arxiv.org/abs/1412.3555.
|
| 184 |
+
|
| 185 |
+
Crick, C. and Pfeffer, A. Loopy belief propagation as a basis for communication in sensor networks. In Proceedings of the Nineteenth conference on Uncertainty in Artificial Intelligence, pp. 159– 166. Morgan Kaufmann Publishers Inc., 2002.
|
| 186 |
+
|
| 187 |
+
Foerster, J., Assael, Y., de Freitas, N., and Whiteson, S. Learning to communicate with deep multi-agent reinforcement learning. In NIPS 2016: Proceedings of the Thirtieth Annual Conference on Neural Information Processing Systems, 2016. URL http://www.cs.ox.ac. uk/people/shimon.whiteson/pubs/foersternips16.pdf.
|
| 188 |
+
|
| 189 |
+
Foerster, J., Nardelli, N., Farquhar, G., Torr, P., Kohli, P., and Whiteson, S. Stabilising experience replay for deep multi-agent reinforcement learning. In ICML 2017: Proceedings of the ThirtyFourth International Conference on Machine Learning, 2017. URL http://www.cs.ox. ac.uk/people/shimon.whiteson/pubs/foerstericml17.pdf.
|
| 190 |
+
|
| 191 |
+
Foerster, J., Farquhar, G., Afouras, T., Nardelli, N., and Whiteson, S. Counterfactual multi-agent policy gradients. In The Thirty-Second AAAI Conference on Artificial Intelligence (AAAI-18), pp. 2974–2982. AAAI Press, 2018. URL https://arxiv.org/abs/1705.08926.
|
| 192 |
+
|
| 193 |
+
Guestrin, C., Lagoudakis, M., and Parr, R. Coordinated reinforcement learning. In ICML, volume 2, pp. 227–234, 2002a.
|
| 194 |
+
|
| 195 |
+
Guestrin, C., Venkataraman, S., and Koller, D. Context-specific multiagent coordination and planning with factored mdps. In Eighteenth National Conference on Artificial Intelligence, pp. 253– 259, 2002b.
|
| 196 |
+
|
| 197 |
+
Hausknecht, M. J. and Stone, P. Deep recurrent q-learning for partially observable mdps. In 2015 AAAI Fall Symposia, pp. 29–37, 2015. URL http://www.aaai.org/ocs/index.php/ FSS/FSS15/paper/view/11673.
|
| 198 |
+
|
| 199 |
+
Kok, J. R. and Vlassis, N. Collaborative multiagent reinforcement learning by payoff propagation. Journal of Machine Learning Research, 7(Sep):1789–1828, 2006.
|
| 200 |
+
|
| 201 |
+
Lin, L.-J. Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine Learning, 8(3):293–321, 1992.
|
| 202 |
+
|
| 203 |
+
Lowe, R., WU, Y., Tamar, A., Harb, J., Pieter Abbeel, O., and Mordatch, I. Multi-agent actorcritic for mixed cooperative-competitive environments. In Advances in Neural Information Processing Systems 30, pp. 6379–6390. 2017. URL http://papers.nips.cc/paper/ 7217-multi-agent-actor-critic-for-mixed-cooperative-competitive-environments. pdf.
|
| 204 |
+
|
| 205 |
+
Mnih, V., Kavukcuoglu, K., Silver, D., Rusu, A. A., Veness, J., Bellemare, M. G., Graves, A., Riedmiller, M., Fidjeland, A. K., Ostrovski, G., Petersen, S., Beattie, C., Sadik, A., Antonoglou, I., King, H., Kumaran, D., Wierstra, D., Legg, S., and Hassabis, D. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, February 2015.
|
| 206 |
+
|
| 207 |
+
Murphy, K. P., Weiss, Y., and Jordan, M. I. Loopy belief propagation for approximate inference: An empirical study. In Proceedings of the Fifteenth conference on Uncertainty in artificial intelligence, pp. 467–475. Morgan Kaufmann Publishers Inc., 1999.
|
| 208 |
+
|
| 209 |
+
Oliehoek, F. A. and Amato, C. A concise introduction to decentralized POMDPs. Springer Publishing Company, Incorporated, 1st edition, 2016. ISBN 3319289276, 9783319289274.
|
| 210 |
+
OroojlooyJadid, A. and Hajinezhad, D. A review of cooperative multi-agent deep reinforcement learning. CoRR, abs/1908.03963, 2019. URL http://arxiv.org/abs/1908.03963.
|
| 211 |
+
Panait, L., Luke, S., and Wiegand, R. P. Biasing coevolutionary search for optimal multiagent behaviors. IEEE Transactions on Evolutionary Computation, 10(6):629–645, 2006.
|
| 212 |
+
Pearl, J. Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 1988. ISBN 0-934613-73-7.
|
| 213 |
+
Rashid, T., Samvelyan, M., de Witt, C. S., Farquhar, G., Foerster, J. N., and Whiteson, S. QMIX: monotonic value function factorisation for deep multi-agent reinforcement learning. In International Conference on Machine Learning (ICML), pp. 4292–4301, 2018.
|
| 214 |
+
Rogers, A. C., Farinelli, A., Stranders, R., and Jennings, N. R. Bounded approximate decentralised coordination via the max-sum algorithm. Artificial Intelligence, 175(2):730– 759, 2011. ISSN 0004-3702. URL http://www.sciencedirect.com/science/ article/pii/S0004370210001803.
|
| 215 |
+
Samvelyan, M., Rashid, T., de Witt, C. S., Farquhar, G., Nardelli, N., Rudner, T. G. J., Hung, C.- M., Torr, P. H. S., Foerster, J., and Whiteson, S. The StarCraft Multi-Agent Challenge. CoRR, abs/1902.04043, 2019.
|
| 216 |
+
Schroder de Witt, C. A., F ¨ orster, J. N., Farquhar, G., Torr, P. H., B ¨ ohmer, W., and Whiteson, S. ¨ Multi-agent common knowledge reinforcement learning. In To appear in NeurIPS 2019, 2019. URL https://arxiv.org/abs/1810.11702.
|
| 217 |
+
Son, K., Kim, D., Kang, W. J., Hostallero, D. E., and Yi, Y. QTRAN: Learning to factorize with transformation for cooperative multi-agent reinforcement learning. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 5887–5896, 2019. URL http://proceedings.mlr.press/v97/ son19a.html.
|
| 218 |
+
Sunehag, P., Lever, G., Gruslys, A., Czarnecki, W. M., Zambaldi, V., Jaderberg, M., Lanctot, M., Sonnerat, N., Leibo, J. Z., Tuyls, K., and Graepel, T. Value-decomposition networks for cooperative multi-agent learning based on team reward. In Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems (AAMAS), pp. 2085–2087, 2018.
|
| 219 |
+
Tan, M. Multi-agent reinforcement learning: Independent vs. cooperative agents. In Proceedings of the tenth international conference on machine learning, pp. 330–337, 1993.
|
| 220 |
+
van Hasselt, H., Guez, A., and Silver, D. Deep reinforcement learning with double q-learning. In Proceedings of the 13th AAAI Conference on Artificial Intelligence, pp. 2094–2100, 2016. URL https://arxiv.org/pdf/1509.06461.pdf.
|
| 221 |
+
Wainwright, M., Jaakkola, T., and Willsky, A. Tree consistency and bounds on the performance of the max-product algorithm and its generalizations. Statistics and Computing, 14(2):143–166, 2004.
|
| 222 |
+
Watkins, C. and Dayan, P. Q-learning. Machine Learning, 8:279–292, 1992.
|
| 223 |
+
Wei, E., Wicke, D., Freelan, D., and Luke, S. Multiagent soft q-learning. In AAAI Spring Symposium Series, 2018. URL https://www.aaai.org/ocs/index.php/SSS/SSS18/paper/ view/17508/15482.
|
| 224 |
+
Yang, Y., Luo, R., Li, M., Zhou, M., Zhang, W., and Wang, J. Mean field multi-agent reinforcement learning. In Proceedings of the 35th International Conference on Machine Learning, volume 80, pp. 5571–5580, 2018. URL http://proceedings.mlr.press/v80/yang18d.html.
|
| 225 |
+
|
| 226 |
+
Yedidia, J. S., Freeman, W. T., and Weiss, Y. Understanding belief propagation and its generalizations. Exploring artificial intelligence in the new millennium, 8:236–239, 2003.
|
| 227 |
+
|
| 228 |
+
Yedidsion, H., Zivan, R., and Farinelli, A. Applying max-sum to teams of mobile sensing agents. Engineering Applications of Artificial Intelligence, 71:87–99, 2018. ISSN 0952-1976. URL http: //www.sciencedirect.com/science/article/pii/S0952197618300381.
|
| 229 |
+
|
| 230 |
+
# A APPENDIX
|
| 231 |
+
|
| 232 |
+
A.1 BASELINE ALGORITHMS
|
| 233 |
+
|
| 234 |
+
IQL Independent Q-learning (Tan, 1993) is a straightforward approach of value decentralization that allows efficient maximization by modeling each agent as an independent DQN $q _ { \theta } ^ { i } ( a ^ { i } | \tau _ { t } ^ { i } )$ . The value functions can be trained without any knowledge of other agents, which are assumed to be part of the environment. This violates the stationarity assumption of $P$ and can become therefore instable (see e.g. Foerster et al., 2017). IQL is nonetheless widely used in practice, as parameter sharing between agents can make it very sample efficient.
|
| 235 |
+
|
| 236 |
+
Note that parameter sharing requires access to privileged information during training, called centralized training and decentralized execution (Foerster et al., 2016). This is particularly useful for actor-critic methods like MADDPG (Lowe et al., 2017), Multi-agent soft Q-learning (Wei et al., 2018), COMA (Foerster et al., 2018) and MACKRL (Schroder de Witt et al., 2019), where the ¨ centralized critic can condition on the underlying state $s _ { t }$ and the joint action $\mathbf { \delta } _ { \mathbf { { \pmb { a } } } _ { t } } \in { \mathcal { A } }$ .
|
| 237 |
+
|
| 238 |
+
VDN Another way to exploit centralized training is value function factorization. For example, value decomposition networks (VDN, Sunehag et al., 2018) perform centralized deep $Q$ -learning on a joint $Q$ -value function that factors as the sum of independent utility functions $f ^ { i }$ , for each agent $i$ :
|
| 239 |
+
|
| 240 |
+
$$
|
| 241 |
+
\begin{array} { r l r } { q _ { \theta } ^ { \mathrm { v D N } } ( \tau _ { t } , a ) } & { { } : = } & { \sum _ { i = 1 } ^ { n } f _ { \theta } ^ { i } ( a ^ { i } | \tau _ { t } ^ { i } ) . } \end{array}
|
| 242 |
+
$$
|
| 243 |
+
|
| 244 |
+
This value function $q ^ { \mathrm { V D N } }$ can be maximized by maximizing each agent’s utility $f _ { \theta } ^ { i }$ independently.
|
| 245 |
+
|
| 246 |
+
QMIX (Rashid et al., 2018) improves upon this concept by factoring the value function as
|
| 247 |
+
|
| 248 |
+
$$
|
| 249 |
+
\begin{array} { r l r } { q _ { \theta \phi } ^ { \mathrm { Q M I X } } ( s _ { t } , \tau _ { t } , a ) } & { { } : = } & { \varphi _ { \phi } \left( s _ { t } , f _ { \theta } ^ { 1 } ( a ^ { 1 } | \tau _ { t } ^ { 1 } ) , \dots , f _ { \theta } ^ { n } ( a ^ { n } | \tau _ { t } ^ { n } ) \right) . } \end{array}
|
| 250 |
+
$$
|
| 251 |
+
|
| 252 |
+
Here $\varphi _ { \phi }$ is a monotonic mixing hypernetwork with non-negative weights that retains monotonicity in the inputs $f _ { \theta } ^ { i }$ . Maximizing each utility $f _ { \theta } ^ { i }$ therefore also maximizes the joint value $q ^ { \mathrm { Q M I X } }$ , as in VDN. The mixing parameters are generated by a neural network, parameterized by $\phi$ , that condition on the state $s _ { t }$ , allowing different mixing of utilities in different states. QMIX improves performance over VDN, in particular in StarCraft II micromanagement tasks (SMAC, Samvelyan et al., 2019).
|
| 253 |
+
|
| 254 |
+
QTRAN Recently Son et al. (2019) introduced QTRAN, which learns the centralized critic of a greedy policy w.r.t. a VDN factorized function, which in turn is distilled from the critic by regression under constraints. The algorithm defines three value functions $q ^ { \mathrm { V D N } }$ , $q$ and $v$ , where $q ( \pmb { \tau } _ { t } , \pmb { u } )$ is the centralized Q-value function, as in Section 3.1, and
|
| 255 |
+
|
| 256 |
+
$$
|
| 257 |
+
\begin{array} { r l r } { v ( \tau _ { t } ) } & { { } : = } & { \operatorname* { m a x } q ( \tau _ { t } , \cdot ) - \operatorname* { m a x } q ^ { \mathrm { V D N } } ( \tau _ { t } , \cdot ) . } \end{array}
|
| 258 |
+
$$
|
| 259 |
+
|
| 260 |
+
They prove that the greedy policies w.r.t. $q$ and $q ^ { \mathrm { V D N } }$ are identical under the constraints:
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
\begin{array} { r l r } { q ^ { \mathrm { v o r } } ( \tau _ { t } , u ) - q ( \tau _ { t } , a ) + v ( \tau _ { t } ) } & { { } \geq } & { 0 , \quad \forall a \in \mathcal { A } , \quad \forall \tau _ { t } \in \{ ( \mathcal { O } ^ { i } \times \mathcal { A } ^ { i } ) ^ { t } \times \mathcal { O } ^ { i } \} _ { i = 1 } ^ { n } , } \end{array}
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
with strict equality if and only if $\pmb { a } = \arg \operatorname* { m a x } q ^ { \mathrm { v D N } } ( \pmb { \tau } _ { t } , \cdot )$ . QTRAN minimizes the parameters $\phi$ of the centralized asymmetric value $q _ { \phi } ^ { i } ( a ^ { i } | \tau _ { t } , a ^ { - i } ) , \pmb { a } ^ { - i } : = ( a ^ { 1 } , \ldots , a ^ { i - 1 } , a ^ { i + 1 } , \ldots , a ^ { n } )$ , for each agent (which is similar to Foerster et al., 2018) with the combined loss ${ \mathcal { L } } _ { \mathrm { T D } }$ :
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\begin{array} { r l r } { \mathcal { L } _ { \mathrm { T D } } } & { { } : = } & { \mathbb { E } \Big [ \frac { 1 } { n T } \underset { t = 0 } { \sum } \underset { i = 0 } { \overset { T } { \sum } } \Big ( r _ { t } + \gamma q _ { \bar { \phi } } ^ { i } ( \bar { a } _ { t + 1 } ^ { i } | \tau _ { t + 1 } , \bar { a } _ { t + 1 } ^ { - i } ) - q _ { \phi } ^ { i } ( a _ { t } ^ { i } | \tau _ { t } , a _ { t } ^ { - i } ) \Big ) ^ { 2 } \Big ] , } \end{array}
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
where a¯t := arg max $q _ { \theta } ^ { \mathrm { V D N } } ( \tau _ { t } , \cdot ) , \forall t$ , denotes what a greedy decentralized agent would have chosen. The decentralized value $q _ { \theta } ^ { \mathrm { V D N } }$ and the greedy difference $v _ { \psi }$ , with parameters $\theta$ and $\psi$ respectively, are distilled by regression of the each $q _ { \phi } ^ { i }$ in the constraints. First the equality constraint:
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
\begin{array} { r l r } { \mathcal { L } _ { \mathrm { o p r } } } & { { } : = } & { \mathbb { E } \Big [ \frac { 1 } { n T } \underset { t = 0 } { \sum } \underset { i = 0 } { \overset { T } { \sum } } \Big ( q _ { \theta } ^ { \mathrm { v D N } } \big ( \tau _ { t } , \bar { a } _ { t } \big ) - \perp q _ { \phi } ^ { i } \big ( \bar { a } _ { t } ^ { i } | \tau _ { t } , \bar { a } _ { t } ^ { - i } \big ) + v _ { \psi } ( \tau _ { t } ) \Big ) ^ { 2 } \Big ] , } \end{array}
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
where the ‘detach’ operator $\perp$ stops the gradient flow through $q _ { \phi } ^ { i }$ . The inequality constraints are more complicated. In principle one would have to compute a loss for every action which has a negative error in (13). Son et al. (2019) suggest to use only the action which minimizes $q ^ { \mathrm { v d n } }$ :
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
\mathcal { L } _ { \mathrm { { N o p r } } } : = \mathbb { E } \Big [ \frac { 1 } { n T } \sum _ { t = 0 } ^ { T } \sum _ { i = 0 } ^ { n } \Big ( \operatorname* { m i n } _ { a ^ { i } \in A ^ { i } } \Big \{ f ^ { i } ( a ^ { i } | \tau _ { t } ^ { i } ) + \sum _ { j \neq i } f ^ { j } ( a _ { t } ^ { j } | \tau _ { t } ^ { j } ) - \bot q _ { \phi } ^ { i } ( a ^ { i } | \tau _ { t } , a _ { t } ^ { - i } ) + v _ { \psi } ( \tau _ { t } ) \Big \} \Big ) ^ { 2 } \Big ] .
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
We use this loss, which is called QTRAN-alt, as it is reported to perform significantly better. The losses are combined to $\mathcal { L } _ { \mathrm { Q T R A N } } : = \mathcal { L } _ { \mathrm { T D } } + \lambda _ { \mathrm { O P T } } \mathcal { L } _ { \mathrm { O P T } } + \lambda _ { \mathrm { N O P T } } \mathcal { L } _ { \mathrm { N O P T } }$ , with $\lambda _ { \mathrm { O P T } } , \lambda _ { \mathrm { N O P T } } > 0$ .
|
| 285 |
+
|
| 286 |
+
CG To compare the effect of parameter sharing and restriction to local information in DCG, we evaluate a variation of Castellini et al. (2019) that can solve sequential tasks. In this baseline all agents share a RNN encoder of their belief over the current global state $\pmb { h } _ { t } : = h _ { \psi } ( \cdot | \pmb { h } _ { t - 1 } , \pmb { o } _ { t } , \pmb { a } _ { t - 1 } )$ with $h _ { 0 } : = h _ { \psi } ( \cdot | \mathbf { 0 } , o _ { 0 } , \mathbf { 0 } )$ , as introduced in Section 3.1. However, the parameters of the utility or payoff functions are not shared, that is, $\theta : = \{ \theta _ { i } \} _ { i = 1 } ^ { n }$ and $\phi : = \{ \phi _ { i j } \bar { | } \{ i , j \} \in \mathcal { E } \}$ . Each set of parameters $\theta _ { i }$ and $\phi _ { i j }$ represents one linear layer from $h _ { t }$ to $\mathcal { A } ^ { i }$ and $\mathcal { A } ^ { i } \times \mathcal { A } ^ { j }$ outputs, respectively.
|
| 287 |
+
|
| 288 |
+
# A.2 HYPER-PARAMETERS
|
| 289 |
+
|
| 290 |
+
All algorithms are implemented in the PYMARL framework (Samvelyan et al., 2019). We aimed to keep the hyper-parameters close to those given in the framework and consistent for all algorithms.
|
| 291 |
+
|
| 292 |
+
All tasks used discount factor $\gamma = 0 . 9 9$ and $\epsilon$ -greedy exploration, which was linearly decayed from $\epsilon = 1$ to $\epsilon = 0 . 0 5$ within the first 50, 000 time steps. Every 2000 time steps we evaluated 20 greedy test trajectories with $\epsilon = 0$ . Results are plotted by first applying histogram-smoothing (100 bins) to each seed, and then computing the mean and standard error between seeds.
|
| 293 |
+
|
| 294 |
+
All methods are based on agents’ histories, which were individually summarized with $h _ { \psi }$ by conditioning a linear layer of 64 neurons on the current observation and previous action, followed by a ReLU activation and a GRU (Chung et al., 2014) of the same dimensionality. Both layers’ parameters are shared amongst agents, which can be identified by a one-hot encoded ID in the input. For the CG baseline, the linear layer and the GRU had $6 4 n \ : = \ : 5 1 2$ neurons. This allows a fair comparison with DCG and also had the best final performance amongst tested dimensionalities $\{ 6 4 , 2 5 6 , 5 1 2 , 1 0 2 4 \}$ in the task of Figure 4. Independent value functions $\overset { \cdot } { q _ { \theta } ^ { i } }$ (for IQL), utility functions $f _ { \theta } ^ { v }$ (for VDN/QMIX/QTRAN/DCG) and payoff functions $f _ { \phi } ^ { e }$ (for DCG) are linear layers from the GRU output to the corresponding number of actions. The hyper-network $\varphi _ { \phi }$ of QMIX produces a mixing network with two layers connected with an ELU activation function, where the weights of each mixing-layer are generated by a linear hyper-layer with 32 neurons conditioned on the global state, that is, the full grid-world. For QTRAN, the critic $q _ { \phi } ^ { i }$ computes the $Q$ -value for an agent $i$ by taking all agents’ GRU outputs, all other agents’ one-hot encoded actions, and the one-hot encoded agent ID $i$ as input. The critic contains four successive linear layers with 64 neurons each and ReLU activations between them. The greedy difference $v _ { \psi }$ also conditions on all agents’ GRU outputs and uses three successive linear layers with 64 neurons each and ReLU activations between them. We took the loss parameters $\lambda _ { \mathrm { O P T } } = \lambda _ { \mathrm { N O P T } } = 1$ from (Son et al., 2019) without any hyper-parameter exploration.
|
| 295 |
+
|
| 296 |
+
All algorithms were trained with one RMSprop gradient step after each observed episode based on a batch of 32 episodes, which always contains the newest, from a replay buffer holding the last 500 episodes. The optimizer uses learning rate 0.0005, $\alpha = 0 . 9 9$ and $\epsilon = 0 . 0 0 0 0 1$ . Gradients with a norm $\geq 1 0$ were clipped. The target network parameters were replaced by a copy of the current parameters every 200 episodes.
|
| 297 |
+
|
| 298 |
+
Table 2: All tested StarCraft 2 maps for SMAC (Samvelyan et al., 2019).
|
| 299 |
+
|
| 300 |
+
<table><tr><td>Name</td><td>Agents</td><td>Enemies</td><td>Difficulty</td></tr><tr><td>so_many_baneling</td><td>7 Zealots</td><td>32 Banelings</td><td>easy</td></tr><tr><td>8m_vs_9m</td><td>8 Marines</td><td>9 Marines</td><td>hard</td></tr><tr><td>3s_vs_5z</td><td>3 Stalker</td><td>5 Zealots</td><td>hard</td></tr><tr><td>3s5z</td><td>3 Stalker and 5 Zealots</td><td>3 Stalker and 5 Zealots</td><td>hard</td></tr><tr><td rowspan="3">MMM2</td><td>1 Medivac</td><td>1 Medivac</td><td rowspan="3">super hard</td></tr><tr><td>2 Marauders</td><td>3 Marauders</td></tr><tr><td>7 Marines</td><td>8 Marines</td></tr><tr><td>micro_focus</td><td>6 Hydralisks</td><td>8 Stalker</td><td>super hard</td></tr></table>
|
| 301 |
+
|
| 302 |
+
# A.3 STARCRAFT 2 DETAILS
|
| 303 |
+
|
| 304 |
+
We kept all hyper-parameters the same and evaluated the six maps in Table 2. All maps are from SMAC (Samvelyan et al., 2019), except micro focus, which was provided to us by the SMAC authors. The results for DCG-V, DCG, QMIX and VDN are given in Figure 6, where both DCG variants use a rank-1 payoff approximation. Note that our results differ from those in Samvelyan et al. (2019), due to slightly different parameters and an update after every episode. The latter differs from the original publication because we use the the episode runner instead of the parallel runner of PYMARL. These choices ended up improving the performance of QMIX significantly.
|
| 305 |
+
|
| 306 |
+
<table><tr><td colspan="2">Algorithm 1 Annotates a CG by computing the utility and payoff tensors (rank K approximation).</td></tr><tr><td>function ANNOTATE({hi_1,at-1,0}z=1,ε,{Ai}²=1,K ∈ IN)</td><td> A:=|Ui A|</td></tr><tr><td>fV:=0∈ RnXA</td><td>initialize utility tensor</td></tr><tr><td>fE:=0 ∈ IRlε|xAxA</td><td>>initialize payoff tensor</td></tr><tr><td>fori∈{1,...,n} do</td><td>> compute batch with all agents</td></tr><tr><td>h²:=h(h²-1,0²,a²-1)</td><td> new hidden state</td></tr><tr><td>fy←f(h)∈RA</td><td> compute utility</td></tr><tr><td>for a ∈ {1,...,A}\A do</td><td>> set unavailable actions...</td></tr><tr><td>f←-080</td><td>v..t18</td></tr><tr><td>for e= (i,j) ∈εdo</td><td>> compute batch with all edges</td></tr><tr><td>ifK=O then</td><td>> if no low-rank approximation</td></tr><tr><td>f←f(,|h²,h)+f(,|h²,h)T∈IRA×A) else</td><td>> symmetric payoffs > if low-rank approximation</td></tr><tr><td>[F,F]:=f(.,,|h²,h) ∈</td><td></td></tr><tr><td>[F',F]:=f8(.,,·|h²,h²) ∈</td><td></td></tr><tr><td>f←1FFT+FFT ∈</td><td></td></tr><tr><td>return {hi}=1,fV,fE</td><td>symmetric payoffs > return hidden states h𝑖, utility tensor fV and payoff tensor fE</td></tr></table>
|
| 307 |
+
|
| 308 |
+
<table><tr><td colspan="2">Algorithm 2 Q-value computed from utility and payoff tensors (and potentially global state St).</td></tr><tr><td>function QVALUE(fV ∈ IRIVIxA, fE ∈ Rlε|xAxA,a ∈ A,st ∈ SU{0}) 1</td><td>U(0)=0</td></tr><tr><td>fV ∑faa+U(st) return 1 + 1 向 Jiai E i=1 e=(i,j)∈ε</td><td>D return the Q-value of the given actions a</td></tr></table>
|
| 309 |
+
|
| 310 |
+
<table><tr><td colspan="2">Algorithm 3 Greedy action selection with k message passes in a coordination graph.</td></tr><tr><td>μ,p° :=O ∈ IRlε|xA</td><td>A:=|U A² > messages forward (μ) and backward (p)</td></tr><tr><td>q=高fv</td><td>> initialize“Q-value”without messages</td></tr><tr><td>for t ∈{1,...,k} do for e=(i,j) ∈ ε do</td><td>loop with k message passes >update forward and backward messages</td></tr><tr><td>-1)+fa} aEAi</td><td>forward:maximize sender</td></tr><tr><td>p := max Hta1)+(fE)}</td><td>>backward: maximizes receiver</td></tr><tr><td>a∈Aj if message_normalization then</td><td> to ensure converging messages</td></tr><tr><td>←哈一肉 ea 1 £</td><td>normalize forward message</td></tr><tr><td>aEAj 哈←路一丽 M Pea</td><td> normalize backward message</td></tr><tr><td>aEAi fori∈Vdo</td><td></td></tr><tr><td>q=高f+∑+∑w</td><td>> update “Q-value” with messages > utility plus incoming messages</td></tr><tr><td>e=(.,i)∈ε e=(i,)∈ε at := arg max{qia}</td><td></td></tr><tr><td>aEAi return ak ∈ A1 × ... × Alvl</td><td>> select greedy action of agent i > return actions that maximize the joint Q-value</td></tr></table>
|
md/train/Kb26p7chwhf/Kb26p7chwhf.md
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# On Large-Cohort Training for Federated Learning
|
| 2 |
+
|
| 3 |
+
Zachary Charles Google zachcharles@google.com
|
| 4 |
+
|
| 5 |
+
Zachary Garrett Google zachgarrett@google.com
|
| 6 |
+
|
| 7 |
+
Zhouyuan Huo Google zhhuo@google.com
|
| 8 |
+
|
| 9 |
+
Sergei Shmulyian Google sshmulyian@google.com
|
| 10 |
+
|
| 11 |
+
Virginia Smith Carnegie Mellon University smithv@cmu.edu
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
Federated learning methods typically learn a model by iteratively sampling updates from a population of clients. In this work, we explore how the number of clients sampled at each round (the cohort size) impacts the quality of the learned model and the training dynamics of federated learning algorithms. Our work poses three fundamental questions. First, what challenges arise when trying to scale federated learning to larger cohorts? Second, what parallels exist between cohort sizes in federated learning, and batch sizes in centralized learning? Last, how can we design federated learning methods that effectively utilize larger cohort sizes? We give partial answers to these questions based on extensive empirical evaluation. Our work highlights a number of challenges stemming from the use of larger cohorts. While some of these (such as generalization issues and diminishing returns) are analogs of large-batch training challenges, others (including catastrophic training failures and fairness concerns) are unique to federated learning.
|
| 16 |
+
|
| 17 |
+
# 1 Introduction
|
| 18 |
+
|
| 19 |
+
Federated learning (FL) [52] considers learning a model from multiple clients without directly sharing training data, often under the orchestration of a central server. In this work we focus on cross-device FL, in which the aim is to learn across a large population of edge devices [27, Table 1]. A distinguishing characteristic of cross-device FL is partial participation of the client population: Due to systems constraints such as network size, the server typically only communicates with a subset of the clients at a time1. For example, in the popular FedAvg algorithm [52], at each communication round the server broadcasts its current model to a subset of available clients (referred to as a cohort), who use the model to initialize local optimization and send their model updates back to the server.
|
| 20 |
+
|
| 21 |
+
Intuitively, larger cohort sizes have the potential to improve the convergence of FL algorithms. By sampling more clients per round, we can observe a more representative sample of the underlying population—possibly reducing the number of communication rounds needed to achieve a given accuracy. This intuition is reflected in many convergence analyses of FL methods [29, 31, 32, 62, 69], which generally show that asymptotic convergence rates improve as the cohort size increases.
|
| 22 |
+
|
| 23 |
+
Larger cohorts can also provide privacy benefits. For example, when using the distributed differential privacy model [6, 11, 16, 65] in federated learning, noise is typically added to the updates sent from the clients to the server [54]. This helps preserve privacy but can also mar the utility of the learned model. By dividing the noise among more clients, larger cohorts may mitigate detrimental effects of noise. Moreover, since privacy tends to decrease as a function of the number of communication rounds [1, 17], larger cohorts also have the potential to improve privacy in FL by reducing the number of rounds needed for convergence.
|
| 24 |
+
|
| 25 |
+
Motivated by the potential benefits of large-cohort training, we systematically explore the impact of cohort size in realistic cross-device settings. Our results show that increasing the cohort size may not lead to significant convergence improvements in practice, despite their theoretical benefit [69]. Moreover, large-cohort training can introduce fundamental optimization and generalization issues. Our results are reminiscent of work on large-batch training in centralized settings, where larger batches can stagnate convergence improvements [14, 19, 51, 70, 71], and even lead to generalization issues with deep neural networks [23, 30, 46–48, 50, 64]. While some of the challenges we identify with large-cohort training are parallel to issues that arise in large-batch centralized learning, others are unique to federated learning and have not been previously identified in the literature.
|
| 26 |
+
|
| 27 |
+
Contributions. In this work, we provide a novel examination of cohort sizes in federated learning. We give a wide ranging empirical analysis spanning many popular federated algorithms and datasets (Section 2). Despite the many possible benefits of large-cohort training, we find that challenges exist in realizing these benefits (Section 3). We show that these issues are caused in part by distinctive characteristics of federated training dynamics (Section 4). Using these insights, we provide partial solutions to the challenges we identify (Section 5), focusing on how to adapt techniques from largebatch training, and the limitations of such approaches. Our solutions are designed to serve as simple benchmarks for future work. We conclude by discussing limitations and open problems (Section 6). Throughout, we attempt to uncover interesting theoretical questions, but remain firmly grounded in the practical realities of federated learning.
|
| 28 |
+
|
| 29 |
+
# 1.1 Related Work
|
| 30 |
+
|
| 31 |
+
Large-batch training. In non-federated settings, mini-batch stochastic gradient descent (SGD) and its variants are common choices for training machine learning models, particularly deep neural networks. While larger mini-batch sizes ostensibly allow for improved convergence (in terms of the number of steps required to reach a desired accuracy), in practice speedups may quickly saturate when increasing the mini-batch size. This property of diminishing returns has been explored both empirically [14, 19, 51, 64] and theoretically [48, 70]. Beyond the issue of speedup saturation, numerous works have also observed a generalization gap when training deep neural networks with large batches [23, 30, 46, 47, 50, 71]. Our work differs from these areas by specifically exploring how the cohort size (the number of selected clients) affects federated optimization methods. While some of the issues with large-batch training appear in large-cohort training, we also identify a number of new challenges introduced by the federated setting.
|
| 32 |
+
|
| 33 |
+
Optimization for federated learning. Significant attention has been paid towards developing federated optimization techniques. Such work has focused on various aspects, including communicationefficiency [5, 34, 37, 52], data and systems heterogeneity [25, 28, 29, 39–42, 67], and fairness [26, 43]. We provide a description of some relevant methods in Section 2, and defer readers to recent surveys such as [27] and [41] for additional background. One area pertinent to our work is that of variance reduction for federated learning, which can mitigate negative effects of data heterogeneity [28, 29, 73]. However, such methods often require clients to maintain state across rounds [29, 73], which may be infeasible in cross-device settings [27]. Moreover, such methods may not perform well in settings with limited client participation [62]. Many convergence analyses of federated optimization methods show that larger cohort sizes can lead to improved convergence rates, even without explicit variance reduction [31, 32, 69]. These analyses typically focus on asymptotic convergence, and require assumptions on learning rates and heterogeneity that may not hold in practice [9, 27]. In this work, we attempt to see whether increasing the cohort size leads to improved convergence in practical, communication-limited settings.
|
| 34 |
+
|
| 35 |
+
Client sampling. A number of works have explored how to select cohorts of a fixed size in crossdevice FL [10, 12, 18, 59, 63]. Such methods can yield faster convergence than random sampling by carefully selecting the clients that participate at each round, based on quantities such as the client loss. However, such approaches typically require the server to be able to choose which clients participate in a cohort. In practice, cohort selection in cross-device federated learning is often governed by client availability, and is not controlled by the server [7, 61]. In this work we instead focus on the impact of size of the cohort, assuming the cohort is sampled at random.
|
| 36 |
+
|
| 37 |
+
# 2 Preliminaries
|
| 38 |
+
|
| 39 |
+
Federated optimization methods often aim to minimize a weighted average of client loss functions:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\operatorname* { m i n } _ { x } f ( x ) : = \sum _ { k = 1 } ^ { K } p _ { k } f _ { k } ( x ) ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $K$ is total number of clients, the $p _ { k }$ are client weights satisfying $p _ { k } \geq 0$ , and $f _ { k }$ is the loss function of client $k$ . For practical reasons, $p _ { k }$ is often set to the number of examples in client $k$ ’s local dataset [42, 52].
|
| 46 |
+
|
| 47 |
+
To solve (1), each client in a sampled cohort could send $\nabla f _ { k } ( x )$ to the server, and the server could then apply (mini-batch) SGD. This approach is referred to as FedSGD [52]. This requires communication for every model update, which may not be desirable in communication-limited settings. To address this, McMahan et al. [52] propose FedAvg, in which clients perform multiple epochs of local training, potentially reducing the number of communication rounds needed for convergence.
|
| 48 |
+
|
| 49 |
+
We focus on a more general framework, FedOpt, introduced by Reddi et al. [62] that uses both client and server optimization. At each round, the server sends its model $x$ to a cohort of clients $C$ of size $M$ . Each client $c _ { k } \in C$ performs $E$ epochs of training using mini-batch SGD with client learning rate $\eta _ { c }$ , producing a local model $x _ { k }$ . Each client $k \in C$ then communicates their client update $\Delta _ { k }$ to the server, where $\Delta _ { k } : = x _ { k } - x$ is the difference between the client’s local model and the server model. The server computes a weighted average $\Delta$ of the client updates, and updates its own model via
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
x ^ { \prime } = { \tt S E R V E R O P T } ( x , \eta _ { s } , \Delta ) ,
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where $\mathbf { S E R V E R O P T } ( x , \eta _ { s } , g )$ is some first-order optimizer, $\eta _ { s }$ is the server learning rate, and $g$ is a gradient estimate. For example, if SERVEROPT is SGD, then SERVE $\mathtt { R O P T } ( x , \eta _ { s } , g ) = x - \eta _ { s } g$ The $\Delta$ in (2) is referred to as a pseudo-gradient [62]. While $\Delta$ may not be an unbiased estimate of $\nabla f$ , it can serve a somewhat comparable role (though as we show in Section 4, there are important distinctions). Full pseudo-code of FedOpt is given in Algorithm 1.
|
| 56 |
+
|
| 57 |
+
# Algorithm 1 FedOpt framework
|
| 58 |
+
|
| 59 |
+
Input: $M , T E , x ^ { 1 }$ , $\eta _ { c } , \eta _ { s }$ , SERVEROPT, $\{ p _ { k } \} _ { k = 1 } ^ { K }$
|
| 60 |
+
for $t = 1 , \cdots , T$ do The server selects a cohort $C _ { t }$ of $M$ clients uniformly at random, without replacement. The server sends $x ^ { t }$ to all clients in $C _ { t }$ . Each client $k \in C _ { t }$ performs $E$ epochs of mini-batch SGD on $f _ { k }$ with step-size $\eta _ { c }$ . After training, each $k \in C _ { t }$ has a local model $\ v x _ { k } ^ { t }$ and sends $\Delta _ { k } ^ { t } = x ^ { t } - x _ { k } ^ { \bar { t } }$ to the server. The server computes a pseudo-gradient $\Delta ^ { t }$ and updates its model via
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\Delta ^ { t } = \frac { \sum _ { k \in C _ { t } } p _ { k } \Delta _ { k } ^ { t } } { \sum _ { k \in C _ { t } } p _ { k } } , x ^ { t + 1 } = { \mathrm { S E R V E R O P T } } ( x _ { t } , \eta _ { s } , \Delta ^ { t } ) .
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
Algorithm 1 generalizes a number of federated learning algorithms, including FedAvg [52], FedAvgM [25], FedAdagrad [62], and FedAdam [62]. These are the cases where SERVEROPT is SGD, SGD with momentum, Adagrad [15, 53], and Adam [33], respectively. FedSGD is realized when SERVEROPT is SGD, $\eta _ { c } = 1$ , $E = 1$ , and each client performs full-batch gradient descent.
|
| 67 |
+
|
| 68 |
+
# 2.1 Experimental Setup
|
| 69 |
+
|
| 70 |
+
We aim to understand how the cohort size $M$ impacts the performance of Algorithm 1. In order to study this, we perform a wide-ranging empirical evaluation using various special cases of Algorithm 1 across multiple datasets, models, and tasks. We discuss the key facets of our experiments below.
|
| 71 |
+
|
| 72 |
+
Datasets, models, and tasks. We use four datasets: CIFAR-100 [35], EMNIST [13], Shakespeare [8], and Stack Overflow [3]. For CIFAR-100, we use the client partitioning proposed by Reddi et al. [62]. The other three datasets have natural client partitions that we use. For EMNIST, the handwritten characters are partitioned by their author. For Shakespeare, speaking lines in Shakespeare plays are
|
| 73 |
+
|
| 74 |
+
Table 1: Dataset statistics.
|
| 75 |
+
|
| 76 |
+
<table><tr><td>DATASET</td><td>TRAIN CLIENTS</td><td>TRAIN EXAMPLES</td><td>TEST CLIENTS</td><td>TEST EXAMPLES</td></tr><tr><td>CIFAR-100</td><td>500</td><td>50,000</td><td>100</td><td>10,000</td></tr><tr><td>EMNIST</td><td>3,400</td><td>671,585</td><td>3,400</td><td>77,483</td></tr><tr><td>SHAKESPEARE</td><td>715</td><td>16,068</td><td>715</td><td>2,356</td></tr><tr><td>STACK OVERFLOW</td><td>342,477</td><td>135,818,730</td><td>204,088</td><td>16,586,035</td></tr></table>
|
| 77 |
+
|
| 78 |
+
partitioned by their speaker. For Stack Overflow, posts on the forum are partitioned by their author.
|
| 79 |
+
The number of clients and examples in the training and test sets are given in Table 1.
|
| 80 |
+
|
| 81 |
+
For CIFAR-100, we train a ResNet-18, replacing batch normalization layers with group normalization (as proposed and empirically validated in federated settings by Hsieh et al. [24]). For EMNIST, we train a convolutional network with two convolutional layers, max-pooling, dropout, and two dense layers. For Shakespeare, we train an RNN with two LSTM layers to perform next-characterprediction. For Stack Overflow, we perform next-word-prediction using an RNN with a single LSTM layer. For full details on the models and datasets, see Appendix A.1.
|
| 82 |
+
|
| 83 |
+
Algorithms. We implement many special cases of Algorithm 1, including FedSGD, FedAvg, FedAvgM, FedAdagrad, and FedAdam. We also develop two novel methods: FedLARS and FedLamb, which are the special cases of Algorithm 1 where SERVEROPT is LARS [71] and Lamb [72], respectively. See Section 5 for the motivation and full details of these algorithms.
|
| 84 |
+
|
| 85 |
+
Implementation and tuning. Unless otherwise specified, in Algorithm 1 clients perform $E = 1$ epochs of training with mini-batch SGD. Their batch size is fixed per-task. We set $p _ { k }$ to be the number of examples in client $k$ ’s dataset. We tune learning rates for all algorithms and models using a held-out validation set: We perform $T = 1 5 0 0$ rounds of training with $M = 5 0 , E = 1$ for each algorithm and model, varying $\eta _ { c } , \eta _ { s }$ over $\{ 1 0 ^ { i } \mid - 3 \leq i \leq 1 \}$ and select the values that maximize the average validation performance over 5 random trials. All other hyperparameters (such as momentum) are fixed. For more details, see Appendix A. We provide open-source implementations of all simulations in TensorFlow Federated $[ 4 ] ^ { 2 }$ . All experiments were conducted using clusters of multi-core CPUs, though our results are independent of wall-clock time and amount of compute resources.
|
| 86 |
+
|
| 87 |
+
Presentation of results. We apply the algorithms above to the tasks listed above with varying cohort sizes. For brevity, we present only a fraction of our results, selecting representative experiments to illustrate large-cohort training phenomena. The full set of experimental results can be found in Appendix B. We run 5 random trials for each experiment, varying the model initialization and which clients are sampled per round. In all subsequent figures, dark lines indicate the mean across the 5 trials, and shaded regions indicate one standard deviation above and below the mean.
|
| 88 |
+
|
| 89 |
+
# 3 Large-Cohort Training Challenges
|
| 90 |
+
|
| 91 |
+
In this section we explore challenges that exist when using large cohorts in federated learning. While some of these challenges mirror issues in large-batch training, others are unique to federated settings. While we provide concrete recommendations for mitigating some of these challenges, our discussion is generally centered around introducing and exploring these challenges in the context of federated learning.
|
| 92 |
+
|
| 93 |
+
# 3.1 Catastrophic Training Failures
|
| 94 |
+
|
| 95 |
+
We first discuss a practical issue unique to large-cohort training. Due to data heterogeneity, the server model $x$ may be misaligned with some client’s loss $f _ { k }$ , in which case $\nabla f _ { k } ( x )$ can blow up and lead to optimization problems. This issue is exacerbated by large cohorts, as we are more likely to sample misaligned clients. To demonstrate this, we applied FedAvg with varying cohort sizes $M$ , using learning rates tuned for $M = 1 0$ . For each $M$ , we performed 5 random trials and recorded whether a catastrophic training failure occurred, in which the training accuracy decreased by a factor of at least $1 / 2$ in a single round.
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
Figure 1: Applying FedAvg to EMNIST with cohort size 200. We plot the train accuracy and norm of the pseudo-gradient for a trial that ran successfully (left), and one that experienced a catastrophic training failure (right). The trials differed only in which clients were randomly sampled each round.
|
| 99 |
+
|
| 100 |
+
On EMNIST, the failure rate increased from $0 \%$ for $M = 1 0$ to $80 \%$ for $M = 8 0 0$ . When failures occurred, we consistently saw a spike in the norm of the pseudo-gradient $\Delta$ (see Figure 1). These trends occurred on all datasets. In order to prevent this spike, we apply clipping to the client updates. We use the adaptive clipping method of [2]. While this technique was originally designed for training with differential privacy, we found that it greatly improved the stability of large-cohort training. Applying FedAvg to EMNIST with adaptive clipping, no catastrophic training failures occurred for any cohort size. We use adaptive clipping in all subsequent experiments. For more details, see Appendix A.3.
|
| 101 |
+
|
| 102 |
+
# 3.2 Diminishing Returns
|
| 103 |
+
|
| 104 |
+
In this section, we show that increasing $M$ in Algorithm 1 can lead to improved convergence, but that such improvements diminish with $M$ . To demonstrate this, we plot the test accuracy of FedAvg and FedSGD across multiple tasks, for varying cohort sizes $M$ . Results for CIFAR-100 and Stack Overflow are given in Figure 2, though we observe similar trends for all tasks (Appendix B.1).
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 2: Test accuracy of FedAvg (top) and FedSGD (bottom), for various cohort sizes $M$ , over the course of 1500 communication rounds.
|
| 108 |
+
|
| 109 |
+
We see that convergence benefits do not scale linearly with cohort size. While increasing $M$ from 1 to 10 can significantly improve convergence, there is generally a threshold after which point increasing $M$ incurs little to no change in convergence. This threshold is typically between $M = 1 0$ and $M = 5 0$ . Interestingly, this seems to be true for both tasks, even though $M = 5 0$ represents $10 \%$ of the training clients for CIFAR-10, but only approximately $0 . 0 1 5 \%$ of the training clients for Stack Overflow. We see comparable results for EMNIST and Shakespeare, as well as for other optimizers, including FedAdam and FedAdagrad. See Appendix B.1 for the full results. In short, we see that increasing $M$ alone can lead to diminishing returns, or even no returns in terms of convergence. This mirrors issues of diminishing returns in large-batch training [14, 19, 51, 64].
|
| 110 |
+
|
| 111 |
+
# 3.3 Generalization Failures
|
| 112 |
+
|
| 113 |
+
Large-batch centralized optimization methods have repeatedly been shown to converge to models with worse generalization ability than models found by small-batch methods [23, 30, 46, 47, 50, 71]. Given the parallels between batch size in centralized learning and cohort size in FL, this raises obvious questions about whether similar issues occur in FL. In order to test this, we applied FedAvg, FedAdam, and FedAdagrad with different cohort sizes to various models. In Figure 3 we plot the train and test accuracy of our models after $T = 1 5 0 0$ communication rounds of FedAvg, FedAdam, and FedAdagrad.
|
| 114 |
+
|
| 115 |
+
We find that generalization issues do occur in FL. For example, consider FedAdam on the CIFAR-100 task. While it attains roughly the same training accuracy for $M \in \{ 5 0 , 1 0 0 , 2 0 0 , 4 0 0 \}$ , we see that the larger cohorts uniformly lead to worse generalization. This resembles the findings of Keskar et al. [30], who show that generalization issues of large-batch training can occur even though the methods reach similar training losses. However, generalization issues do not occur uniformly. It is often optimizer-dependent (as in CIFAR-100) and does not occur on the EMNIST and Stack Overflow datasets (see Appendix B.2). Notably, CIFAR-100 and Shakespeare have many fewer clients overall. Thus, large-cohort training may reduce generalization, especially when the cohort size is large compared to the total number of clients.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 3: The train accuracy and test accuracy of FedAvg, FedAdam, and FedAdagrad on CIFAR-100 (left) and Shakespeare (right) after training for 1500 communication rounds, for varying cohort sizes. The $x$ -axis denotes the percentage of training clients in each cohort.
|
| 119 |
+
|
| 120 |
+
# 3.4 Fairness Concerns
|
| 121 |
+
|
| 122 |
+
One critical issue in FL is fairness across clients, as minimizing (1) may disadvantage some clients [43, 56]. Intuitively, large-cohort training methods may be better suited for ensuring fairness, since a greater fraction of the population is allowed to contribute to the model at each round. As a coarse measure of fairness, we compute percentiles of accuracy of our trained models across test clients. Under many notions of fairness, this would lead to higher accuracy values for smaller percentiles. The percentiles for FedAdam on each task are given in Figure 4.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 4: Accuracy of FedAdam after training for 1500 communication rounds using varying cohort sizes and tasks. The box plots show the 5th, 25th, 50th, 75th, and 95th percentiles of accuracy across test clients.
|
| 126 |
+
|
| 127 |
+
We find that the cohort size seems to affect all percentiles in the same manner. For example, on CIFAR-100, $M = 5 0$ performs better for smaller percentiles and larger percentiles than larger $M$ . This mirrors the CIFAR-100 generalization failures from Section 3.3. By contrast, for Stack Overflow we see increases in all percentiles as we increase $M$ . While the accuracy gains are only slight, they are consistent across percentiles. This suggests a connection between the fairness of a federated training algorithm and the fraction of test clients participating at every round. Notably, increasing $M$ seems to have little effect on the spread between percentiles (such as the difference between the 75th and 25th percentiles) beyond a certain point. See Appendix B.4 for more results.
|
| 128 |
+
|
| 129 |
+
# 3.5 Decreased Data Efficiency
|
| 130 |
+
|
| 131 |
+
Despite issues such as diminishing returns and generalization failures, federated optimization methods can see some benefit from larger cohorts. Large-cohort training, especially with adaptive optimizers, often leads to faster convergence to given accuracy thresholds. For example, in Figure 5, we see that the number of rounds FedAdam requires to reach certain accuracy thresholds generally decreases with the cohort size.
|
| 132 |
+
|
| 133 |
+
While it is tempting to say that large-cohort methods are “faster”, this ignores the practical costs of large-cohort training. Completing a single communication round often requires more resources with larger cohorts. To showcase this, we also plot the accuracy of FedAdam with respect to the number of examples seen in Figure 5. This measures the data-efficiency of large-cohort training, and shows that large cohort-training requires significantly more examples per unit-accuracy.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 5: Test accuracy of FedAdam on Shakespeare (left) and Stack Overflow (right) with various cohort sizes. We plot versus the number of communication rounds and the number of examples processed in total.
|
| 137 |
+
|
| 138 |
+
While data-inefficiency also occurs in large-batch training [51], it is especially important in federated learning. Large-cohort training faces greater limitations on parallelizability due to data-sharing constraints. Worse, in realistic cross-device settings client compute times can scale super-linearly with their amount of data, so clients with more data are more likely to become stragglers [7]. This straggler effect means that data-inefficient algorithms may require longer training times. To demonstrate this, we show in Appendix B.5 that under the probabilistic straggler runtime model from [38], large-cohort training can require significantly more compute time to converge.
|
| 139 |
+
|
| 140 |
+
# 4 Diagnosing Large-Cohort Challenges
|
| 141 |
+
|
| 142 |
+
We now examine the challenges in Section 3, and provide partial explanations for their occurrence. One of the key differences between FedAvg and FedSGD is what the pseudo-gradient $\Delta$ in (1) represents. In FedSGD, $\Delta$ is a stochastic gradient estimate (i.e., $\mathbb { E } [ \Delta ] = { \bar { \nabla } } f$ , where the expectation is over all randomness in a given communication round). For special cases of Algorithm 1 where clients perform multiple local training steps, $\Delta$ is not an unbiased estimator of $\nabla f$ [9, 49, 60]. While increasing the cohort size should reduce the variance of $\Delta$ as an estimator of $\mathbb { E } [ \Delta ]$ , it is unclear what this quantity represents.
|
| 143 |
+
|
| 144 |
+
To better understand $\Delta$ , we plot its norm on Stack Overflow in Figures 6a and 6b. For FedSGD, $\| \Delta \|$ decreases slightly with $M$ , but has high variance. By contrast, for FedAvg larger cohorts lead to smaller norms with little overlap. The decrease in norm obeys an inverse square root rule: Let $\Delta _ { 1 } , \Delta _ { 2 }$ be pseudo-gradients at some round for cohort sizes $M _ { 1 } , M _ { 2 }$ . For FedAvg, $\| \Delta _ { 1 } \| / \| \Delta _ { 2 } \| \approx \sqrt { M _ { 2 } / M _ { 1 } }$ . We use this rule to predict pseudo-gradient norms for FedAvg in Figure 6c. After a small number of rounds, we obtain a remarkably good approximation. To explain this, we plot the average cosine similarity between client updates $\bar { \Delta } _ { k } ^ { t }$ at each round in Figure 6d, with $M = 5 0$ . For FedAvg, the client updates are on average almost orthogonal. This explains Figure 6b, as $\Delta$ is an average of nearly orthogonal vectors. As we show in Appendix B.6, similar results hold for other tasks and optimizers.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 6: The pseudo-gradient norm of FedSGD (a) and FedAvg (b) on Stack Overflow with varying cohort sizes $M$ . We also plot the predicted norm for FedAvg using an inverse square root scaling rule relative to $M = 5 0$ (c) and the average cosine similarity of client updates for $M = 5 0$ (d).
|
| 148 |
+
|
| 149 |
+
Implications for large-cohort training. This near-orthogonality of client updates is key to understanding the challenges in Section 3. The diminishing returns in Section 3.2 occur in part because increasing $M$ leads to smaller updates. This also sheds light on Section 3.5: In large-cohort training, we take an average of many nearly-orthogonal vectors, so each client’s examples contribute little. The decreasing pseudo-gradient norms in Figure 6c also highlights an advantage of methods such as
|
| 150 |
+
|
| 151 |
+
FedAdam and FedAdagrad: Adaptive server optimizers employ a form of normalization that makes them somewhat scale-invariant, compensating for this norm reduction.
|
| 152 |
+
|
| 153 |
+
# 5 Designing Better Methods
|
| 154 |
+
|
| 155 |
+
We now explore an initial set of approaches aimed at improving large-cohort training, drawing inspiration where possible from large-batch training. Our solutions are designed to provide simple baselines for improving large-cohort training. In particular, our methods and experiments are intended to serve as a useful reference for future work in the area, not to fully solve the challenges of largecohort training.
|
| 156 |
+
|
| 157 |
+
# 5.1 Learning Rate Scaling
|
| 158 |
+
|
| 159 |
+
One common technique for large-batch training is to scale the learning rate according to the batch size. Two popular scaling methods are square root scaling [36] and linear scaling [20]. While such techniques have had clear empirical benefit in centralized training, there are many different ways that they could be adapted to federated learning. For example, in Algorithm 1, the client and server optimization both use learning rates that could be scaled.
|
| 160 |
+
|
| 161 |
+
We consider the following scaling method for large-cohort training: We fix the client learning rate, and scale the server learning rate with the cohort size. Such scaling may improve convergence by compensating for the pseudo-gradient norm reduction in Figure 6. We use square root and linear scaling rules: Given a learning rate $\eta _ { s }$ tuned for $M$ , for $M ^ { \prime } \geq M$ we use a learning rate $\eta _ { s } ^ { \prime }$ where
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
\eta _ { s } ^ { \prime } = \frac { \sqrt { M ^ { \prime } } } { \sqrt { M } } \eta _ { s } \mathrm { ~ ( s q u a r e ~ r o o t ~ s c a l i n g ) ~ O R ~ } \eta _ { s } ^ { \prime } = \frac { M ^ { \prime } } { M } \eta _ { s } \mathrm { ~ ( l i n e a r ~ s c a l i n g ) . }
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
We also use a version of the warmup strategy from [20]. For the first $W$ communication rounds, we linearly increase the server learning rate from $\eta _ { s }$ to $\eta _ { s } ^ { \prime }$ . In our experiments, we set $W = 1 0 0$ and use a reference server learning rate $\eta _ { s }$ tuned for $M = 5 0$ .
|
| 168 |
+
|
| 169 |
+
Our experiments show that server learning rate scaling rules have mixed efficacy in large-cohort training. Linear scaling is often too aggressive for federated learning, and caused catastrophic training failures beyond $M = 1 0 0$ even when using adaptive clipping (see Appendix B.7). By contrast, square root scaling did not cause catastrophic training failures. Its performance (Figure 7) varied widely across tasks. For example, it significantly improved train accuracy on Shakespeare, but reduced test accuracy. While it led to small accuracy improvements on Stack Overflow for some cohort sies, it degraded accuracy for the largest cohort sizes. In sum, we find that applying learning rate scaling at the server may not directly improve large-cohort training.
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 7: The train and test accuracy of FedAvg using square root scaling with warmup, versus no scaling. Results are given for Shakespeare (left) and Stack Overflow (right).
|
| 173 |
+
|
| 174 |
+
# 5.2 Layer-wise Adaptivity
|
| 175 |
+
|
| 176 |
+
Another popular technique for large-batch training is layer-wise adaptivity. Methods such as LARS [71] and Lamb [72] use layer-wise adaptive learning rates, which may allow the methods to train faster than SGD with linear scaling and warmup in large-batch settings [71, 72]. We propose two new federated versions of these optimizers, FedLARS and FedLamb. These are special cases of Algorithm 1, where the server uses LARS and Lamb, respectively. Given the difficulties of learning rate scaling above, FedLARS and FedLamb may perform better in large-cohort settings.
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 8: The test accuracy of various methods, including FedLARS and FedLamb, after training for 1500 rounds, for varying cohort sizes and on varying tasks. The $x$ -axis denotes percentage of training clients in each cohort.
|
| 180 |
+
|
| 181 |
+
In Figure 8 we present the test accuracy of various methods, including FedLARS and FedLamb, for varying cohort sizes. In most cases, we see that FedLamb performs comparably to FedAdam for large cohort sizes, but with slightly worse performance in intermediate stages. One notable exception is Stack Overflow, in which FedLamb performs well even for $M = 1$ . As in Section 3.3, FedLamb sees an eventual drop in test accuracy for $M > 1 0 0$ . FedLARS has decidedly mixed performance. While it performs well on CIFAR-10, it does not do well on EMNIST or Shakespeare. While federated layer-wise adaptive algorithms can be better than coordinate-wise adaptive algorithms on certain datasets in some large-cohort settings, our results do not indicate that they are universally better.
|
| 182 |
+
|
| 183 |
+
# 5.3 Dynamic Cohort Sizes
|
| 184 |
+
|
| 185 |
+
As we saw in Section 3.5, large-cohort training can reduce data efficiency. Part of this stems from the fact that larger cohorts may help very little for smaller accuracy thresholds (see Figure 5). In order to improve data efficiency, we may be able to use smaller cohorts in earlier optimization stages, and increase the cohort size over time. This technique is parallel to “dynamic batch size” techniques used in large-batch training [66]. In order to test the efficacy of such techniques in large-cohort training, we start with an initial cohort size of $M = 5 0$ and double the size every 300 rounds up to $M = 8 0 0$ (or the maximum population size if smaller). This results in doubling the cohort size a maximum of 4 times over the 1500 rounds of training we perform. We plot the results for FedAvg and FedAdam on CIFAR-100 and Stack Overflow in Figure 9. See Appendix B.8 for results on all tasks.
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure 9: Test accuracy of FedAvg and FedAdam on Shakespeare (left) and Stack Overflow (right), with respect to the total number of examples processed, using fixed and dynamic cohort sizes.
|
| 189 |
+
|
| 190 |
+
This dynamic strategy attains data efficiency closer to a fixed cohort size of $M = 5 0$ , while still obtaining a final accuracy closer to having used a large fixed cohort size. While our initial findings are promising, we note two important limitations. First, the accuracy of the dynamic strategy is bounded by the minimum and maximum cohort size used; It never attains a better accuracy than $M = 8 0 0$ . Second, the doubling strategy still faces the generalization issues discussed in Section 3.3.
|
| 191 |
+
|
| 192 |
+
# 5.4 Normalized FedAvg
|
| 193 |
+
|
| 194 |
+
While the methods above show promise in resolving some of the issues of large-cohort training, they also introduce extra hyperparameters (such as what type of learning rate scaling to use, or how often to double the cohort size). Hyperparameter tuning can be difficult in federated learning, especially cross-device federated learning [27]. Even adaptive methods like FedAdam introduce a number of new hyperparameters that can be challenging to contend with. We are therefore motivated to design a large-cohort training method that does not introduce any new hyperparameters.
|
| 195 |
+
|
| 196 |
+
Recall that in Section 4, we showed that for FedAvg, the client updates ( $\Delta _ { k } ^ { t }$ in Algorithm 1 and Algorithm 2) are nearly orthogonal in expectation. By averaging nearly orthogonal updates in largecohort training, we get a server pseudo-gradient $\Delta ^ { t }$ that is close to zero. To compensate, we propose a variant of FedAvg where rather than applying SGD to the server pseudo-gradient (as in Algorithm 1), we apply SGD to the normalized server pseudo-gradient. That is, the server updates its model via
|
| 197 |
+
|
| 198 |
+
$$
|
| 199 |
+
x ^ { \prime } = x - \eta _ { s } \Delta / \| \Delta \| _ { 2 } .
|
| 200 |
+
$$
|
| 201 |
+
|
| 202 |
+
This method, which we refer to as normalized FedAvg, is a federated analog of normalized SGD methods used for centralized learning [57]. It introduces no new hyperparameters with respect to Algorithm 1. To test it, we present its training and test accuracy versus cohort size in Figure 10. Notably, we re-use the same learning rates tuned for (unnormalized) FedAvg. For full results, see Appendix B.9.
|
| 203 |
+
|
| 204 |
+

|
| 205 |
+
Figure 10: The test accuracy of FedAvg and the normalized variant of FedAvg, after training for 1500 communication rounds. Results are given for various cohort sizes and tasks.
|
| 206 |
+
|
| 207 |
+
We find that for most cohort sizes and on most tasks, normalized FedAvg achieves better training accuracy for larger cohorts. Thus, this helps mitigate the diminishing returns issue in Section 3.2. We note two important exceptions: for EMNIST, the normalized FedAvg is slightly worse for all cohort sizes. For Stack Overflow, it obtains worse training accuracy for the largest cohort size. However, we see significant improvements on CIFAR-100 and all but the largest cohort sizes for Stack Overflow. We believe that the method therefore exhibits promising results, and may be improved in future work.
|
| 208 |
+
|
| 209 |
+
# 5.5 Hyperparameter tuning and other results.
|
| 210 |
+
|
| 211 |
+
The methods discussed above, including learning rate scaling and layer-wise adaptivity, can require significant tuning to perform well [58]. To date, little work has been paid to how to tune hyperparameters in federated learning. Such work may be vital to obtain optimal performance, especially given our observations in Section 4 and the client-server structure of federated algorithms, which gives rise to many more hyperparameters. In Algorithm 1, tuning could involve the client optimizer, the client batch size, the server optimizer, and the cohort size. In fact, the client batch size is a key hyperparameter. Recall that clients perform $E$ epochs of mini-batch SGD on their local datasets. Fixing $E$ , the batch size dictates the number of local training steps they perform. As we show in Appendix B.10, this number of local steps is critical for achieving maximal performance, and may be necessary to tune according to the cohort size.
|
| 212 |
+
|
| 213 |
+
# 6 Limitations and Future Work
|
| 214 |
+
|
| 215 |
+
In this work we explore the benefits and limitations of large-cohort training in federated learning. As discussed in Sections 3.5 and 5, focusing on the number of communication rounds often obscures the data efficiency of a method. This in turn impacts many metrics important to society, such as total energy consumption or total carbon emissions. While we show that large-cohort training can negatively impact such metrics by reducing data-efficiency (see Section 3.5 and Appendix B.5), a more specialized focus on these issues is warranted. Similarly, we believe that an analysis of fairness in large-cohort settings going beyond Section 3.3 would be beneficial.
|
| 216 |
+
|
| 217 |
+
Future work also involves connecting large-cohort training to other important aspects of federated learning, and continuing to explore connections with growing lines of work in large-batch training. In particular, we wish to see whether noising strategies, especially differential privacy mechanisms, can help overcome the generalization issues of large-cohort training. Personalization may also help mitigate issues of generalization and fairness. Finally, although not a focus of our work, we note that some of the findings above may extend to cross-silo settings, especially if communication restrictions require subsampling clients.
|
| 218 |
+
|
| 219 |
+
References
|
| 220 |
+
[1] Martin Abadi, Andy Chu, Ian Goodfellow, H. Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, page 308–318, 2016.
|
| 221 |
+
[2] Galen Andrew, Om Thakkar, H Brendan McMahan, and Swaroop Ramaswamy. Differentially private learning with adaptive clipping. arXiv preprint arXiv:1905.03871, 2019.
|
| 222 |
+
[3] The TensorFlow Federated Authors. TensorFlow Federated Stack Overflow dataset, 2019. URL https://www.tensorflow.org/federated/api_docs/python/tff/simulation/ datasets/stackoverflow/load_data.
|
| 223 |
+
[4] The TFF Authors. TensorFlow Federated, 2019. URL https://www.tensorflow.org/ federated.
|
| 224 |
+
[5] Debraj Basu, Deepesh Data, Can Karakus, and Suhas Diggavi. Qsparse-local-SGD: Distributed SGD with quantization, sparsification and local computations. In Advances in Neural Information Processing Systems, 2019.
|
| 225 |
+
[6] Andrea Bittau, Úlfar Erlingsson, Petros Maniatis, Ilya Mironov, Ananth Raghunathan, David Lie, Mitch Rudominer, Ushasree Kode, Julien Tinnes, and Bernhard Seefeld. PROCHLO: Strong privacy for analytics in the crowd. In Proceedings of the 26th Symposium on Operating Systems Principles, pages 441–459, 2017.
|
| 226 |
+
[7] Keith Bonawitz, Hubert Eichner, Wolfgang Grieskamp, Dzmitry Huba, Alex Ingerman, Vladimir Ivanov, Chloé Kiddon, Jakub Konecný, Stefano Mazzocchi, Brendan McMahan, Timon ˇ Van Overveldt, David Petrou, Daniel Ramage, and Jason Roselander. Towards federated learning at scale: System design. In Proceedings of Machine Learning and Systems. Proceedings of MLSys, 2019.
|
| 227 |
+
[8] Sebastian Caldas, Peter Wu, Tian Li, Jakub Konecný, H Brendan McMahan, Virginia Smith, and ˇ Ameet Talwalkar. LEAF: A benchmark for federated settings. arXiv preprint arXiv:1812.01097, 2018.
|
| 228 |
+
[9] Zachary Charles and Jakub Konecný. Convergence and accuracy trade-offs in federated learn- ˇ ing and meta-learning. In Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, 2021.
|
| 229 |
+
[10] Wenlin Chen, Samuel Horvath, and Peter Richtarik. Optimal client sampling for federated learning. arXiv preprint arXiv:2010.13723, 2020.
|
| 230 |
+
[11] Albert Cheu, Adam Smith, Jonathan Ullman, David Zeber, and Maxim Zhilyaev. Distributed differential privacy via shuffling. In Annual International Conference on the Theory and Applications of Cryptographic Techniques, pages 375–403, 2019.
|
| 231 |
+
[12] Yae Jee Cho, Jianyu Wang, and Gauri Joshi. Client selection in federated learning: Convergence analysis and power-of-choice selection strategies. arXiv preprint arXiv:2010.01243, 2020.
|
| 232 |
+
[13] Gregory Cohen, Saeed Afshar, Jonathan Tapson, and Andre Van Schaik. EMNIST: Extending MNIST to handwritten letters. In 2017 International Joint Conference on Neural Networks (IJCNN), pages 2921–2926. IEEE, 2017.
|
| 233 |
+
[14] Jeffrey Dean, Greg Corrado, Rajat Monga, Kai Chen, Matthieu Devin, Mark Mao, Marc’aurelio Ranzato, Andrew Senior, Paul Tucker, Ke Yang, Quoc Le, and Andrew Ng. Large scale distributed deep networks. In Advances in Neural Information Processing Systems, 2012.
|
| 234 |
+
[15] John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul):2121–2159, 2011.
|
| 235 |
+
[16] Úlfar Erlingsson, Vitaly Feldman, Ilya Mironov, Ananth Raghunathan, Shuang Song, Kunal Talwar, and Abhradeep Thakurta. Encode, shuffle, analyze privacy revisited: Formalizations and empirical evaluation. arXiv preprint arXiv:2001.03618, 2020.
|
| 236 |
+
[17] Antonious M Girgis, Deepesh Data, Suhas Diggavi, Peter Kairouz, and Ananda Theertha Suresh. Shuffled model of federated learning: Privacy, communication and accuracy trade-offs. arXiv preprint arXiv:2008.07180, 2020.
|
| 237 |
+
[18] Jack Goetz, Kshitiz Malik, Duc Bui, Seungwhan Moon, Honglei Liu, and Anuj Kumar. Active federated learning. arXiv preprint arXiv:1909.12641, 2019.
|
| 238 |
+
[19] Noah Golmant, Nikita Vemuri, Zhewei Yao, Vladimir Feinberg, Amir Gholami, Kai Rothauge, Michael W Mahoney, and Joseph Gonzalez. On the computational inefficiency of large batch sizes for stochastic gradient descent. arXiv preprint arXiv:1811.12941, 2018.
|
| 239 |
+
[20] Priya Goyal, Piotr Dollár, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch SGD: Training ImageNet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
|
| 240 |
+
[21] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
|
| 241 |
+
[22] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Computation, 9 (8):1735–1780, 1997.
|
| 242 |
+
[23] Elad Hoffer, Itay Hubara, and Daniel Soudry. Train longer, generalize better: closing the generalization gap in large batch training of neural networks. In Advances in Neural Information Processing Systems, 2017.
|
| 243 |
+
[24] Kevin Hsieh, Amar Phanishayee, Onur Mutlu, and Phillip Gibbons. The non-IID data quagmire of decentralized machine learning. In Proceedings of the 37th International Conference on Machine Learning, 2020.
|
| 244 |
+
[25] Tzu-Ming Harry Hsu, Hang Qi, and Matthew Brown. Measuring the effects of non-identical data distribution for federated visual classification. arXiv preprint arXiv:1909.06335, 2019.
|
| 245 |
+
[26] Zeou Hu, Kiarash Shaloudegi, Guojun Zhang, and Yaoliang Yu. FedMGDA+: Federated learning meets multi-objective optimization. arXiv preprint arXiv:2006.11489, 2020.
|
| 246 |
+
[27] Peter Kairouz, H. Brendan McMahan, and contributors. Advances and open problems in federated learning. Foundations and Trends $\textsuperscript { \textregistered }$ in Machine Learning, 14(1), 2021. ISSN 1935-8237.
|
| 247 |
+
[28] Sai Praneeth Karimireddy, Martin Jaggi, Satyen Kale, Mehryar Mohri, Sashank J Reddi, Sebastian U Stich, and Ananda Theertha Suresh. Mime: Mimicking centralized stochastic algorithms in federated learning. arXiv preprint arXiv:2008.03606, 2020.
|
| 248 |
+
[29] Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank Reddi, Sebastian Stich, and Ananda Theertha Suresh. SCAFFOLD: Stochastic controlled averaging for federated learning. In Proceedings of the 37th International Conference on Machine Learning, 2020.
|
| 249 |
+
[30] Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. In International Conference on Learning Representations, 2017.
|
| 250 |
+
[31] Ahmed Khaled, Konstantin Mishchenko, and Peter Richtárik. First analysis of local GD on heterogeneous data. arXiv preprint arXiv:1909.04715, 2019.
|
| 251 |
+
[32] Ahmed Khaled, Konstantin Mishchenko, and Peter Richtarik. Tighter theory for local SGD on identical and heterogeneous data. In Proceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics, 2020.
|
| 252 |
+
[33] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015.
|
| 253 |
+
[34] Jakub Konecnˇ y, H Brendan McMahan, Daniel Ramage, and Peter Richtárik. Federated optimiza- \` tion: Distributed machine learning for on-device intelligence. arXiv preprint arXiv:1610.02527, 2016.
|
| 254 |
+
[35] Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 255 |
+
[36] Alex Krizhevsky. One weird trick for parallelizing convolutional neural networks. arXiv preprint arXiv:1404.5997, 2014.
|
| 256 |
+
[37] Yassine Laguel, Krishna Pillutla, Jerôme Malick, and Zaid Harchaoui. A superquantile approach to federated learning with heterogeneous devices. In 2021 55th Annual Conference on Information Sciences and Systems (CISS), 2021.
|
| 257 |
+
[38] Kangwook Lee, Maximilian Lam, Ramtin Pedarsani, Dimitris Papailiopoulos, and Kannan Ramchandran. Speeding up distributed machine learning using codes. IEEE Transactions on Information Theory, 64(3):1514–1529, 2017.
|
| 258 |
+
[39] Daliang Li and Junpu Wang. FedMD: Heterogenous federated learning via model distillation. arXiv preprint arXiv:1910.03581, 2019.
|
| 259 |
+
[40] Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smithy. FedDANE: A federated newton-type method. In 2019 53rd Asilomar Conference on Signals, Systems, and Computers, pages 1227–1231. IEEE, 2019.
|
| 260 |
+
[41] Tian Li, Anit Kumar Sahu, Ameet Talwalkar, and Virginia Smith. Federated learning: Challenges, methods, and future directions. IEEE Signal Processing Magazine, 37(3):50–60, 2020.
|
| 261 |
+
[42] Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smith. Federated optimization in heterogeneous networks. In Proceedings of Machine Learning and Systems 2020, pages 429–450, 2020.
|
| 262 |
+
[43] Tian Li, Maziar Sanjabi, Ahmad Beirami, and Virginia Smith. Fair resource allocation in federated learning. In International Conference on Learning Representations, 2020.
|
| 263 |
+
[44] Wei Li and Andrew McCallum. Pachinko allocation: DAG-structured mixture models of topic correlations. In Proceedings of the 23rd International Conference on Machine Learning, 2006.
|
| 264 |
+
[45] Guanfeng Liang and Ula¸s C Kozat. Tofec: Achieving optimal throughput-delay trade-off of cloud storage using erasure codes. In IEEE INFOCOM 2014-IEEE Conference on Computer Communications, 2014.
|
| 265 |
+
[46] Tao Lin, Sebastian U Stich, Kumar Kshitij Patel, and Martin Jaggi. Don’t use large mini-batches, use local SGD. In International Conference on Learning Representations, 2019.
|
| 266 |
+
[47] Tao Lin, Lingjing Kong, Sebastian Stich, and Martin Jaggi. Extrapolation for large-batch training in deep learning. In Proceedings of the 37th International Conference on Machine Learning, 2020.
|
| 267 |
+
[48] Siyuan Ma, Raef Bassily, and Mikhail Belkin. The power of interpolation: Understanding the effectiveness of SGD in modern over-parametrized learning. In Proceedings of the 35th International Conference on Machine Learning, 2018.
|
| 268 |
+
[49] Grigory Malinovskiy, Dmitry Kovalev, Elnur Gasanov, Laurent Condat, and Peter Richtarik. From local SGD to local fixed-point methods for federated learning. In Proceedings of the 37th International Conference on Machine Learning, 2020.
|
| 269 |
+
[50] Dominic Masters and Carlo Luschi. Revisiting small batch training for deep neural networks. arXiv preprint arXiv:1804.07612, 2018.
|
| 270 |
+
[51] Sam McCandlish, Jared Kaplan, Dario Amodei, and OpenAI Dota Team. An empirical model of large-batch training. arXiv preprint arXiv:1812.06162, 2018.
|
| 271 |
+
[52] Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, volume 54, 2017.
|
| 272 |
+
[53] H. Brendan McMahan and Matthew J. Streeter. Adaptive bound optimization for online convex optimization. In COLT The 23rd Conference on Learning Theory, 2010.
|
| 273 |
+
[54] H. Brendan McMahan, Daniel Ramage, Kunal Talwar, and Li Zhang. Learning differentially private recurrent language models. In International Conference on Learning Representations, 2018.
|
| 274 |
+
[55] Tomáš Mikolov, Martin Karafiát, Lukáš Burget, Jan Cernock ˇ y, and Sanjeev Khudanpur. Recur- \` rent neural network based language model. In Eleventh Annual Conference of the International Speech Communication Association, 2010.
|
| 275 |
+
[56] Mehryar Mohri, Gary Sivek, and Ananda Theertha Suresh. Agnostic federated learning. In Proceedings of the 36th International Conference on Machine Learning, 2019.
|
| 276 |
+
[57] Mor Shpigel Nacson, Jason Lee, Suriya Gunasekar, Pedro Henrique Pamplona Savarese, Nathan Srebro, and Daniel Soudry. Convergence of gradient descent on separable data. In The 22nd International Conference on Artificial Intelligence and Statistics, 2019.
|
| 277 |
+
[58] Zachary Nado, Justin M Gilmer, Christopher J Shallue, Rohan Anil, and George E Dahl. A large batch optimizer reality check: Traditional, generic optimizers suffice across batch sizes. arXiv preprint arXiv:2102.06356, 2021.
|
| 278 |
+
[59] Takayuki Nishio and Ryo Yonetani. Client selection for federated learning with heterogeneous resources in mobile edge. In IEEE International Conference on Communications (ICC), 2019.
|
| 279 |
+
[60] Reese Pathak and Martin J Wainwright. FedSplit: An algorithmic framework for fast federated optimization. In Advances in Neural Information Processing Systems, pages 7057–7066, 2020.
|
| 280 |
+
[61] Matthias Paulik, Matt Seigel, Henry Mason, Dominic Telaar, Joris Kluivers, Rogier van Dalen, Chi Wai Lau, Luke Carlson, Filip Granqvist, Chris Vandevelde, et al. Federated evaluation and tuning for on-device personalization: System design & applications. arXiv preprint arXiv:2102.08503, 2021.
|
| 281 |
+
[62] Sashank J. Reddi, Zachary Charles, Manzil Zaheer, Zachary Garrett, Keith Rush, Jakub Konecný, ˇ Sanjiv Kumar, and Hugh Brendan McMahan. Adaptive federated optimization. In International Conference on Learning Representations, 2021.
|
| 282 |
+
[63] Monica Ribero and Haris Vikalo. Communication-efficient federated learning via optimal client sampling. arXiv preprint arXiv:2007.15197, 2020.
|
| 283 |
+
[64] Christopher J Shallue, Jaehoon Lee, Joseph Antognini, Jascha Sohl-Dickstein, Roy Frostig, and George E Dahl. Measuring the effects of data parallelism on neural network training. Journal of Machine Learning Research, 20:1–49, 2019.
|
| 284 |
+
[65] Elaine Shi, TH Hubert Chan, Eleanor Rieffel, Richard Chow, and Dawn Song. Privacypreserving aggregation of time-series data. In Proc. NDSS, volume 2, pages 1–17, 2011.
|
| 285 |
+
[66] Samuel L. Smith, Pieter-Jan Kindermans, and Quoc V. Le. Don’t decay the learning rate, increase the batch size. In International Conference on Learning Representations, 2018.
|
| 286 |
+
[67] Hongyi Wang, Mikhail Yurochkin, Yuekai Sun, Dimitris Papailiopoulos, and Yasaman Khazaeni. Federated learning with matched averaging. In International Conference on Learning Representations, 2020.
|
| 287 |
+
[68] Yuxin Wu and Kaiming He. Group normalization. In Proceedings of the European Conference on Computer Vision (ECCV), pages 3–19, 2018.
|
| 288 |
+
[69] Haibo Yang, Minghong Fang, and Jia Liu. Achieving linear speedup with partial worker participation in non-IID federated learning. In International Conference on Learning Representations, 2021.
|
| 289 |
+
[70] Dong Yin, Ashwin Pananjady, Max Lam, Dimitris Papailiopoulos, Kannan Ramchandran, and Peter Bartlett. Gradient diversity: a key ingredient for scalable distributed learning. In Proceedings of the Twenty-First International Conference on Artificial Intelligence and Statistics, 2018.
|
| 290 |
+
[71] Yang You, Igor Gitman, and Boris Ginsburg. Large batch training of convolutional networks. arXiv preprint arXiv:1708.03888, 2017.
|
| 291 |
+
|
| 292 |
+
[72] Yang You, Jing Li, Sashank Reddi, Jonathan Hseu, Sanjiv Kumar, Srinadh Bhojanapalli, Xiaodan Song, James Demmel, Kurt Keutzer, and Cho-Jui Hsieh. Large batch optimization for deep learning: Training bert in 76 minutes. In International Conference on Learning Representations, 2020.
|
| 293 |
+
|
| 294 |
+
[73] Xinwei Zhang, Mingyi Hong, Sairaj Dhople, Wotao Yin, and Yang Liu. FedPD: A federated learning framework with optimal rates and adaptivity to non-IID data. arXiv preprint arXiv:2005.11418, 2020.
|
md/train/S1e2agrFvS/S1e2agrFvS.md
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GEOM-GCN: GEOMETRIC GRAPH CONVOLUTIONAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Hongbin Pei1,5,∗ peihb15@mails.jlu.edu.cn
|
| 4 |
+
|
| 5 |
+
Bingzhe Wei2 bwei6@illinois.edu
|
| 6 |
+
|
| 7 |
+
Kevin Chen-Chuan Chang2,3 kcchang@illinois.edu
|
| 8 |
+
|
| 9 |
+
Yu Lei4csylei@comp.polyu.edu.hk
|
| 10 |
+
|
| 11 |
+
Bo Yang1,5,† ybo@jlu.edu.cn
|
| 12 |
+
|
| 13 |
+
1College of Computer Science and Technology, Jilin University, China
|
| 14 |
+
2Department of Electrical and Computer Engineering, University of Illinois at Urbana-Champaign, USA
|
| 15 |
+
3Department of Computer Science, University of Illinois at Urbana-Champaign, USA
|
| 16 |
+
4Department of Computing, Hong Kong Polytechnic University, Hong Kong
|
| 17 |
+
5Key Laboratory of Symbolic Computation and Knowledge Engineering of Ministry of Education, China
|
| 18 |
+
|
| 19 |
+
# ABSTRACT
|
| 20 |
+
|
| 21 |
+
Message-passing neural networks (MPNNs) have been successfully applied to representation learning on graphs in a variety of real-world applications. However, two fundamental weaknesses of MPNNs’ aggregators limit their ability to represent graph-structured data: losing the structural information of nodes in neighborhoods and lacking the ability to capture long-range dependencies in disassortative graphs. Few studies have noticed the weaknesses from different perspectives. From the observations on classical neural network and network geometry, we propose a novel geometric aggregation scheme for graph neural networks to overcome the two weaknesses. The behind basic idea is the aggregation on a graph can benefit from a continuous space underlying the graph. The proposed aggregation scheme is permutation-invariant and consists of three modules, node embedding, structural neighborhood, and bi-level aggregation. We also present an implementation of the scheme in graph convolutional networks, termed GeomGCN, to perform transductive learning on graphs. Experimental results show the proposed Geom-GCN achieved state-of-the-art performance on a wide range of open datasets of graphs.
|
| 22 |
+
|
| 23 |
+
# 1 INTRODUCTION
|
| 24 |
+
|
| 25 |
+
Message-passing neural networks (MPNNs), such as GNN (Scarselli et al., 2008), ChebNet (Defferrard et al., 2016), GG-NN (Li et al., 2016), GCN (Kipf & Welling, 2017), are powerful for learning on graphs with various applications ranging from brain networks to online social network (Gilmer et al., 2017; Wang et al., 2019). In a layer of MPNNs, each node sends its feature representation, a “message”, to the nodes in its neighborhood; and then updates its feature representation by aggregating all “messages” received from the neighborhood. The neighborhood is often defined as the set of adjacent nodes in graph. By adopting permutation-invariant aggregation functions (e.g., summation, maximum, and mean), MPNNs are able to learn representations which are invariant to isomorphic graphs, i.e., graphs that are topologically identical.
|
| 26 |
+
|
| 27 |
+
Although existing MPNNs have been successfully applied in a wide variety of scenarios, two fundamental weaknesses of MPNNs’ aggregators limit their ability to represent graph-structured data. Firstly, the aggregators lose the structural information of nodes in neighborhoods. Permutation invariance is an essential requirement for any graph learning method. To meet it, existing MPNNs adopt permutation-invariant aggregation functions which treat all “messages” from neighborhood as a set. For instance, GCN simply sums the normalized “messages” from all one-hop neighbors (Kipf & Welling, 2017). Such aggregation loses the structural information of nodes in neighborhood because it does not distinguish the “messages” from different nodes. Therefore, after such aggregation, we cannot know which node contributes what to the final aggregated output.
|
| 28 |
+
|
| 29 |
+
Without modeling such structural information, as shown in (Kondor et al., 2018) and (Xu et al., 2019), the existing MPNNs cannot discriminate between certain non-isomorphic graphs. In those cases, MPNNs may map non-isomorphic graphs to the same feature representations, which is obviously not desirable for graph representation learning. Unlike MPNNs, classical convolutional neural networks (CNNs) avoid this problem by using aggregators (i.e., convolutional filters) with a structural receiving filed defined on grids, i.e., a Euclidean space, and are hence able to distinguish each input unit. As shown by our experiments, such structural information often contains clues regarding topology patterns in graph (e.g., hierarchy), and should be extracted and used to learn more discriminating representations for graph-structured data.
|
| 30 |
+
|
| 31 |
+
Secondly, the aggregators lack the ability to capture long-range dependencies in disassortative graphs. In MPNNs, the neighborhood is defined as the set of all neighbors one hop away (e.g., GCN), or all neighbors up to $r$ hops away (e.g., ChebNet). In other words, only messages from nearby nodes are aggregated. The MPNNs with such aggregation are inclined to learn similar representations for proximal nodes in a graph. This implies that they are probably desirable methods for assortative graphs (e.g., citation networks (Kipf & Welling, 2017) and community networks (Chen et al., 2019)) where node homophily holds (i.e., similar nodes are more likely to be proximal, and vice versa), but may be inappropriate to the disassortative graphs (Newman, 2002) where node homophily does not hold. For example, Ribeiro et al. (2017) shows disassortative graphs where nodes of the same class exhibit high structural similarity but are far apart from each other. In such cases, the representation ability of MPNNs may be limited significantly, since they cannot capture the important features from distant but informative nodes.
|
| 32 |
+
|
| 33 |
+
A straightforward strategy to address this limitation is to use a multi-layered architecture so as to receive “messages” from distant nodes. For instance, due to the localized nature of convolutional filters in classical CNNs, a single convolutional layer is similarly limited in its representational ability. CNNs typically use multiple layers connected in a hierarchical manner to learn complex and global representations. However, unlike CNNs, it is difficult for multi-layer MPNNs to learn good representations for disassortative graphs because of two reasons. On one hand, relevant messages from distant nodes are mixed indistinguishably with a large number of irrelevant messages from proximal nodes in multi-layer MPNNs, which implies that the relevant information will be “washed out” and cannot be extracted effectively. On the other hand, the representations of different nodes would become very similar in multi-layer MPNNs, and every node’s representation actually carries the information about the entire graph (Xu et al., 2018).
|
| 34 |
+
|
| 35 |
+
In this paper, we overcome the aforementioned weaknesses of graph neural networks starting from two basic observations: i) Classical neural networks effectively address the similar limitations thanks to the stationarity, locality, and compositionality in a continuous space (Bronstein et al., 2017); ii) The notion of network geometry bridges the gap between continuous space and graph (Hoff et al., 2002; Muscoloni et al., 2017). Network geometry aims to understand networks by revealing the latent continuous space underlying them, which assumes that nodes are sampled discretely from a latent continuous space and edges are established according to their distance. In the latent space, complicated topology patterns in graphs can be preserved and presented as intuitive geometry, such as subgraph (Narayanan et al., 2016), community (Ni et al., 2019), and hierarchy (Nickel & Kiela, 2017; 2018). Inspired by those two observations, we raise an enlightening question about the aggregation scheme in graph neural network.
|
| 36 |
+
|
| 37 |
+
• Can the aggregation on a graph benefit from a continuous latent space, such as using geometry in the space to build structural neighborhoods and capture long-range dependencies in the graph?
|
| 38 |
+
|
| 39 |
+
To answer the above question, we propose a novel aggregation scheme for graph neural networks, termed the geometric aggregation scheme. In the scheme, we map a graph to a continuous latent space via node embedding, and then use the geometric relationships defined in the latent space to build structural neighborhoods for aggregation. Also, we design a bi-level aggregator operating on the structural neighborhoods to update the feature representations of nodes in graph neural networks, which are able to guarantee permutation invariance for graph-structured data. Compared with existing MPNNs, the scheme extracts more structural information of the graph and can aggregate feature representations from distant nodes via mapping them to neighborhoods defined in the latent space.
|
| 40 |
+
|
| 41 |
+
We then present an implementation of the geometric aggregation scheme in graph convolutional networks, which we call Geom-GCN, to perform transductive learning, node classification, on graphs. We design particular geometric relationships to build the structural neighborhood in Euclidean and hyperbolic embedding space respectively. We choose different embedding methods to map the graph to a suitable latent space for different applications, where suitable topology patterns of graph are preserved. Finally, we empirically validate and analyze Geom-GCN on a wide range of open datasets of graphs, and Geom-GCN achieved the state-of-the-art results.
|
| 42 |
+
|
| 43 |
+
In summary, the contribution of this paper is three-fold: i) We propose a novel geometric aggregation scheme for graph neural network, which operates in both graph and latent space, to overcome the aforementioned two weaknesses; ii) We present an implementation of the scheme, Geom-GCN, for transductive learning in graph; iii) We validate and analyze Geom-GCN via extensive comparisons with state-of-the-art methods on several challenging benchmarks.
|
| 44 |
+
|
| 45 |
+
# 2 GEOMETRIC AGGREGATION SCHEME
|
| 46 |
+
|
| 47 |
+
In this section, we start by presenting the geometric aggregation scheme, and then outline its advantages and limitations compared to existing works. As shown in Fig. 1, the aggregation scheme consists of three modules, node embedding (panel A1 and A2), structural neighborhood (panel B1 and B2), and bi-level aggregation (panel C). We will elaborate on them in the following.
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 1: An illustration of the geometric aggregation scheme. A1-A2 The original graph is mapped to a latent continuous space. B1-B2 The structural neighborhood. All adjacent nodes lie in a small region around a center node in B1 for visualization. In B2, the neighborhood in the graph contains all adjacent nodes in graph; the neighborhood in the latent space contains the nodes within the dashed circle whose radius is $\rho$ . The relational operator $\tau$ is illustrated by a colorful $3 \times 3$ grid where each unit is corresponding to a geometric relationship to the red target node. C Bi-level aggregation on the structural neighborhood. Dashed and solid arrows denote the low-level and high-level aggregation, respectively. Blue and green arrows denote the aggregation on the neighborhood in the graph and the latent space, respectively.
|
| 51 |
+
|
| 52 |
+
A. Node embedding. This is a fundamental module which maps the nodes in a graph to a latent continuous space. Let $\mathcal { G } = ( V , E )$ be a graph, where each node $v \in V$ has a feature vector $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { v } }$ and each edge $e \in E$ connects two nodes. Let $f : v z _ { v }$ be a mapping function from a node in graph to a representation vector. Here, $z _ { v } \in \mathbb { R } ^ { d }$ can also be considered as the position of node $v$ in a latent continuous space, and $d$ is the number of dimensions of the space. During the mapping, the structure and properties of graph are preserved and presented as the geometry in the latent space. For instance, hierarchical pattern in graph is presented as the distance to the original in embedding hyperbolic space (Nickel & Kiela, 2017). One can employ various embedding methods to infer the latent space (Cai et al., 2018; Wang et al., 2018).
|
| 53 |
+
|
| 54 |
+
B. Structural neighborhood. Based on the graph and the latent space, we then build a structural neighborhood, $\mathcal { N } ( v ) = ( \{ N _ { g } ( v ) , N _ { s } ( v ) \} , \tau )$ , for the next aggregation. The structural neighborhood consists of a set of neighborhood $\{ N _ { g } ( v ) , N _ { s } ( v ) \}$ , and a relational operator on neighborhoods $\tau$ .
|
| 55 |
+
|
| 56 |
+
The neighborhood in the graph, $N _ { g } ( v ) = \{ u | u \in V , ( u , v ) \in E \}$ , is the set of adjacent nodes of $v$ . The neighborhood in the latent space, $N _ { s } ( v ) = \{ u | u \in V , d ( z _ { u } , z _ { v } ) < \rho \}$ , is the set of nodes from which the distance to $v$ is less than a pre-given parameter $\rho$ . The distance function $d ( \cdot , \cdot )$ depends on the particular metric in the space. Compared with $N _ { g } ( v )$ , $N _ { s } ( v )$ may contain nodes which are far from $v$ in the graph, but have a certain similarity with $v$ , and hence are mapped together with $v$ in the latent space though preserving the similarity. By aggregating on such neighborhood $N _ { s } ( v )$ , the long-range dependencies in disassortative graphs can be captured.
|
| 57 |
+
|
| 58 |
+
The relational operator $\tau$ is a function defined in the latent space. It inputs an ordered position pair $( z _ { v } , z _ { u } )$ of nodes $v$ and $u$ , and outputs a discrete variable $r$ which indicates the geometric relationship from $v$ to $u$ in the latent space. For $u , v \in V$ ,
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\tau : ( z _ { v } , z _ { u } ) r \in R ,
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $R$ is the set of the geometric relationships. According to the particular latent space and application, $r$ can be specified as an arbitrary geometric relationship of interest. A requirement on $\tau$ is that it should guarantee that each ordered position pair has only one geometric relationship. For example, $\tau$ is illustrated in Fig. 1B by a colorful $3 \times 3$ grid in a 2-dimensional Euclidean space, in which each unit is corresponding to a geometric relationship to node $v$ .
|
| 65 |
+
|
| 66 |
+
C. Bi-level aggregation. With the structural neighborhood $\mathcal { N } ( v )$ , we propose a novel bi-level aggregation scheme for graph neural network to update the hidden features of nodes. The bi-level aggregation consists of two aggregation functions and operates in a neural network layer. It can extract effectively structural information of nodes in neighborhoods as well as guarantee permutation invariance for graph. Let $ { \boldsymbol { h } } _ { v } ^ { l }$ be the hidden features of node $v$ at the $l$ -th layer, and $h _ { v } ^ { 0 } \bar { = } x _ { v }$ be the node features. The $l$ -th layer updates $ { \boldsymbol { h } } _ { v } ^ { l }$ for every $v \in V$ by the following.
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\begin{array} { r l r } & { e _ { ( i , r ) } ^ { v , l + 1 } = p ( \{ h _ { u } ^ { l } | u \in N _ { i } ( v ) , \tau ( z _ { v } , z _ { u } ) = r \} ) , \forall i \in \{ g , s \} , \forall r \in R } & { \mathrm { ( L o w \mathrm { - l e v e l } ~ a g g r e g a t i o n ) } } \\ & { m _ { v } ^ { l + 1 } = \underbrace { q } _ { i \in \{ g , s \} , r \in R } ( ( e _ { ( i , r ) } ^ { v , l + 1 } , ( i , r ) ) ) } & { \mathrm { ( H i g h \mathrm { - l e v e l } ~ a g g r e g a t i o n ) } } \\ & { h _ { v } ^ { l + 1 } = \sigma ( W _ { l } \cdot m _ { v } ^ { l + 1 } ) } & { \mathrm { ( N o n \mathrm { - l i n e a r } ~ t r a n s f o r m ) } } \end{array}
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
In the low-level, the hidden features of nodes that are in the same neighborhood $i$ and have the same geometric relationship $r$ are aggregated to a virtual node via the aggregation function $p$ . The features of the virtual node are $e _ { ( i , r ) } ^ { v , l + 1 }$ , and the virtual node is indexed by $( i , r )$ which is corresponding to the combination of a neighborhood $i$ and a relationship $r$ . It is required to adopt a permutation-invariant function for $p$ , such as an $L _ { p }$ -norm (the choice of $p = 1 , 2$ , or $\infty$ results in average, energy, or max pooling). The low level aggregation is illustrated by dashed arrows in Fig. 1C.
|
| 73 |
+
|
| 74 |
+
In the high-level, the features of virtual nodes are further aggregated by function $q$ . The inputs of function $q$ contain both the features of virtual nodes $e _ { ( i , r ) } ^ { v , l + 1 }$ and the identity of virtual nodes $( i , r )$ . That is, $q$ can be a function that take an ordered object as input, e.g., concatenation, to distinguish the features of different virtual nodes, thereby extracting the structural information in the neighborhoods explicitly. The output of high-level aggregation is a vector $m _ { v } ^ { l + 1 }$ . Then new hidden features of $v$ $\boldsymbol { h } _ { v } ^ { ( l + 1 ) }$ , are given by a non-linear transform, wherein $W _ { l }$ is a learnable weight matrix on the $l$ -th layer shared by all nodes, and $\sigma ( \cdot )$ is a non-linear activation function, e.g., a ReLU.
|
| 75 |
+
|
| 76 |
+
Permutation invariance is an essential requirement for aggregators in graph neural networks. Thus, we then prove that the proposed bi-level aggregation, Eq. 1, is able to guarantee invariance for any permutation of nodes. We firstly give a definition for permutation-invariant mapping of graph.
|
| 77 |
+
|
| 78 |
+
Definition 1. Let a bijective function $\psi : V \to V$ be a permutation for nodes, which renames $v \in V$ as $\psi ( v ) \in V$ . Let $V ^ { ' }$ and $E ^ { ' }$ be the node and edge set after a permutation $\psi$ , respectively. $A$ mapping of graph, $\phi ( \mathcal G )$ , is permutation-invariant $i f ,$ given any permutation $\psi$ , we have $\phi ( { \mathcal { G } } ) =$ $\phi ( \boldsymbol { \mathcal { G } } ^ { \prime } ) , \boldsymbol { \mathcal { G } } ^ { \prime } = ( \boldsymbol { V } ^ { \prime } , \boldsymbol { E } ^ { \prime } )$ .
|
| 79 |
+
|
| 80 |
+
Lemma 1. For a composite function $\phi _ { 1 } \circ \phi _ { 2 } ( \mathcal G )$ , if $\phi _ { 2 } ( \mathcal { G } )$ is permutation-invariant, the entire composite function $\phi _ { 1 } \circ \phi _ { 2 } ( \mathcal { G } )$ is permutation-invariant.
|
| 81 |
+
|
| 82 |
+
Proof. Let $\boldsymbol { \mathcal { G } ^ { \prime } }$ be an isomorphic graph of $\mathcal { G }$ after a permutation $\psi$ , as defined in Definition 1. If $\phi _ { 2 } ( \mathcal { G } )$ is permutation-invariant, we have $\phi _ { 2 } ( \mathcal { G } ) = \phi _ { 2 } ( \mathcal { G } ^ { ' } )$ . Therefore, the entire composite function $\phi _ { 1 } \circ \phi _ { 2 } ( \mathcal { G } )$ is permutation-invariant because $\dot { \phi _ { 1 } } \circ \phi _ { 2 } ( \mathcal { G } ) = \phi _ { 1 } \circ \phi _ { 2 } ( \mathcal { G } ^ { ' } )$ . □
|
| 83 |
+
|
| 84 |
+
Theorem 1. Given a graph $\mathcal { G } = ( V , E )$ and its structural neighborhood $\mathcal { N } ( v ) , \forall v \in V$ , the bi-level aggregation, Eq. 1, is a permutation-invariant mapping of graph.
|
| 85 |
+
|
| 86 |
+
Proof. The bi-level aggregation, Eq. 1, is a composite function, where the low-level aggregation is the input of the high-level aggregation. Thus, Eq. 1 is permutation-invariant if the low-level aggregation is permutation-invariant according to Lemma 1.
|
| 87 |
+
|
| 88 |
+
We then prove that the low-level aggregation is permutation-invariant. The low-level aggregation consists of $2 \times | R |$ sub-aggregations, each of which is corresponding to the nodes in a neighborhood $i$ and with a relationship $r$ to $v$ . Firstly, the input of each sub-aggregations is permutation-invariant because both $i \in \{ g , s \}$ and $r \in R$ are determined by the given structural neighborhood $\mathcal { N } ( v ) , \forall v \in V$ , which is constant for any permutation. Secondly, Eq. 1 adopts a permutation-invariant aggregation function $p$ for the sub-aggregations. Thus the low-level aggregation is permutation-invariant. □
|
| 89 |
+
|
| 90 |
+
# 2.1 COMPARISONS TO RELATED WORK
|
| 91 |
+
|
| 92 |
+
We now discuss how the proposed geometric aggregation scheme overcomes the two aforementioned weaknesses, i.e., how it effectively models the structural information and captures the long-range dependencies, in comparison to some closely related works.
|
| 93 |
+
|
| 94 |
+
To overcome the first weakness of MPNNs, i.e., losing the structural information of nodes in neighborhoods, the proposed scheme explicitly models the structural information by exploiting the geometric relationship between nodes in latent space and then extracting the information effectively by using the bi-level aggregations. In contrast, several existing works attempt to learn some implicit structure-like information to distinguish different neighbors when aggregating features. For example, GAT (Velickovic et al., 2017), LGCL (Gao et al., 2018) and GG-NN (Li et al., 2016) learn weights on “messages” from different neighbors by using attention mechanisms and node and/or edge attributes. CCN (Kondor et al., 2018) utilizes a covariance architecture to learn structure-aware representations. The major difference between these works and ours is that we offer an explicit and interpretable way to model the structural information of nodes in neighborhood, with the assistance of the geometry in a latent space. We note that our work is orthogonal with existing methods and thus can be readily incorporated to further improve their performance. In particular, we exploit geometric relationships from the aspect of graph topology, while other methods focus on that of feature representation– the two aspects are complementary.
|
| 95 |
+
|
| 96 |
+
For the second weakness of MPNNs, i.e., lacking the ability to capture long-range dependencies, the proposed scheme models the long-range dependencies in disassortative graphs in two different ways. First of all, the distant (but similar) nodes in the graph can be mapped into a latent-spacebased neighborhood of the target node, and then their useful feature representations can be used for aggregations. This way depends on an appropriate embedding method, which is able to preserve the similarities between the distant nodes and the target node. On the other hand, the structural information enables the method to distinguish different nodes in a graph-based neighborhood (as mentioned above). The informative nodes may have some special geometric relationships to the target node (e.g., a particular angle or distance), whose relevant features hence will be passed to the target node with much higher weights, compared to the uninformative nodes. As a result, the long-range dependencies are captured indirectly through the whole message propagation process in all graph-based neighborhoods. In literature, a recent method JK-Nets (Xu et al., 2018) captures the long-range dependencies by skipping connections during feature aggregations.
|
| 97 |
+
|
| 98 |
+
# 2.1.1 CASE STUDY ON DISTINGUISHING NON-ISOMORPHIC GRAPHS
|
| 99 |
+
|
| 100 |
+
In literature, Kondor et al. (2018) and $\mathrm { X u }$ et al. (2019) construct several non-isomorphic example graphs that cannot be distinguished by the aggregators (e.g., mean and maximum) in existing MPNNs. We present a case study to illustrate how to distinguish the non-isomorphic example graphs once the structural neighborhood is applied. We take two non-isomorphic graphs in ( $\mathrm { { X u } }$ et al., 2019) as an example, where each node has the same feature $a$ and after any mapping $f ( a )$ remains the same across all nodes, as shown in Fig. 2 (left). Then the aggregator, e.g., mean or maximum, over $f ( a )$ remains $f ( a )$ , and hence the final representations of the nodes are the same. That is, mean and maximum aggregators fail to distinguish the two different graphs.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 2: An illustration to distinguish non-isomorphic graphs by proposed structural neighborhood.
|
| 104 |
+
|
| 105 |
+
In contrast, the two graphs become distinguishable once we apply a structural neighborhood in aggregation. With the structural neighborhood, the nodes have different geometric relationships to the center node $V _ { 1 }$ in the structural neighborhood, as shown in Fig. 2 (right). Taking aggregation for $V _ { 1 }$ as an example, we can adopt different mapping function $f _ { r } , r \in R$ to the neighbors with different geometric relationship $r$ to $V _ { 1 }$ . Then, the aggregator in two graph have different inputs, $\{ f _ { 2 } ( a ) , \bar { f _ { 8 } } ( a ) \}$ in the left graph and $\{ f _ { 2 } ( a ) , f _ { 7 } ( a ) , f _ { 9 } ( \bar { a } ) \}$ in the right graph. Finally, the aggregator (mean or maximum) will output different representations for the node $V _ { 1 }$ in the two graphs, thereby distinguishing the topological difference between the two graphs.
|
| 106 |
+
|
| 107 |
+
# 3 GEOM-GCN: AN IMPLEMENTATION OF THE SCHEME
|
| 108 |
+
|
| 109 |
+
In this section, we present Geom-GCN, a specific implementation of the geometric aggregation scheme in graph convolutional networks, to perform transductive learning in graphs. To implement the general aggregation scheme, one needs to specify its three modules: node embedding, structural neighborhood, and bi-level aggregation function.
|
| 110 |
+
|
| 111 |
+
Node embedding is the fundamental. As shown in our experiments, a common embedding method which only preserves the connection and distance pattern in a graph can already benefit the aggregation. For particular applications, one can specify embedding methods to create suitable latent spaces where particular topology patterns (e.g., hierarchy) are preserved. We employ three embedding methods, Isomap (Tenenbaum et al., 2000), Poincare embedding (Nickel & Kiela, 2017), and struc2vec (Ribeiro et al., 2017), which result in three Geom-GCN variants: Geom-GCN-I, GeomGCN-P, and Geom-GCN-S. Isomap is a widely used isometry embedding method, by which distance patterns (lengths of shortest paths) are preserved explicitly in the latent space. Poincare embedding and struc2vec can create particular latent spaces that preserve hierarchies and local structures in a graph, respectively. We use an embedding space of dimension 2 for ease of explanation.
|
| 112 |
+
|
| 113 |
+
The structural neighborhood $\mathcal { N } ( v ) = ( \{ N _ { g } ( v ) , N _ { s } ( v ) \} , \tau )$ of node $v$ includes its neighborhoods in both the graph and latent space. The neighborhood-in-graph $N _ { g } ( v )$ consists of the set of $v$ ’s adjacent nodes in the graph, and the neighborhood-in-latent-space $N _ { s } ( v )$ those nodes whose distances to $v$ are less than a parameter $\rho$ in the latent space. We determine $\rho$ by increasing $\rho$ from zero until the average cardinality of $N _ { s } ( v )$ equals to that of $N _ { g } ( v )$ , $\forall v \in V -$ i.e., when the average neighborhood sizes in the graph and latent spaces are the same. We use Euclidean distance in the Euclidean space. In the hyperbolic space, we approximate the geodesic distance between two nodes via their Euclidean distance in the local tangent plane.
|
| 114 |
+
|
| 115 |
+
Here we simply implement the geometric operator $\tau$ as four relationships of the relative positions between two nodes in a 2-D Euclidean or hyperbolic space. Particularly, the relationship set $R =$ {upper left, upper right, lower left, lower $\mathrm { { r i g h t } } \}$ , and a $\tau ( z _ { v } , z _ { u } )$ is given by Table 1. Note that, we adopt the rectangular coordinate system in the Euclidean space and angular coordinate in the hyperbolic space. By this way, the relationship “upper” indicates the node nearer to the origin and thus lie in a higher level in a hierarchical graph. One can design a more sophisticated operator $\tau$ , such as borrowing the structure of descriptors in manifold geometry (Kokkinos et al., 2012; Monti et al., 2017), thereby preserving more and richer structural information in neighborhood.
|
| 116 |
+
|
| 117 |
+
Table 1: The relationship operator
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\begin{array} { r l } & \frac { \tau ( z _ { v } , z _ { u } ) } { z _ { v } [ 1 ] \le z _ { u } [ 1 ] } \vert \begin{array} { c } { z _ { v } [ 0 ] > z _ { u } [ 0 ] } \\ { \mathrm { ~ \ u p p e r ~ l e f t ~ } \ } \end{array} \vert \begin{array} { c } { z _ { v } [ 0 ] \le z _ { u } [ 0 ] } \\ { \mathrm { ~ \ u p p e r ~ r i g h t ~ } } \end{array} \end{array}
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
Finally, to implement the bi-level aggregation, we adopt the same summation of normalized hidden features as GCN (Kipf & Welling, 2017) as the aggregation function $p$ in the low-level aggregation,
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
e _ { ( i , r ) } ^ { v , l + 1 } = \sum _ { u \in N _ { i } ( v ) } \delta ( \tau ( z _ { v } , z _ { u } ) , r ) ( \deg ( v ) \deg ( u ) ) ^ { \frac { 1 } { 2 } } h _ { u } ^ { l } , \forall i \in \{ g , s \} , \forall r \in R ,
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
where $\deg ( v )$ is the degree of node $v$ in graph, and $\delta ( \cdot , \cdot )$ is a Kronecker delta function that only allows the nodes with relationship r to v to be included. The features of all virtual nodes ev,l+1(i,r) are further aggregated in the high-level aggregation. The aggregation function $q$ is a concatenation $| |$ for all layers except the final layer, which uses mean for its aggregation function. Then, the overall bi-level aggregation of Geom-GCN is given by
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\pmb { h } _ { v } ^ { l + 1 } = \sigma ( \mathbf { W } _ { l } \cdot \bigtriangledown _ { i \in \{ g , s \} } | | _ { \tau \in R } \pmb { e } _ { ( i , r ) } ^ { v , l + 1 } )
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
where we use ReLU as the non-linear activation function $\sigma ( \cdot )$ and $W _ { l }$ is the weight matrix to estimate by backpropagation.
|
| 136 |
+
|
| 137 |
+
# 4 EXPERIMENTS
|
| 138 |
+
|
| 139 |
+
We validate Geom-GCN by comparing Geom-GCN’s performance with the performance of Graph Convolutional Networks (GCN) (Kipf & Welling (2017)) and Graph Attention Networks (GAT) (Velickovic et al. (2017)). Two state-of-the-art graph neural networks, on transductive node-label classification tasks on a wide variety of open graph datasets.
|
| 140 |
+
|
| 141 |
+
# 4.1 DATASETS
|
| 142 |
+
|
| 143 |
+
We utilize nine open graph datasets to validate the proposed Geom-GCN. An overview summary of characteristics of the datasets is given in Table 2.
|
| 144 |
+
|
| 145 |
+
Table 2: Datasets statistics
|
| 146 |
+
|
| 147 |
+
<table><tr><td>Dataset</td><td>Cora</td><td>Cite.</td><td>Pubm.</td><td>Cham.</td><td>Squi.</td><td>Actor</td><td>Corn.</td><td>Texa.</td><td>Wisc.</td></tr><tr><td># Nodes</td><td>2708</td><td>3327</td><td>19717</td><td>2277</td><td>5201</td><td>7600</td><td>183</td><td>183</td><td>251</td></tr><tr><td>#Edges</td><td>5429</td><td>4732</td><td>44338</td><td>36101</td><td>217073</td><td>33544</td><td>295</td><td>309</td><td>499</td></tr><tr><td>#Features</td><td>1433</td><td>3703</td><td>500</td><td>2325</td><td>2089</td><td>931</td><td>1703</td><td>1703</td><td>1703</td></tr><tr><td># Classes</td><td>7</td><td>6</td><td>3</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td></tr></table>
|
| 148 |
+
|
| 149 |
+
Citation networks. Cora, Citeseer, and Pubmed are standard citation network benchmark datasets (Sen et al., 2008; Namata et al., 2012). In these networks, nodes represent papers, and edges denote citations of one paper by another. Node features are the bag-of-words representation of papers, and node label is the academic topic of a paper.
|
| 150 |
+
|
| 151 |
+
WebKB. WebKB1 is a webpage dataset collected from computer science departments of various universities by Carnegie Mellon University. We use the three subdatasets of it, Cornell, Texas, and Wisconsin, where nodes represent web pages, and edges are hyperlinks between them. Node features are the bag-of-words representation of web pages. The web pages are manually classified into the five categories, student, project, course, staff, and faculty.
|
| 152 |
+
|
| 153 |
+
Actor co-occurrence network. This dataset is the actor-only induced subgraph of the film-directoractor-writer network (Tang et al., 2009). Each nodes correspond to an actor, and the edge between two nodes denotes co-occurrence on the same Wikipedia page. Node features correspond to some keywords in the Wikipedia pages. We classify the nodes into five categories in term of words of actor’s Wikipedia.
|
| 154 |
+
|
| 155 |
+
Wikipedia network. Chameleon and squirrel are two page-page networks on specific topics in Wikipedia (Rozemberczki et al., 2019). In those datasets, nodes represent web pages and edges are mutual links between pages. And node features correspond to several informative nouns in the Wikipedia pages. We classify the nodes into five categories in term of the number of the average monthly traffic of the web page.
|
| 156 |
+
|
| 157 |
+
# 4.2 EXPERIMENTAL SETUP
|
| 158 |
+
|
| 159 |
+
As mentioned in Section 3, we construct three Geom-GCN variants by using three embedding methods, Isomap (Geom-GCN-I), Poincare (Geom-GCN-P), and struc2vec (Geom-GCN-S). We specify the dimension of embedding space as two, and use the relationship operator $\tau$ defined in Table 1, and apply mean and concatenation as the low- and high- level aggregation function, respectively.
|
| 160 |
+
|
| 161 |
+
With the structural neighborhood, we perform a hyper-parameter search for all models on validation set. For fairness, the size of search space for each method is the same. The searching hyperparameters include number of hidden unit, initial learning rate, weight decay, and dropout. We fix the number of layer to 2 and use Adam optimizer (Kingma & Ba, 2014) for all models. We use ReLU as the activation function for Geom-GCN and GCN, and ELU for GAT.
|
| 162 |
+
|
| 163 |
+
The final hyper-parameter setting is dropout of $p = 0 . 5$ , initial learning rate of 0.05, patience of 100 epochs, weight decay of $5 E$ -6 (WebKB datasets) or $5 E$ -5 (the other all datasets). In GCN, the number of hidden unit is 16 (Cora), 16 (Citeseer), 64 (Pubmed), 32 (WebKB), 48 (Wikipedia), and 32 (Actor). In Geom-GCN, the number of hidden unit is 8 times as many as the number in GCN since Geom-GCN has 8 virtual nodes. For each attention head in GAT, the number of hidden unit is 8 (Citation networks), 32 (WebKB), 48 (Wikipedia), and 32 (Actor). GAT has 8 attention heads in layer one and 8 (Pubmed) or 1 (the all other datasets) attention heads in layer two.
|
| 164 |
+
|
| 165 |
+
For all graph datasets, we randomly split nodes of each class into $6 0 \%$ , $2 0 \%$ , and $2 0 \%$ for training, validation and testing. With the hyper-parameter setting, we report the average performance of all models on the test sets over 10 random splits.
|
| 166 |
+
|
| 167 |
+
# 4.3 RESULTS AND ANALYSIS
|
| 168 |
+
|
| 169 |
+
Results are summarized in Table 3. The reported numbers denote the mean classification accuracy in percent. In general, Geom-GCN achieves state-of-the-art performance. The best performing method is highlighted. From the results, Isomap embedding (Geom-GCN-I) which only preserves the connection and distance pattern in graph can already benefit the aggregation. We can also specify an embedding method to create a suitable latent space for a particular application (e.g., disassortative graph or hierarchical graph), by doing which a significant performance improvement is achieved (e.g., Geom-GCN-P).
|
| 170 |
+
|
| 171 |
+
Table 3: Mean Classification Accuracy (Percent)
|
| 172 |
+
|
| 173 |
+
<table><tr><td>Dataset</td><td>Cora</td><td>Cite.</td><td>Pubm.</td><td>Cham.</td><td>Squi.</td><td>Actor</td><td>Corn.</td><td>Texa.</td><td>Wisc.</td></tr><tr><td>GCN</td><td>85.77</td><td>73.68</td><td>88.13</td><td>28.18</td><td>23.96</td><td>26.86</td><td>52.70</td><td>52.16</td><td>45.88</td></tr><tr><td>GAT</td><td>86.37</td><td>74.32</td><td>87.62</td><td>42.93</td><td>30.03</td><td>28.45</td><td>54.32</td><td>58.38</td><td>49.41</td></tr><tr><td>Geom-GCN-I</td><td>85.19</td><td>77.99</td><td>90.05</td><td>60.31</td><td>33.32</td><td>29.09</td><td>56.76</td><td>57.58</td><td>58.24</td></tr><tr><td>Geom-GCN-P</td><td>84.93</td><td>75.14</td><td>88.09</td><td>60.90</td><td>38.14</td><td>31.63</td><td>60.81</td><td>67.57</td><td>64.12</td></tr><tr><td>Geom-GCN-S</td><td>85.27</td><td>74.71</td><td>84.75</td><td>59.96</td><td>36.24</td><td>30.30</td><td>55.68</td><td>59.73</td><td>56.67</td></tr></table>
|
| 174 |
+
|
| 175 |
+
# 4.3.1 ABLATION STUDY ON CONTRIBUTIONS FROM TWO NEIGHBORHOODS
|
| 176 |
+
|
| 177 |
+
The proposed Geom-GCN aggregates “message” from two neighborhoods which are defined in graph and latent space respectively. In this section, we present an ablation study to evaluate the contribution from each neighborhood though constructing new Geom-GCN variants with only one neighborhood. For the variants with only neighborhood in graph, we use $" \mathrm { g } ^ { \prime \prime }$ as a suffix of their name (e.g., Geom-GCN-I-g), and use suffix “s” to denote the variants with only neighborhood in latent space (e.g., Geom-GCN-I-s). Here we set GCN as a baseline so that the contribution can be measured via the performance improvement comparing with GCN. The results are summarized in Table 4, where positive improvement is denoted by an up arrow $\uparrow$ and negative improvement by a down arrow $\downarrow$ . The best performing method is highlighted.
|
| 178 |
+
|
| 179 |
+
We also design an index denoted by $\beta$ to measure the homophily in a graph,
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
\beta = { \frac { 1 } { | V | } } \sum _ { v \in V } { \frac { { \mathrm { N u m b e r ~ o f ~ } } v ^ { \cdot } { \mathrm { s ~ n e i g h b o r s ~ w h o ~ h a v e ~ t h e ~ s a m e ~ l a b e l ~ a s ~ } } v } { { \mathrm { N u m b e r ~ o f ~ } } v ^ { \cdot } { \mathrm { s ~ n e i g h b o r s } } } } .
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
A large $\beta$ value implies that the homophily, in term of node label, is strong in a graph, i.e., similar nodes tend to connect together. From Table 4, one can see that assortative graphs (e.g., citation networks) have a much larger $\beta$ than disassortative graphs (e.g., WebKB networks).
|
| 186 |
+
|
| 187 |
+
Table 4 exhibits three interesting patterns: i) Neighborhoods in graph and latent space both benefit the aggregation in most cases; ii) Neighborhoods in latent space have larger contributions in disassortative graphs (with a small $\beta$ ) than assortative ones, which implies relevant information from disconnected nodes is captured effectively by the neighborhoods in latent space; iii) To our surprise, several variants with only one neighborhood (in Table 4) achieve better performances than the variants with two neighborhoods (in Tabel 3). We think the reason is that Geom-GCN with two neighborhoods aggregate more irrelevant “messages” than Geom-GCN with only one neighborhood, and the irrelevant “messages” adversely affect the performance. Thus, we believe an attention mechanism can alleviate this issue– which we will study as future work.
|
| 188 |
+
|
| 189 |
+
Table 4: Mean Classification Accuracy (Percent)
|
| 190 |
+
|
| 191 |
+
<table><tr><td>Dataset B</td><td>Cora 0.83</td><td>Cite. 0.71</td><td>Pumb. 0.79</td><td>Cham. 0.25</td><td>Squi. 0.22</td><td>Actor 0.24</td><td>Corn. 0.11</td><td>Texa. 0.06</td><td>Wisc. 0.16</td></tr><tr><td>Geom-GCN-I-g</td><td>86.26 ↑0.48</td><td>80.64 16.96</td><td>90.72 ↑2.59</td><td>68.00 ↑39.82</td><td>46.01 ↑22.05</td><td>31.96 ↑4.04</td><td>65.40 ↑12.70</td><td>72.51 ↑21.35</td><td>68.23 ↑22.35</td></tr><tr><td>Geom-GCN-I-s</td><td>77.34 ↓8.34</td><td>72.22 ↓1.46</td><td>85.02 ↓3.11</td><td>61.64 ↑33.46</td><td>37.98 ↑14.02</td><td>30.59 ↑2.67</td><td>62.16 ↑9.46</td><td>60.54 ↑8.38</td><td>64.90 ↑19.01</td></tr><tr><td>Geom-GCN-P-g</td><td>86.30 ↑0.52</td><td>75.45 ↑1.76</td><td>88.40 ↑0.27</td><td>63.07 ↑34.89</td><td>38.41 ↑14.45</td><td>31.55 ↑3.63</td><td>64.05 ↑11.35</td><td>73.05 ↑21.89</td><td>69.41 ↑23.53</td></tr><tr><td>Geom-GCN-P-s</td><td>73.14 ↓12.63</td><td>71.65 ↓2.04</td><td>86.95 ↓1.18</td><td>43.20 ↑15.02</td><td>30.47 ↑6.51</td><td>34.59 ↑6.67</td><td>75.40 ↑22.70</td><td>73.51 ↑21.35</td><td>80.39 ↑34.51</td></tr><tr><td>Geom-GCN-S-g</td><td>87.00 ↑1.23</td><td>75.73 ↑2.04</td><td>88.44 ↑0.31</td><td>67.04 ↑38.86</td><td>44.92 ↑20.96</td><td>31.27 ↑3.35</td><td>67.02 ↑14.32</td><td>71.62 ↑19.46</td><td>69.41 ↑23.52</td></tr><tr><td>Geom-GCN-S-s</td><td>66.92 ↓18.85</td><td>66.03 ↓7.65</td><td>79.41 ↓8.72</td><td>49.21 ↑21.03</td><td>31.27 7.31</td><td>30.32 12.40</td><td>62.43 ↑9.73</td><td>63.24 ↑11.08</td><td>64.51 ↑18.63</td></tr></table>
|
| 192 |
+
|
| 193 |
+
# 4.3.2 ANALYSIS OF EMBEDDING SPACE COMBINATION
|
| 194 |
+
|
| 195 |
+
The structural neighborhood in Geom-GCN is very flexible, where one can combine arbitrary embedding space. To study which combination of embedding spaces is desirable, we construct new Geom-GCN variants by adopting neighborhoods built by different embedding space. For the variants adopted Isomap and poincare embedding space to build neighborhood in graph and in latent space respectively, we use Geom-GCN-IP to denote it. The naming rule is the same for other combinations. The performances of all variants are summarized in Table 5. One can observe that several combinations achieve better performance than Geom-GCN with neighborhoods built by only one embedding space (in Table 3); and there are also many combinations that have bad performance. Thus, we think it’s significant future work to design an end-to-end framework that can automatically determine the right embedding spaces for Geom-GCN.
|
| 196 |
+
|
| 197 |
+
Table 5: Mean Classification Accuracy (Percent)
|
| 198 |
+
|
| 199 |
+
<table><tr><td>Dataset</td><td>Cora</td><td>Cite.</td><td>Pubm.</td><td>Cham.</td><td>Squi.</td><td>Actor</td><td>Corn.</td><td>Texa.</td><td>Wisc.</td></tr><tr><td>Geom-GCN-IP</td><td>85.13</td><td>79.41</td><td>90.49</td><td>65.77</td><td>45.49</td><td>31.94</td><td>60.00</td><td>66.49</td><td>62.75</td></tr><tr><td>Geom-GCN-PI</td><td>85.09</td><td>75.08</td><td>85.64</td><td>59.19</td><td>32.65</td><td>29.16</td><td>58.11</td><td>58.11</td><td>58.63</td></tr><tr><td>Geom-GCN-IS</td><td>84.51</td><td>77.83</td><td>88.66</td><td>58.40</td><td>35.29</td><td>29.41</td><td>54.32</td><td>57.57</td><td>57.65</td></tr><tr><td>Geom-GCN-SI</td><td>85.31</td><td>75.50</td><td>85.52</td><td>62.13</td><td>32.57</td><td>28.97</td><td>57.30</td><td>60.00</td><td>55.10</td></tr><tr><td>Geom-GCN-PS</td><td>85.65</td><td>74.84</td><td>84.96</td><td>56.34</td><td>28.27</td><td>29.53</td><td>58.11</td><td>62.43</td><td>60.59</td></tr><tr><td>Geom-GCN-SP</td><td>85.43</td><td>75.71</td><td>88.00</td><td>65.81</td><td>44.53</td><td>31.16</td><td>58.38</td><td>67.84</td><td>65.10</td></tr></table>
|
| 200 |
+
|
| 201 |
+
# 4.3.3 ANALYSIS OF TIME COMPLEXITY
|
| 202 |
+
|
| 203 |
+
Time complexity is very important for graph neural networks because real-world graphs are always very large. In this subsection, we firstly present the theoretical time complexity of Geom-GCN and then compare the real running time of GCN, GAT, and Geom-GCN.
|
| 204 |
+
|
| 205 |
+
To update the representations of one node, the time complexity of Geom-GCN is $O ( n \times m \times 2 | R | )$ where $n$ is the size of input representations, $m$ is the number of hidden unit in non-linear transform for each virtual node (i.e., $( i , r ) )$ , and $2 | R |$ is the number of virtual nodes. Geom-GCN has $2 | R |$ times complexity than GCN whose time complexity is $O ( n \times m )$ .
|
| 206 |
+
|
| 207 |
+
We also compare the real running time (500 epochs) of GCN, GAT, and Geom-GCN on all datasets with the hyper-parameters described in Section 4.2. Results are shown in Fig. 3 (a). One can see that GCN is the fastest, and GAT and Geom-GCN are on the same level. An important future work is to develop accelerating technology so as to solve the scalability of Geom-GCN.
|
| 208 |
+
|
| 209 |
+

|
| 210 |
+
Figure 3: (a) Running time comparison. GCN, GAT, and Geom-GCN both run 500 epochs, and $y$ axis is the log seconds. GCN is the fastest, and GAT and Geom-GCN are on the same level. (b) A visualization for the feature representations of Cora obtained from Geom-GCN-P in a 2-D space. Node colors denote node labels. There are two obvious patterns, nodes with the same label exhibit a spatial clustering and all nodes distribute radially. The radial pattern indicates graph’s hierarchy learned by Poincare embedding.
|
| 211 |
+
|
| 212 |
+
# 4.3.4 VISUALIZATION
|
| 213 |
+
|
| 214 |
+
To study what patterns are learned in the feature representations of node by Geom-GCN, we visualize the feature representations extracted by the last layer of Geom-GCN-P on Cora dataset by mapping it into a 2-D space though t-SNE (Maaten & Hinton, 2008), as shown in Fig. 3 (b). In the figure, the nodes with the same label exhibit spatial clustering, which could shows the discriminative power of Geom-GCN. That all nodes distribute radially in the figure indicates the proposed model learn graph’s hierarchy by Poincare embedding.
|
| 215 |
+
|
| 216 |
+
# 4.4 CONCLUSION AND FUTURE WORK
|
| 217 |
+
|
| 218 |
+
We tackle the two major weaknesses of existing message-passing neural networks over graphs– losses of discriminative structures and long-range dependencies. As our key insight, we bridge a discrete graph to a continuous geometric space via graph embedding. That is, we exploit the principle of convolution: spatial aggregation over a meaningful space– and our approach thus extracts or “recovers” the lost information (discriminative structures and long-range dependencies) in an embedding space from a graph. We proposed a general geometric aggregation scheme and instantiated it with several specific Geom-GCN implementations, and our experiments validated clear advantages over the state-of-the-art. As future work, we will explore techniques for choosing a right embedding method– depending not only on input graphs but also on target applications, such as epidemic dynamic prediction on social contact network (Yang et al., 2017; Pei et al., 2018).
|
| 219 |
+
|
| 220 |
+
# ACKNOWLEDGMENTS
|
| 221 |
+
|
| 222 |
+
We thank the reviewers for their valuable feedback. This work was supported in part by National Natural Science Foundation of China under grant 61876069, 61572226 and 61902145, National Science Foundation IIS 16-19302 and IIS 16-33755, Jilin Province Key Scientific and Technological Research and Development project under grants 20180201067GX and 20180201044GX, University science and technology research plan project of Jilin Province under grants JJKH20190156KJ, Zhejiang University ZJU Research 083650, Futurewei Technologies HF2017060011 and 094013, UIUC OVCR CCIL Planning Grant 434S34, UIUC CSBS Small Grant 434C8U, Advanced Digital Sciences Center Faculty Grant, and China Scholarships Council under scholarship 201806170202. Any opinions, findings, and conclusions or recommendations expressed in this publication are those of the author(s) and do not necessarily reflect the views of the funding agencies.
|
| 223 |
+
|
| 224 |
+
# REFERENCES
|
| 225 |
+
|
| 226 |
+
Michael M Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst. Geometric deep learning: going beyond euclidean data. IEEE Signal Processing Magazine, 34(4):18–42, 2017.
|
| 227 |
+
|
| 228 |
+
Hongyun Cai, Vincent W Zheng, and Kevin Chen-Chuan Chang. A comprehensive survey of graph embedding: Problems, techniques, and applications. IEEE Transactions on Knowledge and Data Engineering, 30(9):1616–1637, 2018.
|
| 229 |
+
|
| 230 |
+
Zhengdao Chen, Lisha Li, and Joan Bruna. Supervised community detection with line graph neural networks. In International Conference on Learning Representations (ICLR), 2019.
|
| 231 |
+
|
| 232 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on ¨ graphs with fast localized spectral filtering. In Advances in neural information processing systems (NeurIPS), pp. 3844–3852, 2016.
|
| 233 |
+
|
| 234 |
+
Hongyang Gao, Zhengyang Wang, and Shuiwang Ji. Large-scale learnable graph convolutional networks. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1416–1424. ACM, 2018.
|
| 235 |
+
|
| 236 |
+
Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning (ICML), pp. 1263–1272, 2017.
|
| 237 |
+
|
| 238 |
+
Peter D Hoff, Adrian E Raftery, and Mark S Handcock. Latent space approaches to social network analysis. Journal of the american Statistical association, 97(460):1090–1098, 2002.
|
| 239 |
+
|
| 240 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv:1412.6980, 2014.
|
| 241 |
+
|
| 242 |
+
Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR), 2017.
|
| 243 |
+
|
| 244 |
+
Iasonas Kokkinos, Michael M Bronstein, Roee Litman, and Alex M Bronstein. Intrinsic shape context descriptors for deformable shapes. In 2012 IEEE Conference on Computer Vision and Pattern Recognition, pp. 159–166. IEEE, 2012.
|
| 245 |
+
|
| 246 |
+
Risi Kondor, Hy Truong Son, Horace Pan, Brandon M. Anderson, and Shubhendu Trivedi. Covariant compositional networks for learning graphs. In International Conference on Learning Representations (ICLR), 2018.
|
| 247 |
+
|
| 248 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard S. Zemel. Gated graph sequence neural networks. In International Conference on Learning Representations (ICLR), 2016.
|
| 249 |
+
|
| 250 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605, 2008.
|
| 251 |
+
|
| 252 |
+
Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodola, Jan Svoboda, and Michael M Bronstein. Geometric deep learning on graphs and manifolds using mixture model cnns. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5115– 5124, 2017.
|
| 253 |
+
|
| 254 |
+
Alessandro Muscoloni, Josephine Maria Thomas, Sara Ciucci, Ginestra Bianconi, and Carlo Vittorio Cannistraci. Machine learning meets complex networks via coalescent embedding in the hyperbolic space. Nature communications, 8(1):1615, 2017.
|
| 255 |
+
|
| 256 |
+
Galileo Namata, Ben London, Lise Getoor, and Bert Huang. Query-driven active surveying for collective classification. In International Workshop on Mining and Learning with Graphs, 2012.
|
| 257 |
+
|
| 258 |
+
Annamalai Narayanan, Mahinthan Chandramohan, Lihui Chen, Yang Liu, and Santhoshkumar Saminathan. subgraph2vec: Learning distributed representations of rooted sub-graphs from large graphs. CoRR, abs/1606.08928, 2016.
|
| 259 |
+
|
| 260 |
+
Mark EJ Newman. Assortative mixing in networks. Physical review letters, 89(20):208701, 2002.
|
| 261 |
+
|
| 262 |
+
Chien-Chun Ni, Yu-Yao Lin, Feng Luo, and Jie Gao. Community detection on networks with ricci flow. Scientific reports, 9(1):9984, 2019.
|
| 263 |
+
|
| 264 |
+
Maximilian Nickel and Douwe Kiela. Poincare embeddings for learning hierarchical representa- ´ tions. In Advances in Neural Information Processing Systems (NeurIPS), pp. 6338–6347, 2017.
|
| 265 |
+
|
| 266 |
+
Maximilian Nickel and Douwe Kiela. Learning continuous hierarchies in the lorentz model of hyperbolic geometry. In International Conference on Machine Learning (ICML), pp. 3776–3785, 2018.
|
| 267 |
+
|
| 268 |
+
Hongbin Pei, Bo Yang, Jiming Liu, and Lei Dong. Group sparse bayesian learning for active surveillance on epidemic dynamics. In Thirty-Second AAAI Conference on Artificial Intelligence, pp. 800–807, 2018.
|
| 269 |
+
|
| 270 |
+
Leonardo Filipe Rodrigues Ribeiro, Pedro H. P. Saverese, and Daniel R. Figueiredo. struc2vec: Learning node representations from structural identity. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 385–394, 2017.
|
| 271 |
+
|
| 272 |
+
Benedek Rozemberczki, Carl Allen, and Rik Sarkar. Multi-scale attributed node embedding. arXiv:1909.13021, 2019.
|
| 273 |
+
|
| 274 |
+
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.
|
| 275 |
+
|
| 276 |
+
Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina Eliassi-Rad. Collective classification in network data. AI magazine, 29(3):93–93, 2008.
|
| 277 |
+
|
| 278 |
+
Jie Tang, Jimeng Sun, Chi Wang, and Zi Yang. Social influence analysis in large-scale networks. In Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 807–816. ACM, 2009.
|
| 279 |
+
|
| 280 |
+
Joshua B Tenenbaum, Vin De Silva, and John C Langford. A global geometric framework for nonlinear dimensionality reduction. science, 290(5500):2319–2323, 2000.
|
| 281 |
+
|
| 282 |
+
Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua \` Bengio. Graph attention networks. CoRR, abs/1710.10903, 2017.
|
| 283 |
+
|
| 284 |
+
Hao Wang, Enhong Chen, Qi Liu, Tong Xu, Dongfang Du, Wen Su, and Xiaopeng Zhang. A united approach to learning sparse attributed network embedding. In IEEE International Conference on Data Mining, pp. 557–566, 2018.
|
| 285 |
+
|
| 286 |
+
Hao Wang, Tong Xu, Qi Liu, Defu Lian, Enhong Chen, Dongfang Du, Han Wu, and Wen Su. MCNE: an end-to-end framework for learning multiple conditional network representations of social network. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1064–1072, 2019.
|
| 287 |
+
|
| 288 |
+
Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In International Conference on Machine Learning (ICML), pp. 5449–5458, 2018.
|
| 289 |
+
|
| 290 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations (ICLR), 2019.
|
| 291 |
+
|
| 292 |
+
Bo Yang, Hongbin Pei, Hechang Chen, Jiming Liu, and Shang Xia. Characterizing and discovering spatiotemporal social contact patterns for healthcare. IEEE Trans. Pattern Anal. Mach. Intell., 39 (8):1532–1546, 2017.
|
md/train/S1exA2NtDB/S1exA2NtDB.md
ADDED
|
@@ -0,0 +1,462 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ES-MAML: SIMPLE HESSIAN-FREE META LEARNING
|
| 2 |
+
|
| 3 |
+
Xingyou Song∗, Yuxiang Yang‡, Krzysztof Choromanski Google Brain {xingyousong,yxyang,kchoro}@google.com
|
| 4 |
+
|
| 5 |
+
Aldo Pacchiano
|
| 6 |
+
UC Berkeley
|
| 7 |
+
pacchiano@berkeley.edu
|
| 8 |
+
|
| 9 |
+
Wenbo $\mathbf { G a o ^ { * } } ^ { \dagger }$ , Yunhao Tang† Columbia University $\{ \mathrm { w g } 2 2 7 9 , \mathrm { y t } 2 5 4 \dot { 1 } \} ($ @columbia.edu
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
We introduce ES-MAML, a new framework for solving the model agnostic meta learning (MAML) problem based on Evolution Strategies (ES). Existing algorithms for MAML are based on policy gradients, and incur significant difficulties when attempting to estimate second derivatives using backpropagation on stochastic policies. We show how ES can be applied to MAML to obtain an algorithm which avoids the problem of estimating second derivatives, and is also conceptually simple and easy to implement. Moreover, ES-MAML can handle new types of non-smooth adaptation operators, and other techniques for improving performance and estimation of ES methods become applicable. We show empirically that ES-MAML is competitive with existing methods and often yields better adaptation with fewer queries.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Meta-learning is a paradigm in machine learning that aims to develop models and training algorithms which can quickly adapt to new tasks and data. Our focus in this paper is on meta-learning in reinforcement learning (RL), where data efficiency is of paramount importance because gathering new samples often requires costly simulations or interactions with the real world. A popular technique for RL meta-learning is Model Agnostic Meta Learning (MAML) (Finn et al., 2017; 2018), a model for training an agent which can quickly adapt to new and unknown tasks by performing one (or a few) gradient updates in the new environment. We provide a formal description of MAML in Section 2.
|
| 18 |
+
|
| 19 |
+
MAML has proven to be successful for many applications. However, implementing and running MAML continues to be challenging. One major complication is that the standard version of MAML requires estimating second derivatives of the RL reward function, which is difficult when using backpropagation on stochastic policies; indeed, the original implementation of MAML (Finn et al., 2017) did so incorrectly, which spurred the development of unbiased higher-order estimators (DiCE, (Foerster et al., 2018)) and further analysis of the credit assignment mechanism in MAML (Rothfuss et al., 2019). Another challenge arises from the high variance inherent in policy gradient methods, which can be ameliorated through control variates such as in T-MAML (Liu et al., 2019), through careful adaptive hyperparameter tuning (Behl et al., 2019; Antoniou et al., 2019) and learning rate annealing (Loshchilov & Hutter, 2017).
|
| 20 |
+
|
| 21 |
+
To avoid these issues, we propose an alternative approach to MAML based on Evolution Strategies (ES), as opposed to the policy gradient underlying previous MAML algorithms. We provide a detailed discussion of ES in Section 3.1. ES has several advantages:
|
| 22 |
+
|
| 23 |
+
1. Our zero-order formulation of ES-MAML (Section 3.2, Algorithm 3) does not require estimating any second derivatives. This dodges the many issues caused by estimating second derivatives with backpropagation on stochastic policies (see Section 2 for details).
|
| 24 |
+
|
| 25 |
+
2. ES is conceptually much simpler than policy gradients, which also translates to ease of implementation. It does not use backpropagation, so it can be run on CPUs only.
|
| 26 |
+
|
| 27 |
+
3. ES is highly flexible with different adaptation operators (Section 3.3).
|
| 28 |
+
|
| 29 |
+
4. ES allows us to use deterministic policies, which can be safer when doing adaptation (Section 4.3). ES is also capable of learning linear and other compact policies (Section 4.2).
|
| 30 |
+
|
| 31 |
+
On the point (4), a feature of ES algorithms is that exploration takes place in the parameter space. Whereas policy gradient methods are primarily motivated by interactions with the environment through randomized actions, ES is driven by optimization in high-dimensional parameter spaces with an expensive querying model. In the context of MAML, the notions of “exploration” and “task identification” have thus been shifted to the parameter space instead of the action space. This distinction plays a key role in the stability of the algorithm. One immediate implication is that we can use deterministic policies, unlike policy gradients which is based on stochastic policies. Another difference is that ES uses only the total reward and not the individual state-action pairs within each episode. While this may appear to be a weakness, since less information is being used, we find in practice that it seems to lead to more stable training profiles.
|
| 32 |
+
|
| 33 |
+
This paper is organized as follows. In Section 2, we give a formal definition of MAML, and discuss related works. In Section 3, we introduce Evolutionary Strategies and show how ES can be applied to create a new framework for MAML. In Section 4, we present numerical experiments, highlighting the topics of exploration (Section 4.1), the utility of compact architectures (Section 4.2), the stability of deterministic policies (Section 4.3), and comparisons against existing MAML algorithms in the few-shot regime (Section 4.4). Additional material can be found in the Appendix.
|
| 34 |
+
|
| 35 |
+
# 2 MODEL AGNOSTIC META LEARNING IN RL
|
| 36 |
+
|
| 37 |
+
We first discuss the original formulation of MAML (Finn et al., 2017). Let $\tau$ be a set of reinforcement learning tasks with common state and action spaces $s , A$ , and $\mathcal { P } ( \mathcal { T } )$ a distribution over $\tau$ . In the standard MAML setting, each task $T _ { i } \in \mathcal { T }$ has an associated Markov Decision Process (MDP) with transition distribution $q _ { i } ( s _ { t + 1 } | s _ { t } , a _ { t } )$ , an episode length $H$ , and a reward function $R _ { T _ { i } }$ which maps a trajectory $\tau = ( s _ { 0 } , a _ { 1 } , . . . , a _ { H - 1 } , s _ { H } )$ to the total reward $R ( \tau )$ . A stochastic policy is a function $\pi : { \mathcal { S } } { \mathcal { P } } ( { \mathcal { A } } )$ which maps states to probability distributions over the action space. A deterministic policy is a function $\pi : { \mathcal { S } } A$ . Policies are typically encoded by a neural network with parameters $\theta$ , and we often refer to the policy $\pi _ { \theta }$ simply by $\theta$ .
|
| 38 |
+
|
| 39 |
+
The MAML problem is to find the so-called MAML point (called also a meta-policy), which is a policy $\theta ^ { * }$ that can be ‘adapted’ quickly to solve an unknown task $T \in { \mathcal { T } }$ by taking a (few)1 policy gradient steps with respect to $T$ . The optimization problem to be solved in training (in its one-shot version) is thus of the form:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\operatorname* { m a x } _ { \theta } J ( \theta ) : = \mathbb { E } _ { T \sim \mathcal { P } ( \mathcal { T } ) } [ \mathbb { E } _ { \tau ^ { \prime } \sim \mathcal { P } _ { \mathcal { T } } ( \tau ^ { \prime } \mid \theta ^ { \prime } ) } [ R _ { T } ( \tau ^ { \prime } ) ] ] ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where: $\theta ^ { \prime } = U ( \theta , T ) = \theta + \alpha \nabla _ { \theta } \mathbb { E } _ { \tau \sim \mathcal { P } _ { T } ( \tau | \theta ) } [ R _ { T } ( \tau ) ]$ is called the adapted policy for a step size $\alpha > 0$ and $\mathcal { P } _ { T } ( \cdot | \eta )$ is a distribution over trajectories given task $T \in { \mathcal { T } }$ and conditioned on the policy parameterized by $\eta$ .
|
| 46 |
+
|
| 47 |
+
Standard MAML approaches are based on the following expression for the gradient of the MAML objective function (1) to conduct training:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\nabla _ { \theta } J ( \theta ) = \mathbb { E } _ { T \sim \mathcal { P } ( \mathcal { T } ) } [ \mathbb { E } _ { r ^ { \prime } \sim \mathcal { P } _ { T } ( \tau ^ { \prime } \mid \theta ^ { \prime } ) } [ \nabla _ { \theta ^ { \prime } } \log \mathcal { P } _ { T } ( \tau ^ { \prime } \mid \theta ^ { \prime } ) R _ { T } ( \tau ^ { \prime } ) \nabla _ { \theta } U ( \theta , T ) ] ] .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
We collectively refer to algorithms based on computing (2) using policy gradients as PG-MAML.
|
| 54 |
+
|
| 55 |
+
Since the adaptation operator $U ( \theta , T )$ contains the policy gradient $\nabla _ { \boldsymbol { \theta } } \mathbb { E } _ { \tau \sim \mathcal { P } _ { T } ( \tau \mid \boldsymbol { \theta } ) } [ R ( \tau ) ]$ , its own gradient $\nabla _ { \boldsymbol { \theta } } U ( \boldsymbol { \theta } , T )$ is second-order in $\theta$ :
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\mathcal { I } _ { \theta } U = \mathbf { I } + \alpha \int \mathcal { P } _ { T } ( \tau | \theta ) \nabla _ { \theta } ^ { 2 } \log \pi _ { \theta } ( \tau ) R _ { T } ( \tau ) d \tau + \alpha \int \mathcal { P } _ { T } ( \tau | \theta ) \nabla _ { \theta } \log \pi _ { \theta } ( \tau ) \nabla _ { \theta } \log \pi _ { \theta } ( \tau ) ^ { T } R _ { T } ( \tau ) d \tau .
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
Correctly computing the gradient (2) with the term (3) using automatic differentiation is known to be tricky. Multiple authors (Foerster et al., 2018; Rothfuss et al., 2019; Liu et al., 2019) have pointed out that the original implementation of MAML incorrectly estimates the term (3), which inadvertently causes the training to lose ‘pre-adaptation credit assignment’. Moreover, even when correctly implemented, the variance when estimating (3) can be extremely high, which impedes training. To improve on this, extensions to the original MAML include ProMP (Rothfuss et al., 2019), which introduces a new low-variance curvature (LVC) estimator for the Hessian, and T-MAML (Liu et al., 2019), which adds control variates to reduce the variance of the unbiased DiCE estimator (Foerster et al., 2018). However, these are not without their drawbacks: the proposed solutions are complicated, the variance of the Hessian estimate remains problematic, and LVC introduces unknown estimator bias.
|
| 62 |
+
|
| 63 |
+
Another issue that arises in PG-MAML is that policies are necessarily stochastic. However, randomized actions can lead to risky exploration behavior when computing the adaptation, especially for robotics applications where the collection of tasks may involve differing system dynamics as opposed to only differing rewards (Yang et al., 2019). We explore this further in Section 4.3.
|
| 64 |
+
|
| 65 |
+
These issues: the difficulty of estimating the Hessian term (3), the typically high variance of $\nabla _ { \boldsymbol { \theta } } J ( \boldsymbol { \theta } )$ for policy gradient algorithms in general, and the unsuitability of stochastic policies in some domains, lead us to the proposed method ES-MAML in Section 3.
|
| 66 |
+
|
| 67 |
+
Aside from policy gradients, there have also been biologically-inspired algorithms for MAML, based on concepts such as the Baldwin effect (Fernando et al., 2018). However, we note that despite the similar naming, methods such as ‘Evolvability ES’ (Gajewski et al., 2019) bear little resemblance to our proposed ES-MAML. The problem solved by our algorithm is the standard MAML, whereas (Gajewski et al., 2019) aims to maximize loosely related notions of the diversity of behavioral characteristics. Moreover, ES-MAML and its extensions we consider are all derived notions such as smoothings and approximations, with rigorous mathematical definitions as stated below.
|
| 68 |
+
|
| 69 |
+
# 3 ES-MAML ALGORITHMS
|
| 70 |
+
|
| 71 |
+
Formulating MAML with ES allows us to employ numerous techniques originally developed for enhancing ES, to MAML. We aim to improve both phases of MAML algorithm: the meta-learning training algorithm, and the efficiency of the adaptation operator.
|
| 72 |
+
|
| 73 |
+
# 3.1 EVOLUTION STRATEGIES METHODS (ES)
|
| 74 |
+
|
| 75 |
+
Evolution Strategies (ES) (Wierstra et al., 2008; 2014), which recently became popular for RL (Salimans et al., 2017), rely on optimizing the smoothing of the blackbox function $f : \mathbb { R } ^ { d } \mathbb { R }$ , which takes as input parameters $\theta \in { \mathbb { R } } ^ { d }$ of the policy and outputs total discounted (expected) reward obtained by an agent applying that policy in the given environment. Instead of optimizing the function $f$ directly, we optimize a smoothed objective. We define the Gaussian smoothing of $F$ as $\tilde { f } _ { \sigma } ( \theta ) = \mathbb { E } _ { \mathbf { g } \sim \mathcal { N } ( 0 , \mathbb { I } _ { d } ) } [ f ( \theta + \sigma \mathbf { g } ) ]$ . The gradient of this smoothed objective, sometimes called an $E S$ -gradient, is given as (see: (Nesterov & Spokoiny, 2017)):
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\nabla _ { \boldsymbol { \theta } } \tilde { f } _ { \sigma } ( \boldsymbol { \theta } ) = \frac { 1 } { \sigma } \mathbb { E } _ { \mathbf { g } \sim \mathcal { N } ( 0 , \mathbf { I } _ { d } ) } [ f ( \boldsymbol { \theta } + \sigma \mathbf { g } ) \mathbf { g } ] .
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
Note that the gradient can be approximated via Monte Carlo (MC) samples:
|
| 82 |
+
|
| 83 |
+
In ES literature the above algorithm is often modified by adding control variates to equation 4 to obtain other unbiased estimators with reduced variance. The forward finite difference (Forward- $F D$ ) estimator (Choromanski et al., 2018) is given by subtracting the current policy value $f ( \theta )$ , yielding $\begin{array} { r } { \nabla _ { \boldsymbol { \theta } } \tilde { f } _ { \sigma } ( \boldsymbol { \theta } ) = \frac { 1 } { \sigma } \mathbb { E } _ { \mathbf { g } \sim \mathcal { N } ( 0 , \mathbf { I } _ { d } ) } [ ( f ( \boldsymbol { \theta } + \sigma \mathbf { g } ) - f ( \boldsymbol { \theta } ) ) \mathbf { g } ] } \end{array}$ . The antithetic estimator (Nesterov & Spokoiny, 2017; Mania et al., 2018) is given by the symmetric difference $\begin{array} { r } { \nabla _ { \theta } \tilde { f } _ { \sigma } ( \theta ) = \frac { 1 } { 2 \sigma } \mathbb { E } _ { \mathbf { g } \sim \mathcal { N } ( 0 , \mathbf { I } _ { d } ) } [ ( f ( \theta + } \end{array}$
|
| 84 |
+
|
| 85 |
+
1 ESGrad $( f , \theta , n , \sigma )$
|
| 86 |
+
|
| 87 |
+
inputs: function $f$ , policy $\theta$ , number of perturbations $n$ , precision $\sigma$ 2 Sample $n$ i.i.d $N ( 0 , I )$ vectors $g _ { 1 } , \ldots , g _ { n }$ ; 3 return $\begin{array} { r } { { \frac { 1 } { n \sigma } } \sum _ { i = 1 } ^ { n } f ( \theta + \sigma g _ { i } ) g _ { i } } \end{array}$ ;
|
| 88 |
+
|
| 89 |
+
Algorithm 1: Monte Carlo ES Gradient
|
| 90 |
+
|
| 91 |
+
$\boldsymbol { \sigma } \mathbf { g } ) - f ( \boldsymbol { \theta } - \boldsymbol { \sigma } \mathbf { g } ) ) \mathbf { g } ]$ . Notice that the variance of the Forward-FD and antithetic estimators is translation-invariant with respect to $f$ . In practice, the Forward-FD or antithetic estimator is usually preferred over the basic version expressed in equation 4.
|
| 92 |
+
|
| 93 |
+
In the next sections we will refer to Algorithm 1 for computing the gradient though we emphasize that there are several other recently developed variants of computing ES-gradients as well as applying them for optimization. We describe some of these variants in Section 3.3 and appendix A.3. A key feature of ES-MAML is that we can directly make use of new enhancements of ES.
|
| 94 |
+
|
| 95 |
+
# 3.2 META-TRAINING MAML WITH ES
|
| 96 |
+
|
| 97 |
+
To formulate MAML in the ES framework, we take a more abstract viewpoint. For each task $T \in { \mathcal { T } }$ , let $f ^ { T } ( \theta )$ be the (expected) cumulative reward of the policy $\theta$ . We treat ${ \bf { \bar { f } } } ^ { T }$ as a blackbox, and make no assumptions on its structure (so the task need not even be MDP, and $f ^ { T }$ may be nonsmooth). The MAML problem is then
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\operatorname* { m a x } _ { \theta } J ( \theta ) : = \mathbb { E } _ { T \sim \mathcal { P } ( T ) } f ^ { T } ( U ( \theta , T ) ) .
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
As argued in (Liu et al., 2019; Rothfuss et al., 2019) (see also Section 2), a major challenge for policy gradient MAML is estimating the Hessian, which is both conceptually subtle and difficult to correctly implement using automatic differentiation. The algorithm we propose obviates the need to calculate any second derivatives, and thus avoids this issue.
|
| 104 |
+
|
| 105 |
+
Suppose that we can evaluate (or approximate) $f ^ { T } ( \theta )$ and $U ( \theta , T )$ , but $f ^ { T }$ and $U ( \cdot , T )$ may be nonsmooth or their gradients may be intractable. We consider the Gaussian smoothing ${ \mathcal { \widetilde { I } } } _ { \sigma }$ of the MAML reward (5), and optimize ${ \mathcal { \widetilde { I } } } _ { \sigma }$ using ES methods. The gradient $\nabla \mathcal { I } _ { \sigma } ( \theta )$ is given by
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\nabla \widetilde { J } _ { \sigma } ( \theta ) = \mathbb { E } _ { T \sim \mathcal { P } ( T ) } \left[ \frac { 1 } { \sigma } f ^ { T } ( U ( \theta + \sigma \mathbf { g } , T ) ) \mathbf { g } \right]
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
and can be estimated by jointly sampling over $( T , \mathbf { g } )$ and evaluating $f ^ { T } ( U ( \theta + \sigma { \bf g } , T ) )$ . This algorithm is specified in Algorithm 2 box, and we refer to it as (zero-order) ES-MAML.
|
| 112 |
+
|
| 113 |
+
Data: initial policy $\theta _ { 0 }$ , meta step size $\beta$ 1 for $t = 0 , 1 , \ldots$ do
|
| 114 |
+
|
| 115 |
+
2 Sample $n$ tasks $T _ { 1 } , \ldots , T _ { n }$ and iid
|
| 116 |
+
vectors ${ \bf g } _ { 1 } , \ldots , { \bf g } _ { n } \sim { \mathcal N } ( 0 , { \bf I } )$ ;
|
| 117 |
+
3 foreach $( T _ { i } , \mathbf { g } _ { i } )$ do
|
| 118 |
+
4 $\begin{array} { r l } { \parallel } & { { } v _ { i } f ^ { T _ { i } } ( U ( \theta _ { t } + \sigma \mathbf { g } _ { i } , T _ { i } ) ) } \end{array}$
|
| 119 |
+
5 end
|
| 120 |
+
6 $\begin{array} { r } { \theta _ { t + 1 } \theta _ { t } + \frac { \beta } { \sigma n } \sum _ { i = 1 } ^ { n } v _ { i } \mathbf { g } _ { i } } \end{array}$
|
| 121 |
+
|
| 122 |
+
7 end
|
| 123 |
+
|
| 124 |
+
Algorithm 2: Zero-Order ES-MAML (general adaptation operator $U ( \cdot , T )$ )
|
| 125 |
+
|
| 126 |
+
Data: initial policy $\theta _ { 0 }$ , adaptation step size $\alpha$ , meta step size $\beta$ , number of queries $K$ for $t = 0 , 1 , \ldots { }$ do
|
| 127 |
+
|
| 128 |
+
Algorithm 3: Zero-Order ES-MAML with ESGradient Adaptation
|
| 129 |
+
|
| 130 |
+
The standard adaptation operator $U ( \cdot , T )$ is the one-step task gradient. Since $f ^ { T }$ is permitted to be nonsmooth in our setting, we use the adaptation operator $U ( \theta , T ) = \theta + \alpha \nabla \widetilde { f } _ { \sigma } ^ { T } ( \theta )$ acting on its smoothing. Expanding the definition of ${ \mathcal { \widetilde { I } } } _ { \sigma }$ , the gradient of the smoothed MAML is then given by
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\nabla \widetilde { J } _ { \sigma } ( \theta ) = \frac { 1 } { \sigma } \mathbb { E } _ { T \sim \mathcal { P } ( \mathcal { T } ) } \left[ f ^ { T } \left( \theta + \sigma \mathbf { g } + \frac { 1 } { \sigma } \mathbb { E } _ { \mathbf { h } \sim \mathcal { N } ( 0 , \mathbf { I } ) } [ f ^ { T } ( \theta + \sigma \mathbf { g } + \sigma \mathbf { h } ) \mathbf { h } ] \right) \mathbf { g } \right] .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
This leads to the algorithm that we specify in Algorithm 3, where the adaptation operator $U ( \cdot , T )$ is itself estimated using the ES gradient in the inner loop.
|
| 137 |
+
|
| 138 |
+
We can also derive an algorithm analogous to PG-MAML by applying a first-order method to the MAML reward $\mathbb { E } _ { T \sim \mathcal { P } ( \mathcal { T } ) } \overline { { \hat { f } ^ { T } } } ( \theta + \alpha \nabla \tilde { f } ^ { T } ( \theta ) )$ directly, without smoothing. The gradient is given by
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\nabla J ( \theta ) = \mathbb { E } _ { T \sim \mathcal { P } ( \mathcal { T } ) } \nabla \widetilde { f } ^ { T } ( \theta + \alpha \nabla \widetilde { f } ^ { T } ( \theta ) ) ( \mathbf { I } + \alpha \nabla ^ { 2 } \widetilde { f } ^ { T } ( \theta ) ) ,
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
which corresponds to equation (3) in (Liu et al., 2019) when expressed in terms of policy gradients. Every term in this expression has a simple Monte Carlo estimator (see Algorithm 4 in the appendix for the MC Hessian estimator). We discuss this algorithm in greater detail in Appendix A.1. This formulation can be viewed as the “MAML of the smoothing”, compared to the “smoothing of the MAML” which is the basis for Algorithm 3. It is the additional smoothing present in equation 6 which eliminates the gradient of $U { \bar { ( } } \cdot , T )$ (and hence, the Hessian of $f ^ { T }$ ). Just as with the Hessian estimation in the original PG-MAML, we find empirically that the MC estimator of the Hessian (Algorithm 4) has high variance, making it often harmful in training. We present some comparisons between Algorithm 3 and Algorithm 5, with and without the Hessian term, in Appendix A.1.2.
|
| 145 |
+
|
| 146 |
+
Note that when $U ( \cdot , T )$ is estimated, such as in Algorithm 3, the resulting estimator for $\nabla \mathcal { \tilde { I } } _ { \sigma }$ will in general be biased. This is similar to the estimator bias which occurs in PG-MAML because we do not have access to the true adapted trajectory distribution. We discuss this further in Appendix A.2.
|
| 147 |
+
|
| 148 |
+
# 3.3 IMPROVING THE ADAPTATION OPERATOR WITH ES
|
| 149 |
+
|
| 150 |
+
Algorithm 2 allows for great flexibility in choosing new adaptation operators. The simplest extension is to modify the ES gradient step: we can draw on general techniques for improving the ES gradient estimator, some of which are described in Appendix A.3. Some other methods are explored below.
|
| 151 |
+
|
| 152 |
+
# 3.3.1 IMPROVED EXPLORATION
|
| 153 |
+
|
| 154 |
+
Instead of using i.i.d Gaussian vectors to estimate the ES gradient in $U ( \cdot , T )$ , we consider samples constructed according to Determinantal Point Processes (DPP). DPP sampling (Kulesza & Taskar, 2012; Wachinger & Golland, 2015) is a method of selecting a subset of samples so as to maximize the ‘diversity’ of the subset. It has been applied to ES to select perturbations $\mathbf { g } _ { i }$ so that the gradient estimator has lower variance (Choromanski et al., 2019a). The sampling matrix determining DPP sampling can also be data-dependent and use information from the meta-training stage to construct a learned kernel with better properties for the adaptation phase. In the experimental section we show that DPP-ES can help in improving adaptation in MAML.
|
| 155 |
+
|
| 156 |
+
# 3.3.2 HILL CLIMBING AND POPULATION SEARCH
|
| 157 |
+
|
| 158 |
+
Nondifferentiable operators $U ( \cdot , T )$ can be also used in Algorithm 2. One particularly interesting example is the local search operator given by $U ( \theta , T ) ~ \stackrel { \scriptscriptstyle = } { = } ~ \mathrm { a r g m a x } \{ f ^ { T } ( \theta ^ { \prime } ) ~ : ~ \| \theta ^ { \prime } ~ \stackrel { \scriptscriptstyle < } { - } ~ \theta \| ~ \le ~ R \}$ , where $R > 0$ is the search radius. That is, $U ( \theta , T )$ selects the best policy for task $T$ which is in a ‘neighborhood’ of $\theta$ . For simplicity, we took the search neighborhood to be the ball $B ( \theta , R )$ here, but we may also use more general neighborhoods of $\theta$ . In general, exactly solving for the maximizer of $f ^ { T }$ over $B ( \theta , R )$ is intractable, but local search can often be well approximated by a hill climbing algorithm. Hill climbing creates a population of candidate policies by perturbing the best observed policy (which is initialized to $\theta$ ), evaluates the reward $f ^ { T }$ for each candidate, and then updates the best observed policy. This is repeated for several iterations. A key property of this search method is that the progress is monotonic, so the reward of the returned policy $U ( \theta , T )$ will always improve over $\theta$ . This does not hold for the stochastic gradient operator, and appears to be beneficial on some difficult problems (see Section 4.1). It has been claimed that hill climbing and other genetic algorithms (Moriarty et al., 1999) are competitive with gradient-based methods for solving difficult RL tasks (Such et al., 2017; Risi & Stanley, 2019). Another stochastic algorithm approximating local search is CMA-ES (Hansen et al., 2003; Igel, 2003; Krause et al., 2016), which performs more sophisticated search by adapting the covariance matrix of the perturbations.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 1: (a) ES-MAML and PG-MAML exploration behavior. (b) Different exploration methods when $K$ is limited $K = 5$ plotted with lighter colors) or large penalties are added on wrong goals.
|
| 162 |
+
|
| 163 |
+
# 4 EXPERIMENTS
|
| 164 |
+
|
| 165 |
+
The performance of MAML algorithms can be evaluated in several ways. One important measure is the performance of the final meta-policy: whether the algorithm can consistently produce metapolicies with better adaptation. In the RL setting, the adaptation of the meta-policy is also a function of the number $K$ of queries used: that is, the number of rollouts used by the adaptation operator $U ( \cdot , T )$ . The meta-learning goal of data efficiency corresponds to adapting with low $K$ . The speed of the meta-training is also important, and can be measured in several ways: the number of metapolicy updates, wall-clock time, and the number of rollouts used for meta-training. In this section, we present experiments which evaluate various aspects of ES-MAML and PG-MAML in terms of data efficiency $( K )$ and meta-training time. Further details of the environments and hyperparameters are given in Appendix A.7.
|
| 166 |
+
|
| 167 |
+
In the RL setting, the amount of information used drastically decreases if ES methods are applied in comparison to the PG setting. To be precise, ES uses only the cumulative reward over an episode, whereas policy gradients use every state-action pair. Intuitively, we may thus expect that ES should have worse sampling complexity because it uses less information for the same number of rollouts. However, it seems that in practice ES often matches or even exceeds policy gradients approaches (Salimans et al., 2017; Mania et al., 2018). Several explanations have been proposed: In the PG case, especially with algorithms such as PPO, the network must optimize multiple additional surrogate objectives such as entropy bonuses and value functions as well as hyperparameters such as the TDstep number. Furthermore, it has been argued that ES is more robust against delayed rewards, action infrequency, and long time horizons (Salimans et al., 2017). These advantages of ES in traditional RL also transfer to MAML, as we show empirically in this section. ES may lead to additional advantages (even if the numbers of rollouts needed in training is comparable with PG ones) in terms of wall-clock time, because it does not require backpropagation, and can be parallelized over CPUs.
|
| 168 |
+
|
| 169 |
+
# 4.1 EXPLORATION: TARGET ENVIRONMENTS
|
| 170 |
+
|
| 171 |
+
In this section, we present two experiments on environments with very sparse rewards where the meta-policy must exhibit exploratory behavior to determine the correct adaptation.
|
| 172 |
+
|
| 173 |
+
The four corners benchmark was introduced in (Rothfuss et al., 2019) to demonstrate the weaknesses of exploration in PG-MAML. An agent on a 2D square receives reward for moving towards a selected corner of the square, but only observes rewards once it is sufficiently close to the target corner, making the reward sparse. An effective exploration strategy for this set of tasks is for the meta-policy $\theta ^ { * }$ to travel in circular trajectories to observe which corner produces rewards; however, for a single policy to produce this exploration behavior is difficult. In Figure 1, we demonstrate the behavior of ES-MAML on the four corners problem. When $K = 2 0$ , the same number of rollouts for adaptation as used in (Rothfuss et al., 2019), the basic version of Algorithm 3 is able to correctly explore and adapt to the task by finding the target corner. Moreover, it does not require any modifications to encourage exploration, unlike PG-MAML. We further used $K = 1 0 , 5$ , which caused the performance to drop. For better performance in this low-information environment, we experimented with two different adaptation operators $U ( \cdot , T )$ in Algorithm 2, which are HC (hill climbing) and DPP-ES. The standard ES gradient is denoted MC.
|
| 174 |
+
|
| 175 |
+
Furthermore, ES-MAML is not limited to “single goal” exploration. We created a more difficult task, six circles, where the agent continuously accrues negative rewards until it reaches six target points to “deactivate” them. Solving this task requires the agent to explore in circular trajectories, similar to the trajectory used by PG-MAML on the four corners task. We visualize the behavior in Figure 2. Observe that ES-MAML with the HC operator is able to develop a strategy to explore the target locations.
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 2: ES-MAML exploration on six circle task $K = 2 0$ ).
|
| 179 |
+
|
| 180 |
+
From Figure 1, we observed that both operators DPP-ES and HC were able to improve exploration performance. We also created a modified task by heavily penalizing incorrect goals, which caused performance to dramatically drop for MC and DPP-ES. This is due to the variance from the MC-gradient, which may result in a adapted policy that accidentally produces large negative rewards or become stuck in local-optima (i.e. refuse to explore due to negative rewards). This is also fixed by the HC adaptation, which enforces non-decreasing rewards during adaptation, allowing the ES-MAML to progress.
|
| 181 |
+
|
| 182 |
+
Additional examples on the classic Navigation-2D task are presented in Appendix A.4, highlighting the differences in exploration behavior between PG-MAML and ES-MAML.
|
| 183 |
+
|
| 184 |
+
# 4.2 GOOD ADAPTATION WITH COMPACT ARCHITECTURES
|
| 185 |
+
|
| 186 |
+
One of the main benefits of ES is due to its ability to train compact linear policies, which can outperform hidden-layer policies. We demonstrate this on several benchmark MAML problems in the HalfCheetah and Ant environments in Figure 3. In contrast, (Finn & Levine, 2018) observed that PG-MAML empirically and theoretically suggested that training with more deeper layers under SGD increases performance. We demonstrate that on the Forward-Backward and Goal-Velocity MAML benchmarks, ES-MAML is consistently able to train successful linear policies faster than deep networks. We also show that, for the Forward-Backward Ant problem, ES-MAML with the new HC operator is the most performant. Using more compact policies also directly speeds up ES-MAML, since fewer perturbations are needed for gradient estimation.
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 3: The Forward-Backward and Goal-Velocity MAML problems. We compare the performance for Linear (L) policies and policies with one hidden layer (H) for different $K$ .
|
| 190 |
+
|
| 191 |
+
# 4.3 DETERMINISTIC POLICIES
|
| 192 |
+
|
| 193 |
+
We find that deterministic policies often produce more stable behaviors than the stochastic ones that are required for PG, where randomized actions in unstable environments can lead to catastrophic outcomes. In PG, this is often mitigated by reducing the entropy bonus, but this has an undesirable side effect of reducing exploration. In contrast, ES-MAML explores in parameter space, which mitigates this issue. To demonstrate this, we use the “Biased-Sensor CartPole” environment from (Yang et al., 2019). This environment has unstable dynamics and sparse rewards, so it requires exploration but is also risky. We see in Figure 4 that ES-MAML is able to stably maintain the maximum reward (500).
|
| 194 |
+
|
| 195 |
+

|
| 196 |
+
Figure 4: Stability comparisons of ES and PG on the Biased-Sensor CartPole and Swimmer, Walker2d environments. (L), (H), and (HH) denote linear, one- and two-hidden layer policies.
|
| 197 |
+
|
| 198 |
+
We also include results in Figure 4 from two other environments, Swimmer and Walker2d, for which it is known that PG is surprisingly unstable, and ES yields better training (Mania et al., 2018). Notice that we again find linear policies (L) outperforming policies with one (H) or two (HH) hidden layers.
|
| 199 |
+
|
| 200 |
+
# 4.4 LOW- $K$ BENCHMARKS
|
| 201 |
+
|
| 202 |
+
For real-world applications, we may be constrained to use fewer queries $K$ than has typically been demonstrated in previous MAML works. Hence, it is of interest to compare how ES-MAML compares to PG-MAML for adapting with very low $K$ .
|
| 203 |
+
|
| 204 |
+
One possible concern is that low $K$ might harm ES in particular because it uses only the cumulative rewards; if for example $K = 5$ , then the ES adaptation gradient can make use of only 5 values. In comparison, PG-MAML uses $K \cdot H$ state-action pairs, so for $K = 5 , H = 2 0 0$ , PG-MAML still has 1000 pieces of information available.
|
| 205 |
+
|
| 206 |
+
However, we find experimentally that the standard ES-MAML (Algorithm 3) remains competitive with PG-MAML even in the low- $K$ setting. In Figure 5, we compare ES-MAML and PG-MAML on the Forward-Backward and Goal-Velocity tasks across four environments (HalfCheetah, Swimmer, Walker2d, Ant) and two model architectures. While PG-MAML can generally outperform ESMAML on the Goal-Velocity task, ES-MAML is similar or better on the Forward-Backward task. Moreover, we observed that for low $K$ , PG-MAML can be highly unstable (note the wide error bars), with some trajectories failing catastrophically, whereas ES-MAML is relatively stable. This is an important consideration in real applications, where the risk of catastrophic failure is undesirable.
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Figure 5: Low $K$ comparisons between ES-MAML and PG-MAML.
|
| 210 |
+
|
| 211 |
+
# 5 CONCLUSION
|
| 212 |
+
|
| 213 |
+
We have presented a new framework for MAML based on ES algorithms. The ES-MAML approach avoids the problems of Hessian estimation which necessitated complicated alterations in PG-MAML and is straightforward to implement. ES-MAML is flexible in the choice of adaptation operators, and can be augmented with general improvements to ES, along with more exotic adaptation operators. In particular, ES-MAML can be paired with nonsmooth adaptation operators such as hill climbing, which we found empirically to yield better exploratory behavior and better performance on sparse-reward environments. ES-MAML performs well with linear or compact deterministic policies, which is an advantage when adapting if the state dynamics are possibly unstable.
|
| 214 |
+
|
| 215 |
+
# REFERENCES
|
| 216 |
+
|
| 217 |
+
Maruan Al-Shedivat, Trapit Bansal, Yura Burda, Ilya Sutskever, Igor Mordatch, and Pieter Abbeel. Continuous adaptation via meta-learning in nonstationary and competitive environments. In International Conference on Learning Representations, 2018.
|
| 218 |
+
|
| 219 |
+
Antreas Antoniou, Harrison Edwards, and Amos J. Storkey. How to train your MAML. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019.
|
| 220 |
+
|
| 221 |
+
Harkirat Singh Behl, Atilim Gunes Baydin, and Philip H. S. Torr. Alpha MAML: adaptive model-¨ agnostic meta-learning. CoRR, abs/1905.07435, 2019.
|
| 222 |
+
|
| 223 |
+
Jose Blanchet, Donald Goldfarb, Garud Iyengar, Fengpei Li, and Chaoxu Zhou. Unbiased simulation for optimizing stochastic function compositions. arXiv:1711.07564, 2017.
|
| 224 |
+
|
| 225 |
+
Krzysztof Choromanski, Mark Rowland, Vikas Sindhwani, Richard E. Turner, and Adrian Weller. Structured evolution with compact architectures for scalable policy optimization. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmassan,¨ Stockholm, Sweden, July 10-15, 2018, pp. 969–977, 2018.
|
| 226 |
+
|
| 227 |
+
Krzysztof Choromanski, Aldo Pacchiano, Jack Parker-Holder, and Yunhao Tang. Structured monte carlo sampling for nonisotropic distributions via determinantal point processes. arXiv:1905.12667, 2019a.
|
| 228 |
+
|
| 229 |
+
Krzysztof Choromanski, Aldo Pacchiano, Jack Parker-Holder, and Yunhao Tang. From complexity to simplicity: Adaptive es-active subspaces for blackbox optimization. NeurIPS 2019, 2019b.
|
| 230 |
+
|
| 231 |
+
Krzysztof Choromanski, Aldo Pacchiano, Jack Parker-Holder, Yunhao Tang, Deepali Jain, Yuxiang Yang, Atil Iscen, Jasmine Hsu, and Vikas Sindhwani. Provably robust blackbox optimization for reinforcement learning. accepted to CoRL 2019, 2019c.
|
| 232 |
+
|
| 233 |
+
Chrisantha Fernando, Jakub Sygnowski, Simon Osindero, Jane Wang, Tom Schaul, Denis Teplyashin, Pablo Sprechmann, Alexander Pritzel, and Andrei A. Rusu. Meta-learning by the baldwin effect. In Proceedings of the Genetic and Evolutionary Computation Conference Companion, GECCO 2018, Kyoto, Japan, July 15-19, 2018, pp. 109–110, 2018. doi: 10.1145/3205651.3205763. URL https://doi.org/10.1145/3205651.3205763.
|
| 234 |
+
|
| 235 |
+
Chelsea Finn and Sergey Levine. Meta-learning and universality: Deep representations and gradient descent can approximate any learning algorithm. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings, 2018.
|
| 236 |
+
|
| 237 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pp. 1126–1135, 2017.
|
| 238 |
+
|
| 239 |
+
Chelsea Finn, Kelvin Xu, and Sergey Levine. Probabilistic model-agnostic meta-learning. In Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, 3-8 December 2018, Montreal, Canada. ´ , pp. 9537– 9548, 2018.
|
| 240 |
+
|
| 241 |
+
Jakob Foerster, Gregory Farquhar, Maruan Al-Shedivat, Tim Rocktaschel, Eric Xing, and Shimon ¨ Whiteson. DiCE: The infinitely differentiable Monte Carlo estimator. In Proceedings of the 35th International Conference on Machine Learning, volume 80, pp. 1529–1538, 2018.
|
| 242 |
+
|
| 243 |
+
Alexander Gajewski, Jeff Clune, Kenneth O. Stanley, and Joel Lehman. Evolvability ES: scalable and direct optimization of evolvability. In Proceedings of the Genetic and Evolutionary Computation Conference, GECCO 2019, Prague, Czech Republic, July 13-17, 2019, pp. 107–115, 2019. doi: 10.1145/3321707.3321876. URL https://doi.org/10.1145/3321707. 3321876.
|
| 244 |
+
|
| 245 |
+
Nikolaus Hansen, Sibylle Muller, and Petros Koumoutsakos. Reducing the time complexity of ¨ the derandomized evolution strategy with covariance matrix adaptation (cma-es). Evolutionary Computation, 11(1):1–18, 2003.
|
| 246 |
+
|
| 247 |
+
Mingyi Hong, Zhi-Quan Luo, and Meisam Razaviyayn. Convergence analysis of alternating direction method of multipliers for a family of nonconvex problems. SIAM Journal on Optimization, 26(1):337–364, 2016.
|
| 248 |
+
|
| 249 |
+
Christian Igel. Neuroevolution for reinforcement learning using evolution strategies. In 2003 IEEE Congress on Evolutionary Computation, 2003.
|
| 250 |
+
|
| 251 |
+
Oswin Krause, Didac Arbones, and Christian Igel. Cma-es with optimal covariance update and storage complexity. Advances in Neural Information Processing Systems, pp. 370–378, 2016.
|
| 252 |
+
|
| 253 |
+
Alex Kulesza and Ben Taskar. Determinantal point processes for machine learning. Foundations and Trends in Machine Learning, 5(2-3):123–286, 2012.
|
| 254 |
+
|
| 255 |
+
Hao Liu, Richard Socher, and Caiming Xiong. Taming MAML: efficient unbiased metareinforcement learning. In Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, pp. 4061–4071, 2019.
|
| 256 |
+
|
| 257 |
+
Ilya Loshchilov and Frank Hutter. SGDR: stochastic gradient descent with warm restarts. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings, 2017.
|
| 258 |
+
|
| 259 |
+
Horia Mania, Aurelia Guy, and Benjamin Recht. Simple random search provides a competitive approach to reinforcement learning. Advances in Neural Information Processing Systems 31, pp. 1800–1809, 2018.
|
| 260 |
+
|
| 261 |
+
David Moriarty, Alan Schultz, and John Grefenstette. Evolutionary algorithms for reinforcement learning. Journal of Artificial Intelligence Research, 11:241–276, 1999.
|
| 262 |
+
|
| 263 |
+
Yurii Nesterov and Vladimir Spokoiny. Random gradient-free minimization of convex functions. Foundations of Computational Mathematics, 17(2):527–566, 2017.
|
| 264 |
+
|
| 265 |
+
Sebastian Risi and Kenneth Stanley. Deep neuroevolution of recurrent and discrete world models. arXiv:1906.08857, 2019.
|
| 266 |
+
|
| 267 |
+
Jonas Rothfuss, Dennis Lee, Ignasi Clavera, Tamim Asfour, and Pieter Abbeel. Promp: Proximal meta-policy search. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019.
|
| 268 |
+
|
| 269 |
+
Tim Salimans, Jonathan Ho, Xi Chen, Szymon Sidor, and Ilya Sutskever. Evolution strategies as a scalable alternative to reinforcement learning. arXiv:1703.03864, 2017.
|
| 270 |
+
|
| 271 |
+
Felipe Petroski Such, Vashisht Madhavan, Edoardo Conti, Joel Lehman, Kenneth Stanley, and Jeff Clune. Deep neuroevolution: Genetic algorithms are a competitive alternative for training deep neural networks for reinforcement learning. arXiv:1712.06567, 2017.
|
| 272 |
+
|
| 273 |
+
Christian Wachinger and Polina Golland. Sampling from determinantal point processes for scalable manifold learning. Information Processing for Medical Imaging, pp. 687–698, 2015.
|
| 274 |
+
|
| 275 |
+
Mengdi Wang, Ji Liu, and Xingyuan Fang. Accelerating stochastic composition optimization. Journal of Machine Learning Research, 18:1–23, 2017.
|
| 276 |
+
|
| 277 |
+
Daan Wierstra, Tom Schaul, Jan Peters, and Jurgen Schmidhuber. Natural evolution strategies. In ¨ 2008 IEEE Congress on Evolutionary Computation, pp. 3381–3387, 2008.
|
| 278 |
+
|
| 279 |
+
Daan Wierstra, Tom Schaul, Tobias Glasmachers, Yi Sun, Jan Peters, and Jurgen Schmidhuber. ¨ Natural evolution strategies. Journal of Machine Learning Research, 15:949–980, 2014.
|
| 280 |
+
|
| 281 |
+
Yuxiang Yang, Ken Caluwaerts, Atil Iscen, Jie Tan, and Chelsea Finn. Norml: No-reward meta learning. In Proceedings of the 18th International Conference on Autonomous Agents and MultiAgent Systems, AAMAS ’19, Montreal, QC, Canada, May 13-17, 2019, pp. 323–331, 2019.
|
| 282 |
+
|
| 283 |
+
# A.1 FIRST-ORDER ES-MAML
|
| 284 |
+
|
| 285 |
+
# A.1.1 ALGORITHM
|
| 286 |
+
|
| 287 |
+
Suppose that we first apply Gaussian smoothing to the task rewards and then form the MAML problem, so we have $J ( \tilde { \theta } ) = \mathbb { E } _ { T \sim \mathcal { P } ( T ) } \tilde { f } ^ { T } ( U ( \theta , \hat { T } ) )$ . The function $J$ is then itself differentiable, and we can directly apply first-order methods to it. The classical case where $U ( \theta , T ) = \theta + \alpha \nabla \widetilde { f } ^ { T } ( \theta )$ yields the gradient
|
| 288 |
+
|
| 289 |
+
$$
|
| 290 |
+
\nabla J ( \theta ) = \mathbb { E } _ { T \sim \mathcal { P } ( \mathcal { T } ) } \nabla \widetilde { f } ^ { T } ( \theta + \alpha \nabla \widetilde { f } ^ { T } ( \theta ) ) ( \mathbf { I } + \alpha \nabla ^ { 2 } \widetilde { f } ^ { T } ( \theta ) ) .
|
| 291 |
+
$$
|
| 292 |
+
|
| 293 |
+
This is analogous to formulas obtained in e.g (Liu et al., 2019) for the policy gradient MAML. We can then approximate this gradient as an input to stochastic first-order methods. An example with standard SGD is shown in Algorithm 5.
|
| 294 |
+
|
| 295 |
+
Data: initial policy $\theta _ { 0 }$ , adaptation step size $\alpha$
|
| 296 |
+
meta step size $\beta$ , number of queries $K$
|
| 297 |
+
1 for $t = 0 , 1 , \ldots { } \mathbf { d }$ o
|
| 298 |
+
2 Sample $n$ tasks $T _ { 1 } , \ldots , T _ { n }$ ;
|
| 299 |
+
3 foreach $T _ { i }$ do
|
| 300 |
+
4 $\mathbf { d } _ { 1 } ^ { ( i ) } \mathrm { E S G R A D } ( f ^ { T _ { i } } , \theta _ { t } , K , \sigma )$ ;
|
| 301 |
+
5 $\mathbf { H } ^ { ( i ) } \gets \mathrm { E S H E S S } ( f ^ { T _ { i } } , \theta _ { t } , K , \sigma ) ;$
|
| 302 |
+
6 $\boldsymbol { \theta } _ { t } ^ { ( i ) } \boldsymbol { \theta } _ { t } + \alpha \cdot \mathbf { d } _ { i }$ ;
|
| 303 |
+
7 $\mathbf { d } _ { 2 } ^ { ( i ) } \gets \mathrm { E S G R A D } ( f ^ { T _ { i } } , \theta _ { t } ^ { ( i ) } , K , \sigma ) ;$ ;
|
| 304 |
+
8 end
|
| 305 |
+
9 $\begin{array} { r } { \theta _ { t + 1 } \theta _ { t } + \frac { \beta } { n } \sum _ { i = 1 } ^ { n } ( \mathbf { I } + \alpha \mathbf { H } ^ { ( i ) } ) \mathbf { d } _ { 2 } ^ { ( i ) } ; } \end{array}$
|
| 306 |
+
10 end
|
| 307 |
+
|
| 308 |
+
1 ESHess $( f , \theta , n , \sigma )$ inputs: function $f$ , policy $\theta$ , number of perturbations $n$ , precision $\sigma$
|
| 309 |
+
2 3 $\textstyle v \gets { \frac { 1 } { n } } \sum _ { i = 1 } ^ { n } f ( \theta + \sigma \mathbf { g } _ { i } )$ $\mathcal { N } ( 0 , \bf { I } )$ ors ; $\mathbf { g } _ { 1 } , \ldots , \mathbf { g } _ { n }$ ;
|
| 310 |
+
4 $\begin{array} { r } { \mathbf { H } ^ { 0 } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } f ( \theta + \sigma \mathbf { g } _ { i } ) \mathbf { g } _ { i } \mathbf { g } _ { i } ^ { T } } \end{array}$ ;
|
| 311 |
+
5 return $\begin{array} { r } { \frac { 1 } { \sigma ^ { 2 } } ( \mathbf { H } ^ { 0 } - v \cdot \mathbf { I } ) } \end{array}$ ; Algorithm 4: Monte Carlo ES Hessian
|
| 312 |
+
|
| 313 |
+
Algorithm 5: First Order ES-MAML
|
| 314 |
+
|
| 315 |
+
A central problem, as discussed in (Rothfuss et al., 2019; Liu et al., 2019) is the estimation of $\nabla ^ { 2 } \widetilde { f } ^ { T } ( \theta )$ . However, a simple expression exists for this object in the ES setting; it can be shown that
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\nabla ^ { 2 } \widetilde { f } ^ { T } ( \theta ) = \frac { 1 } { \sigma ^ { 2 } } ( \mathbb { E } _ { \mathbf { h } \sim \mathcal { N } ( 0 , \mathbf { I } ) } [ f ^ { T } ( \theta + \sigma \mathbf { h } ) \mathbf { h } \mathbf { h } ^ { T } ] - \widetilde { f } ^ { T } ( \theta ) \mathbf { I } ] .
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
Note that for the vector $\mathbf { h }$ , $\mathbf { h } ^ { T }$ is the transpose (and unrelated to tasks $T$ ). A basic MC estimator is shown in Algorithm 4. Given an independent estimator for $\nabla \widetilde { f } ^ { T } ( \theta + \alpha \nabla \widetilde { f } ^ { T } ( \theta ) )$ , we can then take the product to obtain an estimator for $\nabla J$ .
|
| 322 |
+
|
| 323 |
+
# A.1.2 EXPERIMENTS WITH FIRST-ORDER ES-MAML
|
| 324 |
+
|
| 325 |
+
Unlike zero-order ES-MAML (Algorithm 3), the first-order ES-MAML explicitly builds an approximation of the Hessian of $f ^ { T }$ . Given the literature on PG-MAML, we expect that estimating the Hessian $\nabla ^ { 2 } \widetilde { f } ^ { T } ( \theta )$ with Algorithm 4 without any control variates may have high variance. We compare two variants of first-order ES-MAML:
|
| 326 |
+
|
| 327 |
+
1. The full version (FO-Hessian) specified in Algorithm 5.
|
| 328 |
+
2. The ‘first-order approximation’ (FO-NoHessian) which ignores the term $\mathbf { I } + \alpha \nabla ^ { 2 } \widetilde { f } ^ { T } ( \theta )$ and approximates the MAML gradient as $\mathbb { E } _ { T \sim \mathcal { P } ( \mathcal { T } ) } \nabla \widetilde { f } ^ { T } ( \theta + \alpha \nabla \widetilde { f } ^ { T } ( \theta ) )$ . This is equivalent to setting $\mathbf { H } ^ { ( i ) } = 0$ in line 5 of Algorithm 5.
|
| 329 |
+
|
| 330 |
+
The results on the four corner exploration problem (Section 4.1) and the Forward-Backward Ant, using Linear policies, are shown in Figure A1. On Forward-Backward Ant, FO-NoHessian actually outperformed FO-Hessian, so the inclusion of the Hessian term actually slowed convergence. On the four corners task, both FO-Hessian and FO-NoHessian have large error bars, and FO-Hessian slightly outperforms FO-NoHessian.
|
| 331 |
+
|
| 332 |
+
There is conflicting evidence as to whether the same phenomenon occurs with PG-MAML; (Finn et al., 2017, §5.2) found that on supervised learning MAML, omitting Hessian terms is competitive but slightly worse than the full PG-MAML, and does not report comparisons with and without the Hessian on RL MAML. (Rothfuss et al., 2019; Liu et al., 2019) argue for the importance of the second-order terms in proper credit assignment, but use heavily modified estimators (LVC, control variates; see Section 2) in their experiments, so the performance is not directly comparable to the ‘naive’ estimator in Algorithm 4. Our interpretation is that Algorithm 4 has high variance, making the Hessian estimates inaccurate, which can slow training on relatively ‘easier’ tasks like ForwardBackward walking but possibly increase the exploration on four corners.
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure A1: Comparisons between the FO-Hessian and FO-NoHessian variants of Algorithm 5.
|
| 336 |
+
|
| 337 |
+
We also compare FO-NoHessian against Algorithm 3 on Forward-Backward HalfCheetah and Ant in Figure A2. In this experiment, the two methods ran on servers with different number of workers available, so we measure the score by the total number of rollouts. We found that FO-NoHessian was slightly faster than Algorithm 3 when measured by rollouts on Ant, but FO-NoHessian had notably poor performance when the number of queries was low $K = 5$ ) on HalfCheetah, and failed to reach similar scores as the others even after running for many more rollouts.
|
| 338 |
+
|
| 339 |
+

|
| 340 |
+
Figure A2: Comparisons between FO-NoHessian and Algorithm 3, by rollouts
|
| 341 |
+
|
| 342 |
+
# A.2 HANDLING ESTIMATOR BIAS
|
| 343 |
+
|
| 344 |
+
Since the adapted policy $U ( \theta , T )$ generally cannot be evaluated exactly, we cannot easily obtain unbiased estimates of $f ^ { T } ( U ( \theta , T ) )$ . This problem arises for both PG-MAML and ES-MAML.
|
| 345 |
+
|
| 346 |
+
We consider PG-MAML first as an example. In PG-MAML, the adaptation operator is $U ( \theta , T ) =$ $\theta + \alpha \nabla _ { \theta } \mathbb { E } _ { \tau \sim \mathcal { P } _ { T } ( \tau \mid \theta ) } [ R ( \tau ) ]$ . In general, we can only obtain an estimate of $\nabla _ { \boldsymbol { \theta } } \mathbb { E } _ { \tau \sim \mathcal { P } _ { T } ( \tau \mid \boldsymbol { \theta } ) } [ R ( \tau ) ]$ and not its exact value. However, the MAML gradient is given by
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\nabla _ { \theta } J ( \theta ) = \mathbb { E } _ { \mathcal { T } \sim \mathcal { P } ( \mathcal { T } ) } [ \mathbb { E } _ { r ^ { \prime } \sim \mathcal { P } _ { \mathcal { T } } ( \tau ^ { \prime } \mid \theta ^ { \prime } ) } [ \nabla _ { \theta ^ { \prime } } \log \mathcal { P } _ { \mathcal { T } } ( \tau ^ { \prime } \mid \theta ^ { \prime } ) R ( \tau ^ { \prime } ) \nabla _ { \theta } U ( \theta , T ) ] ]
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
which requires exact sampling from the adapted trajectories $\tau ^ { \prime } \sim \mathcal { P } _ { T } ( \tau ^ { \prime } | U ( \theta , T ) )$ . Since this is a nonlinear function of $U ( \theta , T )$ , we cannot obtain unbiased estimates of $\nabla J ( \theta )$ by sampling $\tau ^ { \prime }$ generated by an estimate of $U ( \theta , T )$ .
|
| 353 |
+
|
| 354 |
+
In the case of ES-MAML, the adaptation operator is $U ( \theta , T ) = \theta + \underline { { { \alpha } } } \nabla \widetilde { f } ( \theta , T ) = \mathbb { E } _ { \mathbf { h } } u ( \theta , T ; \mathbf { h } )$ for $\mathbf { h } \sim { \mathcal { N } } ( 0 , I )$ , where $\begin{array} { r } { u ( \theta , T ; { \bf h } ) = \dot { \theta } + \frac { \alpha } { \sigma } f ^ { \top } ( \theta + \sigma { \bf h } ) { \bf h } } \end{array}$ . Clearly, $f ^ { T } ( u ( \theta , T ; \mathbf { h } ) )$ is not an unbiased estimator of $f ^ { \mathcal { T } } ( U ( \theta , T ) )$ .
|
| 355 |
+
|
| 356 |
+
We may question whether using an unbiased estimator of $f ^ { T } ( U ( \theta , T ) )$ is likely to improve performance. One natural strategy is to reformulate the objective function so as to make the desired estimator unbiased. This happens to be the case for the algorithm E-MAML (Al-Shedivat et al., 2018), which treats the adaptation operator as an explicit function of $K$ sampled trajectories and “moves the expectation outside”. That is, we now have an adaptation operator $U ( \theta , T ; \tau _ { 1 } , \dots , \tau _ { K } )$ , and the objective function becomes
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
\mathbb { E } _ { T } [ \mathbb { E } _ { \tau _ { 1 } , \dots , \tau _ { k } \sim \mathcal { P } _ { T } ( \tau | \theta ) } f ^ { T } ( U ( \theta , T ; \tau _ { 1 } , \dots , \tau _ { K } ) ) ]
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
An unbiased estimator for the E-MAML gradient can be obtained by sampling only from $\tau \sim$ ${ \mathcal { P } } _ { T } ( \tau | \theta )$ (Al-Shedivat et al., 2018). However, it has been argued that by doing so, E-MAML does not properly assign credit to the pre-adaptation policy (Rothfuss et al., 2019). Thus, this particular mathematical strategy seems to be disadvantageous for RL.
|
| 363 |
+
|
| 364 |
+
The problem of finding estimators for function-of-expectations $f ( \mathbb { E } X )$ is difficult and while general unbiased estimation methods exist (Blanchet et al., 2017), they are often complicated and suffer from high variance. In the context of MAML, ProMP compares the low variance curvature (LVC) estimator (Rothfuss et al., 2019), which is biased, against the unbiased DiCE estimator (Foerster et al., 2018), for the Hessian term in the MAML gradient, and found that the lower variance of LVC produced better performance than DiCE. Alternatively, control variates can be used to reduce the variance of the DiCE estimator, which is the approach followed in (Liu et al., 2019).
|
| 365 |
+
|
| 366 |
+
In the ES framework, the problem can also be formulated to avoid exactly evaluating $U ( \cdot , T )$ , and hence circumvents the question of estimator bias. We observe an interesting connection between MAML and the stochastic composition problem. Let us define $u _ { \mathbf { h } } ( \theta , T ) = u ( \bar { \theta } , T ; \mathbf { h } )$ and $f _ { \mathbf { g } } ^ { T } ( \theta ) =$ $f ^ { T } ( \theta + \sigma \mathbf { g } )$ . For a given task $T$ , the MAML reward is given by
|
| 367 |
+
|
| 368 |
+
$$
|
| 369 |
+
\widetilde { f } ^ { T } ( U ( \theta , T ) ) = \widetilde { f } ^ { T } [ \mathbb { E } _ { \mathbf { h } } u _ { \mathbf { h } } ( \theta , T ) ] = \mathbb { E } _ { \mathbf { g } } f _ { \mathbf { g } } ^ { T } ( \mathbb { E } _ { \mathbf { h } } u _ { \mathbf { h } } ( \theta , T ) ) .
|
| 370 |
+
$$
|
| 371 |
+
|
| 372 |
+
This is a two-layer nested stochastic composition problem with outer function $\tilde { f } ^ { T } = \mathbb { E } _ { \mathbf { g } } f _ { \mathbf { g } } ^ { T }$ and inner function $U ( \cdot , T ) = \mathbb { E } _ { \mathbf { h } } u _ { \mathbf { h } } ( \cdot , T )$ . An accelerated algorithm (ASC-PG) was developed in (Wang et al., 2017)] for this class of problems. While neither $f _ { \mathbf { g } } ^ { \breve { T } }$ nor $u _ { \mathbf { h } } ( \cdot , T )$ is smooth, which is assumed in (Wang et al., 2017), we can verify that the crucial content of the assumptions hold:
|
| 373 |
+
|
| 374 |
+
1. $\mathbb { E } _ { \mathbf { h } } u _ { \mathbf { h } } ( \theta , T ) = U ( \theta , T )$
|
| 375 |
+
|
| 376 |
+
2. We can define two functions
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
\zeta _ { \mathbf { g } } ^ { T } ( \theta ) = { \frac { 1 } { \sigma } } f _ { \mathbf { g } } ^ { T } ( \theta ) \mathbf { g } , \quad \xi _ { \mathbf { h } } ^ { T } ( \theta ) = \mathbf { I } + { \frac { \alpha } { \sigma ^ { 2 } } } { \big ( } f _ { \mathbf { h } } ^ { T } ( \theta ) \mathbf { h } \mathbf { h } ^ { T } - f _ { \mathbf { h } } ^ { T } ( \theta ) \mathbf { I } { \big ) }
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
such that for any $\theta _ { 1 } , \theta _ { 2 }$ ,
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
\mathbb { E } _ { \mathbf { g } , \mathbf { h } } [ \xi _ { \mathbf { h } } ^ { T } ( \theta _ { 1 } ) \zeta _ { \mathbf { g } } ^ { T } ( \theta _ { 2 } ) ] = J U ( \theta _ { 1 } , T ) \nabla \widetilde { f } ^ { T } ( \theta _ { 2 } )
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
where $J U$ denotes the Jacobian of $U ( \cdot , T )$ , and $\mathbf { g } , \mathbf { h }$ are independent vectors sampled from $\mathcal { N } ( 0 , \bf { I } )$ . This follows immediately from equation 4 and equation 10.
|
| 389 |
+
|
| 390 |
+
The ASC-PG algorithm does not immediately extend to the full MAML problem, as upon taking an outer expectation over $T$ , the MAML reward $J ( \theta ) = \mathbb { E } _ { T } \mathbb { E } _ { \mathbf { g } } f _ { \mathbf { g } } ^ { T } ( \mathbb { E } _ { \mathbf { h } } \dot { u } _ { \mathbf { h } } ( \theta , T ) )$ is no longer a stochastic composition of the required form. In particular, there are conceptual difficulties when the number of tasks in $\tau$ is infinite. However, it can be used to solve the MAML problem for each task within a consensus framework, such as consensus ADMM (Hong et al., 2016).
|
| 391 |
+
|
| 392 |
+
# A.3 EXTENSIONS OF ES
|
| 393 |
+
|
| 394 |
+
In this section, we discuss several general techniques for improving the basic ES gradient estimator (Algorithm 1). These can be applied both to the ES gradient of the meta-training (the ‘outer loop’ of Algorithm 3), and more interestingly, to the adaptation operator itself. That is, given $U ( \theta , T ) \stackrel { \textstyle - } { = }$ $\theta + \alpha \nabla \widetilde { f } _ { \sigma } ^ { T } ( \theta )$ , we replace the estimation of $U$ by ESGRAD on line 4 of Algorithm 3 with an improved estimator of $\nabla \widetilde { f } _ { \sigma } ^ { T } ( \theta )$ , which even may depend on data collected during the meta-training stage. Many techniques exist for reducing the variance of the estimator such as Quasi Monte Carlo sampling (Choromanski et al., 2018). Aside from variance reduction, there are also methods with special properties.
|
| 395 |
+
|
| 396 |
+
# A.3.1 ACTIVE SUBSPACES
|
| 397 |
+
|
| 398 |
+
Active Subspaces is a method for finding a low-dimensional subspace where the contribution of the gradient is maximized. Conceptually, the goal is to find and update on-the-fly a low-rank subspace $\mathcal { L }$ so that the projection $\nabla f ^ { T } ( \boldsymbol { \theta } ) _ { \mathcal { L } }$ of $\nabla f ^ { \mathbf { \nabla } } ( \theta )$ into $\mathcal { L }$ is maximized and apply $\nabla f ^ { T } ( \theta ) _ { \mathcal { L } }$ instead of $\nabla f ^ { T } ( \theta )$ . This should be done in such a way that $\nabla f ^ { T } ( \theta )$ does not need to be computed explicitly. Optimizing in lower-dimensional subspaces might be computationally more efficient and can be thought of as an example of guided ES methods, where the algorithm is guided how to explore space in the anisotropic way, leveraging its knowledge about function optimization landscape that it gained in the previous steps of optimization. In the context of RL, the active subspace method ASEBO (Choromanski et al., 2019b) was successfully applied to speed up policy training algorithms. This strategy can be made data-dependent also in the MAML context, by learning an optimal subspace using data from the meta-training stage, and sampling from that subspace in the adaptation step.
|
| 399 |
+
|
| 400 |
+
# A.3.2 REGRESSION-BASED OPTIMIZATION
|
| 401 |
+
|
| 402 |
+
Regression-Based Optimization (RBO) is an alternative method of gradient estimation. From Taylor series expansion we have $f ( { \boldsymbol { \theta } } + \mathbf { d } ) - f ( { \boldsymbol { \theta } } ) = \nabla f ( { \boldsymbol { \theta } } ) ^ { T } \mathbf { d } + O ( \| \mathbf { \bar { d } } \| ^ { 2 } )$ . By taking multiple finite difference expressions $f ( \theta + { \bf d } ) - f ( \theta )$ for different $\mathbf { d }$ , we can recover the gradient by solving a regularized regression problem. The regularization has an additional advantage - it was shown that the gradient can be recovered even if a substantial fraction of the rewards $f ( \theta + { \bf d } )$ are corrupted (Choromanski et al., 2019c). Strictly speaking, this is not based on the Gaussian smoothing as in ES, but is another method for estimating gradients using only zero-th order evaluations.
|
| 403 |
+
|
| 404 |
+
# A.3.3 EXPERIMENTS
|
| 405 |
+
|
| 406 |
+
We present a preliminary experiment with RBO and ASEBO gradient adaptation in Figure A3. To be precise, the algorithms used are identical to Algorithm 3 except that in line 4, $\mathbf { d } ^ { ( i ) } \mathrm { \bar { E } S G R } \boldsymbol { \mathit { \Sigma } }$ D is replaced by $\mathbf { d } ^ { ( i ) } \mathbf { R } \mathbf { B } \mathbf { O }$ (yielding RBO-MAML) and $\mathbf { d } ^ { ( i ) } \bar { \mathbf { A } } \mathbf { S } \mathbf { E } \mathbf { B } \mathbf { O }$ (yielding ASEBO-MAML) respectively.
|
| 407 |
+
|
| 408 |
+

|
| 409 |
+
Figure A3: RBO-MAML and ASEBO-MAML compared to ES-MAML.
|
| 410 |
+
|
| 411 |
+
On the left plot, we test for noise robustness on the Forward-Backward Swimmer MAML task, comparing standard ES-MAML (Algorithm 3) to RBO-MAML. To simulate noisy data, we randomly corrupt $2 5 \%$ of the queries $f ^ { T } ( { \overline { { \theta } } } + \sigma g )$ used to estimate the adaptation operator $U ( \theta , T )$ with an enormous additive noise. This is the same type of corruption used in (Choromanski et al., 2019c).
|
| 412 |
+
|
| 413 |
+
Interestingly, RBO does not appear to be more robust against noise than the standard MC estimator, which suggests that the original ES-MAML has some inherent robustness to noise.
|
| 414 |
+
|
| 415 |
+
On the right plot, we compare ASEBO-MAML to ES-MAML on the Goal-Velocity HalfCheetah task in the low- $K$ setting. We found that when measured in iterations, ASEBO-MAML outperforms ES-MAML. However, ASEBO requires additional linear algebra operations and thus uses significantly more wall-clock time (not shown in plot) per iteration, so if measured by real time, then ES-MAML was more effective.
|
| 416 |
+
|
| 417 |
+
# A.4 NAVIGATION-2D EXPLORATION TASK
|
| 418 |
+
|
| 419 |
+
Navigation- $2 D$ (Finn et al., 2017) is a classic environment where the agent must explore to adapt to the task. The agent is represented by a point on a 2D square, and at each time step, receives reward equal to its distance from a given target point on the square. Note that unlike the four corners and six circles tasks, the reward for Navigation-2D is dense. We visualize the differing exploration strategies learned by PG-MAML and ES-MAML in Figure A4. Notice that PG-MAML makes many tiny movements in multiple directions to ‘triangulate’ the target location using the differences in reward for different state-action pairs. On the other hand, ES-MAML learns a meta-policy such that each perturbation of the meta-policy causes the agent to move in a different direction (represented by red paths), so it can determine the target location from the total rewards of each path.
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
Figure A4: Comparing the exploration behavior of PG-MAML and ES-MAML on the Navigation2D task. We use $K = 2 0$ queries for each algorithm.
|
| 423 |
+
|
| 424 |
+
# A.5 PG-MAML RL BENCHMARKS
|
| 425 |
+
|
| 426 |
+
In Figure A5, we compare ES-MAML and PG-MAML on the Forward-Backward and Goal-Velocity tasks for HalfCheetah, Swimmer, Walker2d, and Ant, using the same values of $K$ that were used in the original experiments of (Finn et al., 2017).
|
| 427 |
+
|
| 428 |
+

|
| 429 |
+
Figure A5: Comparisons between ES-MAML and PG-MAML using the queries $K$ from (Finn et al., 2017).
|
| 430 |
+
|
| 431 |
+
# A.6 REGRESSION AND SUPERVISED LEARNING
|
| 432 |
+
|
| 433 |
+
MAML has also been applied to supervised learning. We demonstrate ES-MAML on sine regression (Finn et al., 2017), where the task is to fit a sine curve $f$ with unknown amplitude and phase given a set of $K$ pairs $( x _ { i } , f ( x _ { i } ) )$ . The meta-policy must be able to learn that all of tasks have a common periodic nature, so that it can correctly adapt to an unknown sine curve outside of the points $x _ { i }$ .
|
| 434 |
+
|
| 435 |
+
For regression, the loss is the mean-squared error (MSE) between the adapted policy $\pi _ { \boldsymbol { \theta } } ( \boldsymbol { x } )$ and the true curve $f ( x )$ . Given data samples $\{ ( x _ { i } , f ( x _ { i } ) \} _ { i = 1 } ^ { K }$ , the empirical loss is $\begin{array} { r } { L ( \theta ) = \frac { 1 } { K } \sum _ { i = 1 } ^ { K } ( f ( x _ { i } ) - } \end{array}$ $\pi _ { \boldsymbol { \theta } } ( x _ { i } ) ) ^ { 2 }$ . Note that unlike in reinforcement learning, we can exactly compute $\nabla L ( \theta )$ ; for deep networks, this is by automatic differentiation. Thus, we opt to use Tensorflow to compute the adaptation operator $U ( \theta , T )$ in Algorithm 3. This is in accordance with the general principle that when gradients are available, it is more efficient to use the gradient than to approximate it by a zero-order method (Nesterov & Spokoiny, 2017).
|
| 436 |
+
|
| 437 |
+
We show several results in Figure A6. The adaptation step size is $\alpha = 0 . 0 1$ , which is the same as in (Finn et al., 2017). For comparison, (Finn et al., 2017) reports that PG-MAML can obtain a loss of $\approx 0 . 5$ after one adaptation step with $K = 5$ , though it is not specified how many iterations the meta-policy was trained for. ES-MAML approaches the same level of performance, though the number of training iterations required is higher than for the RL tasks, and surprisingly high for what appears to be a simpler problem. This is likely again a reflection of the fact that for problems such as regression where the gradients are available, it is more efficient to use gradients.
|
| 438 |
+
|
| 439 |
+
As an aside, this leads to a related question of the correct interpretation of the query number $K$ in the supervised setting. There is a distinction between obtaining a data sample $( x _ { i } , f ( x _ { i } ) )$ , and doing a computation (such as a gradient) using that sample. If the main bottleneck is collecting the data $\{ ( x _ { i } , f ( x _ { i } ) \}$ , then we may be satisfied with any algorithm that performs any number of operations on the data, as long as it uses only $K$ samples. On the other hand, in the (on-policy) RL setting, samples cannot typically be ‘re-used’ to the same extent, because rollouts $\tau$ sampled with a given policy $\pi _ { \theta }$ follow an unknown distribution ${ \mathcal { P } } ( \tau | \theta )$ which reduces their usefulness away from $\theta$ . Thus, the corresponding notion to rollouts in the SL setting would be the number of backpropagations (for PG-MAML) or perturbations (for ES-MAML), but clearly these have different relative costs than doing simulations in RL.
|
| 440 |
+
|
| 441 |
+

|
| 442 |
+
Figure A6: The MSE of the adapted policy, for varying number of gradient steps and query number $K$ . Runs are averaged across 3 seeds.
|
| 443 |
+
|
| 444 |
+
# A.7 HYPERPARAMETERS AND SETUPS
|
| 445 |
+
|
| 446 |
+
# A.7.1 ENVIRONMENTS
|
| 447 |
+
|
| 448 |
+
Unless otherwise explicitly stated, we default to $K = 2 0$ and horizon $= 2 0 0$ for all RL experiments. We also use the standard reward normalization in (Mania et al., 2018), and use a global state normalization (i.e. the same mean, standard deviation normalization values for MDP states are shared across workers).
|
| 449 |
+
|
| 450 |
+
For the Ant environments (Goal-Position Ant, Forward-Backward Ant), there are significant differences in weighting on the auxiliary rewards such as control costs, contact costs, and survival rewards across different previous work (e.g. those costs are downweighted in (Finn et al., 2017) whereas the coefficients are vanilla Gym weightings in (Liu et al., 2019)). These auxiliary rewards can lead to local minima, such as the agent staying stationary to collect the survival bonus which may be confused with movement progress when presenting a training curve. To make sure the agent is explicitly performing the required task, we opted to remove such costs in our work and only present the main goal-distance cost and forward-movement reward respectively.
|
| 451 |
+
|
| 452 |
+
For the other environments, we used default weightings and rewards, since they do not change across previous works.
|
| 453 |
+
|
| 454 |
+
# A.7.2 ES-MAML HYPERPARAMETERS
|
| 455 |
+
|
| 456 |
+
Let $N$ be the number of possible distinct tasks possible. We sample tasks without replacement, which is important if $N \ll 5$ , as each worker performs adaptations on all possible tasks.
|
| 457 |
+
|
| 458 |
+
For standard ES-MAML (Algorithm 3), we used the following settings.
|
| 459 |
+
|
| 460 |
+
<table><tr><td rowspan=1 colspan=1>Setting</td><td rowspan=1 colspan=1>Value</td></tr><tr><td rowspan=1 colspan=1>(Total Workers,#Perturbations,#Current Evals)</td><td rowspan=1 colspan=1>(300,150,150)</td></tr><tr><td rowspan=1 colspan=1>(Train SetSize,Task Batch Size,Test SetSize)</td><td rowspan=1 colspan=1>(50,5,5) or (N,N,N)</td></tr><tr><td rowspan=1 colspan=1>Number of rolloutsper parameter</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>NumberofPerturbationsperworker</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>Outer-Loop Precision Parameter</td><td rowspan=1 colspan=1>0.1</td></tr><tr><td rowspan=1 colspan=1>AdaptationPrecision Parameter</td><td rowspan=1 colspan=1>0.1</td></tr><tr><td rowspan=1 colspan=1>Outer-Loop Step Size</td><td rowspan=1 colspan=1>0.01</td></tr><tr><td rowspan=1 colspan=1>Adaptation Step Size (α)</td><td rowspan=1 colspan=1>0.05</td></tr><tr><td rowspan=1 colspan=1>Hidden Layer Width</td><td rowspan=1 colspan=1>32</td></tr><tr><td rowspan=1 colspan=1>ES Estimation Type</td><td rowspan=1 colspan=1>Forward-FD</td></tr><tr><td rowspan=1 colspan=1>Reward Normalization</td><td rowspan=1 colspan=1>True</td></tr><tr><td rowspan=1 colspan=1>State Normalization</td><td rowspan=1 colspan=1>True</td></tr></table>
|
| 461 |
+
|
| 462 |
+
For ES-MAML and PG-MAML, we took 3 seeded runs, using the default TRPO hyperparameters found in (Liu et al., 2019).
|
md/train/S1gOpsCctm/S1gOpsCctm.md
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING FINITE STATE REPRESENTATIONS OF RECURRENT POLICY NETWORKS
|
| 2 |
+
|
| 3 |
+
Anurag Koul & Alan Fern
|
| 4 |
+
School of EECS
|
| 5 |
+
Oregon State University
|
| 6 |
+
Corvallis, Oregon, USA
|
| 7 |
+
{koula,alan.fern}@oregonstate.edu
|
| 8 |
+
Sam Greydanus ∗
|
| 9 |
+
Google Brain
|
| 10 |
+
Mountain View, California, USA
|
| 11 |
+
sgrey@google.com
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
Recurrent neural networks (RNNs) are an effective representation of control policies for a wide range of reinforcement and imitation learning problems. RNN policies, however, are particularly difficult to explain, understand, and analyze due to their use of continuous-valued memory vectors and observation features. In this paper, we introduce a new technique, Quantized Bottleneck Insertion, to learn finite representations of these vectors and features. The result is a quantized representation of the RNN that can be analyzed to improve our understanding of memory use and general behavior. We present results of this approach on synthetic environments and six Atari games. The resulting finite representations are surprisingly small in some cases, using as few as 3 discrete memory states and 10 observations for a perfect Pong policy. We also show that these finite policy representations lead to improved interpretability.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Deep reinforcement learning (RL) and imitation learning (IL) have demonstrated impressive performance across a wide range of applications. Unfortunately, the learned policies are difficult to understand and explain, which limits the degree that they can be trusted and used in high-stakes applications. Such explanations are particularly problematic for policies represented as recurrent neural networks (RNNs) (Mnih et al., 2016; Mikolov et al., 2010), which are increasingly used to achieve state-of-the-art performance (Mnih et al., 2015; Silver et al., 2017). This is because RNN policies use internal memory to encode features of the observation history, which are critical to their decision making, but extremely difficult to interpret. In this paper, we take a step towards comprehending and explaining RNN policies by learning more compact memory representations.
|
| 20 |
+
|
| 21 |
+
Explaining RNN memory is challenging due to the typical use of high-dimensional continuous memory vectors that are updated through complex gating networks (e.g. LSTMs, GRUs (Hochreiter & Schmidhuber, 1997; Chung et al., 2014; Cho et al., 2014)). We hypothesize that, in many cases, the continuous memory is capturing and updating one or more discrete concepts. If exposed, such concepts could significantly aid explainability. This motivates attempting to quantize the memory and observation representation used by an RNN to more directly capture those concepts. In this case, understanding the memory use can be approached by manipulating and analyzing the quantized system. Of course, not all RNN policies will have compact quantized representations, but many powerful forms of memory usage can be captured in this way.
|
| 22 |
+
|
| 23 |
+
Our main contribution is to introduce an approach for transforming an RNN policy with continuous memory and continuous observations to a finite-state representation known as a Moore Machine. To accomplish this we introduce the idea of Quantized Bottleneck Network (QBN) insertion. QBNs are simply auto-encoders, where the latent representation is quantized. Given a trained RNN, we train QBNs to encode the memory states and observation vectors that are encountered during the RNN operation. We then insert the QBNs into the trained RNN policy in place of the “wires” that propagated the memory and observation vectors. The combination of the RNN and QBN results in a policy represented as a Moore Machine Network (MMN) with quantized memory and observations that is nearly equivalent to the original RNN. The MMN can be used directly or fine-tuned to improve on inaccuracies introduced by QBN insertion.
|
| 24 |
+
|
| 25 |
+
While training quantized networks is often considered to be quite challenging, we show that a simple approach works well in the case of QBNs. In particular, we demonstrate that “straight through” gradient estimators as in (Bengio et al., 2013; Courbariaux et al., 2016) are quite effective.
|
| 26 |
+
|
| 27 |
+
We present experiments in synthetic domains designed to exercise different types of memory use as well as benchmark grammar learning problems. Our approach is able to accurately extract the ground-truth MMNs, providing insight into the RNN memory use. We also did experiments on 6 Atari games using RNNs that achieve state-of-the-art performance. We show that in most cases it is possible to extract near-equivalent MMNs and that the MMNs can be surprisingly small. Further, the extracted MMNs give insights into the memory usage that are not obvious based on just observing the RNN policy in action. For example, we identify games where the RNNs do not use memory in a meaningful way, indicating the RNN is implementing purely reactive control. In contrast, in other games, the RNN does not use observations in a meaningful way, which indicates that the RNN is implementing an open-loop controller.
|
| 28 |
+
|
| 29 |
+
# 2 RELATED WORK
|
| 30 |
+
|
| 31 |
+
There have been efforts made in the past to understand the internals of Recurrent Networks (Karpathy et al., 2015; Arras et al., 2017; Strobelt et al., 2016; Murdoch & Szlam, 2017; Jacobsson, 2005; Omlin & Giles, 1996). However, to the best of our knowledge there is no prior work on learning finite-memory representations of continuous RNN policies. Our work, however, is related to a large body of work on learning finite-state representations of recurrent neural networks. Below we summarize the branches of that work and the relationship to our own.
|
| 32 |
+
|
| 33 |
+
There has been a significant history of work on extracting Finite State Machines (FSMs) from recurrent networks trained to recognize languages (Zeng et al., 1993; Tino et al., 1998; Cechin et al., ˇ 2003). Typical approaches include discretizing the continuous memory space via gridding or clustering followed by minimization. A more recent approach is to use classic query-based learning algorithms to extract FSMs by asking membership and equivalence queries (Weiss et al., 2017). However, none of these approaches directly apply to learning policies, which require extending to Moore Machines. In addition, all of these approaches produce an FSM approximation that is separated from the RNN and thus serve as only a proxy of the RNN behavior. Rather, our approach directly inserts discrete elements into the RNN that preserves its behavior, but allows for a finite state characterization. This insertion approach has the advantage of allowing fine-tuning and visualization using standard learning frameworks.
|
| 34 |
+
|
| 35 |
+
The work most similar to ours also focused on learning FSMs (Zeng et al., 1993). However, the approach is based on directly learning recurrent networks with finite memory, which are qualitatively similar to the memory representation of our MMNs. That work, however, focused on learning from scratch rather than aiming to describe the behavior of a continuous RNN. Our work extends that approach to learn MMNs and more importantly introduces the method of QBN insertion as a way of learning via guidance from a continuous RNN.This transforms any pre-trained recurrent policy into a finite representation.
|
| 36 |
+
|
| 37 |
+
We note that there has been prior work on learning fully binary networks, where the activation functions and/or weights are binary (e.g. (Bengio et al., 2013; Courbariaux et al., 2016; Hinton, 2012)). The goal of that line of work is typically to learn more time and space efficient networks. Rather, we focus on learning only discrete representations of memory and observations, while allowing the rest of the network to use arbitrary activations and weights. This is due to our alternative goal of supporting interpretability rather than efficiency.
|
| 38 |
+
|
| 39 |
+
# 3 RECURRENT POLICY NETWORKS: CONTINUOUS AND QUANTIZED
|
| 40 |
+
|
| 41 |
+
Recurrent neural networks (RNNs) are commonly used in reinforcement learning to represent policies that require or can benefit from internal memory. At each time step, an RNN is given an observation $o _ { t }$ (e.g. image) and must output an action $a _ { t }$ to be taken in the environment. During execution an RNN maintains a continuous-valued hidden state $h _ { t }$ , which is updated on each transition and influences the action choice. In particular, given the current observation $o _ { t }$ and current state $h _ { t }$ , an RNN performs the following operations: 1) Extract a set of observation features $f _ { t }$ from $o _ { t }$ , for example, using a CNN when observations are images, 2) Outputting an action $a _ { t } = \pi ( h _ { t } )$ according to policy $\pi$ , which is often a linear softmax function of $h _ { t }$ , 3) transition to a new state $h _ { t + 1 } = \bar { \delta } ( f _ { t } , \mathsf { \bar { h } } _ { t } )$ where $\delta$ is the transition function, which is often implemented via different types of gating networks such as LSTMs or GRUs.
|
| 42 |
+
|
| 43 |
+
The continuous and high dimensional nature of $h _ { t }$ and $f _ { t }$ can make interpreting the role of memory difficult. This motivates our goal of extracting compact quantized representations of $h _ { t }$ and $f _ { t }$ . Such representations have the potential to allow investigating a finite system that captures the key features of the memory and observations. For this purpose we introduce Moore Machines and their deep network counterparts.
|
| 44 |
+
|
| 45 |
+
Moore Machines. A classical Moore Machine (MM) is a standard finite state machine where all states are labeled by output values, which in our case will correspond to actions. In particular, a Moore Machine is described by a finite set of (hidden) states $\hat { H }$ , an initial hidden state $\hat { h } _ { 0 }$ , a finite set of observations $\hat { O }$ , a finite set of actions $A$ , a transition function $\hat { \delta }$ , and a policy $\hat { \pi }$ that maps hidden states to actions. The transition function $\hat { \delta } : \hat { H } \times \hat { O } \hat { H }$ returns the next hidden state $\hat { h } _ { t + 1 } = \hat { \delta } ( \hat { h } _ { t } , \hat { o } _ { t } )$ given the current state $\hat { h } _ { t }$ and observation $\hat { o } _ { t }$ . By convention we will use $h _ { t }$ and $\hat { h } _ { t }$ to denote continuous and discrete states respectively and similarly for other quantities and functions.
|
| 46 |
+
|
| 47 |
+
Moore Machine Networks. A Moore Machine Network (MMN) is a Moore Machine where the transition function $\hat { \delta }$ and policy $\hat { \pi }$ are represented via deep networks. In addition, since the raw observations given to an MMN are often continuous, or from an effectively unbounded set (e.g. images), an MMN will also provide a mapping $\hat { g }$ from the continuous observations to a finite discrete observation space $\hat { O }$ . Here $\hat { g }$ will also be represented via a deep network. In this work, we consider quantized state and observation representations where each $\hat { h } \in \hat { H }$ is a discrete vector and each discrete observation in $\hat { O }$ is a discrete vector that describes the raw observation. We will denote the quantization level as $k$ and the dimensions of $\hat { h }$ and $\hat { f }$ by $B _ { h }$ and $B _ { f }$ respectively.
|
| 48 |
+
|
| 49 |
+
Based on the above discussion, an MMN can be viewed as a traditional RNN, where: 1) The memory is restricted to be composed of $k$ -level activation units, and 2) The environmental observations are intermediately transformed to a $k$ -level representation $\hat { f }$ before being fed to the recurrent module. Given an approach for incorporating quantized units into the backpropagation process, it is straightforward, in concept, to learn MMNs from scratch via standard RNN learning algorithms. However, we have found that learning MMNs from scratch can be quite difficult for non-trivial problems, even when an RNN can be learned with relative ease. For example, we have not been able to train highperforming MMNs from scratch for Atari games. Below we introduce a new approach for learning MMNs that is able to leverage the ability to learn RNNs.
|
| 50 |
+
|
| 51 |
+
# 4 LEARNING MOORE MACHINE NETWORKS FROM RNNS
|
| 52 |
+
|
| 53 |
+
Given a trained RNN, our key idea is to first learn quantized bottleneck networks (QBNs) for embedding the continuous observation features and hidden state into a $k$ -level quantized representation. We will then insert the QBNs into the original recurrent net in such a way that its behavior is minimally changed with the option of fine-tuning after insertion. The resulting network can be viewed as consuming quantized features and maintaining quantized state, which is effectively an MMN. Below we describe the steps in further detail, which are illustrated in Figure 1.
|
| 54 |
+
|
| 55 |
+
# 4.1 QUANTIZED BOTTLENECK NETWORKS
|
| 56 |
+
|
| 57 |
+
A QBN is simply an autoencoder where the latent representation between the encoder and decoder (i.e. the bottleneck) is constrained to be composed of $k$ -level activation units. While, traditional autoencoders are generally used for the purpose of dimensionality reduction in continuous space (Hinton & Salakhutdinov, 2006), QBNs are motivated by the goal of discretizing a continuous space. Conceptually, this can be done by quantizing the activations of units in the encoding layer.
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 1: Learning Moore Machine Networks. (1.) Learn an RNN policy. (2.) Learn QBN’s to quantize memory and observations. (3.) Insertion and Fine Tuning. The modules labelled O, R are observation feature-extraction and recurrent modules, respectively
|
| 61 |
+
|
| 62 |
+
We represent a QBN via a continuous multilayer encoder $E$ , which maps inputs $x$ to a latent encoding $E ( x )$ , and a corresponding multilayer decoder $D$ . To quantize the encoding, the QBN output is given by
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
b ( x ) = D ( { \mathrm { q u a n t i z e } } ( E ( x ) ) )
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
In our case, we use 3-level quantization in the form of $+ 1 , 0$ and $- 1$ using the quantize function, which assumes the outputs of $E ( x )$ are in the range $[ - 1 , 1 ]$ .1 One choice for the output nodes of $E ( x )$ would be the tanh activation. However, since the gradient of tanh is close to 1 near 0, it can be difficult to produce quantization level 0 during learning. Thus, as suggested in Pitis (2017), to support 3-valued quantization we use the following activation function, which is flatter in the region around zero input.
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\phi ( x ) = 1 . 5 \operatorname { t a n h } ( x ) + 0 . 5 \operatorname { t a n h } ( - 3 x )
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
Of course introducing the quantize function in the QBN results in $b ( x )$ being non-differentiable, making it apparently incompatible with backpropagation, since the gradients between the decoder and encoder will almost always be zero. While there are a variety of ways to deal with this issue, we have found that the straight-through estimator, as suggested and used in prior work (Hinton, 2012; Bengio et al., 2013; Courbariaux et al., 2016) is quite effective. In particular, the standard straightthrough estimator of the gradient simply treats the quantize function as the identity function during back-propagation. Overall, the inclusion of the quantize function in the QBN effectively allows us to view the last layer of $E$ as producing a $k$ -level encoding. We train a QBN as an autoencoder using the standard $L _ { 2 }$ reconstruction error $\| x - b ( x ) \| ^ { 2 }$ for a given input $x$ .
|
| 75 |
+
|
| 76 |
+
# 4.2 BOTTLENECK INSERTION
|
| 77 |
+
|
| 78 |
+
Given a recurrent policy we can run the policy in the target environment in order to produce an arbitrarily large set of training sequences of triples $\left( o _ { t } , f _ { t } , h _ { t } \right)$ , giving the observation, corresponding observation feature, and hidden state at time $t$ . Let $F$ and $H$ be the sets of all observed features and states respectively. The first step of our approach is to train two QBNs, $b _ { f }$ and $b _ { h }$ , on $F$ and $H$ respectively. If the QBNs are able to achieve low reconstruction error then we can view latent “bottlenecks” of the QBNs as a high-quality $k$ -level encodings of the original hidden states and features.
|
| 79 |
+
|
| 80 |
+
We now view $b _ { f }$ and $b _ { h }$ as “wires” that propagate the input to the output, with some noise due to imperfect reconstruction. We insert these wires into the original RNN in the natural way (stage-3 in Figure 1). The $b _ { f }$ QBN is inserted between the RNN units that compute the features $f$ and the nodes those units are connected to. The $b _ { h }$ QBN is inserted between the output of the recurrent network block and the input to the recurrent block. If $b _ { f }$ and $b _ { h }$ always produced perfect reconstructions, then the result of inserting them as described would not change the behavior of the RNN. Yet, the RNN can now be viewed as an MMN since the bottlenecks of $b _ { f }$ and $b _ { h }$ provide a quantized representation of the features $f _ { t }$ and states $h _ { t }$ .
|
| 81 |
+
|
| 82 |
+
Fine Tuning. In practice, the QBNs will not achieve perfect reconstruction and thus, the resulting MMN may not behave identically to the original RNN. Empirically, we have found that the performance of the resulting MMN is often very close to the RNN directly after insertion. However, when there is non-trivial performance degradation, we can fine-tune the MMN by training on the original rollout data of the RNN. Importantly, since our primary goal is to learn a representation of the original RNN, during fine-tuning our objective is to have the MMN match the softmax distribution over actions produced by the RNN. We found that training in this way was significantly more stable than training the MMN to simply output the same action as the RNN.
|
| 83 |
+
|
| 84 |
+
# 4.3 MOORE MACHINE EXTRACTION AND MINIMIZATION
|
| 85 |
+
|
| 86 |
+
After obtaining the MMN, one could use visualization and other analysis tools to investigate the memory and it’s feature bits in order to gain a semantic understanding of their roles. Solving the full interpretation problem in a primitive way is beyond the scope of this work.
|
| 87 |
+
|
| 88 |
+
Extraction. Another way to gain insight is to use the MMN to produce an equivalent Moore Machine over atomic state and observation spaces, where each state and observation is a discrete symbol. This machine can be analyzed to understand the role of different machine states and how they are related. In order to create the Moore Machine we run the learned MMN to produce a dataset of $< \hat { h } _ { t - 1 } , \hat { f } _ { t } , \hat { h } _ { t } , a _ { t } > ,$ , giving the consecutive pairs of quantized states, the quantized features that led to the transition, and the action selected after the transition. The state-space of the Moore Machine will correspond to the $p$ distinct quantized states in the data and the observation-space of the machine will be the $q$ unique quantized feature vectors in the data. The transition function of the machine $\hat { \delta }$ is constructed from the data by producing a $p \times q$ transaction table that captures the transitions seen in the data.
|
| 89 |
+
|
| 90 |
+
Minimization. In general, the number of states $p$ in the resulting Moore Machine will be larger than necessary in the sense that there is a much smaller, but equivalent, minimal machine. Thus, we apply standard Moore Machine minimization techniques to arrive at the minimal2 equivalent Moore Machine (Paull & Unger, 1959). This often dramatically reduces the number of distinct states and observations.
|
| 91 |
+
|
| 92 |
+
# 5 SYNTHETIC EXPERIMENTS
|
| 93 |
+
|
| 94 |
+
Our experiments address the following questions: 1) Is it possible to extract MMNs from RNNs without significant loss in Performance? 2) What is the general magnitude of the number of states and observations in the minimal machines, especially for complex domains such as Atari? 3) Do the learned MMNs help with interpretability of the recurrent policies? In this section, we begin addressing these questions by considering two domains where ground truth Moore Machines are known. The first is a parameterized synthetic environment, Mode Counter, which can capture multiple types of memory use. Second, we consider benchmark grammar learning problems.
|
| 95 |
+
|
| 96 |
+
# 5.1 MODE COUNTER
|
| 97 |
+
|
| 98 |
+
The class of Mode Counter Environments (MCEs) allows us to vary the amount of memory required by a policy (including no memory) and the required type of memory usage. In particular, MCEs can require varying amounts of memory for remembering past events and implementing internal counters.
|
| 99 |
+
|
| 100 |
+
An MCE is a restricted type of Partially Observable Markov Decision Process, which transitions between one of $M$ modes over time according to a transition distribution, which can depend on the current mode and amount of time spent in the current mode. There are $M$ actions, one for each mode, and the agent receives a reward of $+ 1$ at the end of the episode if it takes the correct action associated with the active mode at each time step. The agent does not observe the mode directly, but rather must infer the mode via a combination of observations and memory use. Different parameterizations place different requirements on how (and if) memory needs to be used to infer the mode and achieve optimal performance. Below we give an intuitive description of the $\mathbf { M C E s } ^ { 3 }$ in our experiments.
|
| 101 |
+
|
| 102 |
+
We conduct experiments in three MCE instances, which use memory and observations in fundamentally different ways. This tests our ability to use our approach for determining the type of memory use. 1) Amnesia. This MCE is designed so that the optimal policy does not need memory to track past information and can select optimal actions based on just the current observation. 2) Blind. Here we consider the opposite extreme, where the MCE observations provide no information about optimal actions. Rather, memory must be used to implement counters that keep track of a deterministic mode sequence for determining the optimal actions. 3) Tracker. This MCE is designed so that the optimal policy must both use observations and memory in order to select optimal actions. Intuitively the memory must implement counters that keep track of key time steps where the observations provide information about the mode. In all above instances, we used $M = 4$ modes.
|
| 103 |
+
|
| 104 |
+
RNN Training. For each MCE instance we use the following recurrent architecture: the input feeds into 1 feed-forward layer with 4 Relu6 nodes (Krizhevsky & Hinton, 2010) $( f _ { t } )$ , followed by a 1-layer GRU with 8 hidden units $\left( { { h _ { t } } } \right)$ , followed by a fully connected softmax layer giving a distribution over the $M$ actions (one per mode). Since we know the optimal policy in the MCEs we use imitation learning for training. For all of the MCEs in our experiments, the trained RNNs achieve $100 \%$ accuracy on the imitation dataset and appeared to produce optimal policies.
|
| 105 |
+
|
| 106 |
+
MMN Training. The observation QBN $b _ { f }$ and hidden-state QBN $b _ { h }$ have the same architecture, except that the number of quantized bottleneck units $B _ { f }$ and $B _ { h }$ are varied in our experiments. The encoders consist of 1 feed-forward layer of tanh nodes, where the number of nodes is 4 times the size of the bottleneck. This layer feeds into 1 feedforward layer of quantized bottleneck nodes (see Section 4). The decoder for both $b _ { f }$ and $b _ { h }$ has a symmetric architecture to the encoder. Training of $b _ { f }$ and $b _ { h }$ in the MCE environments was extremely fast compared to the RNN training, since QBNs do not need to learn temporal dependencies. We trained QBNs with bottleneck sizes of $B _ { f } \in \{ 4 , 8 \}$ and $B _ { h } \in \{ 4 , 8 \}$ . For each combination of $B _ { f }$ and $B _ { h }$ we embedded the QBNs into the RNN to give a discrete MMN and then measured performance of the MMN before and after fine tuning. Table 1 gives the average test score over 50 test episodes. Score of 1 indicates the agent performed optimally for all episodes. In most of the cases no fine tuning was required (marked as ’-’) since the agent achieved perfect performance immediately after bottleneck insertion due to low reconstruction error. In all other cases, except for Tracker $B _ { h } = 4$ , $B _ { f } = 4 _ { . }$ ) fine-tuning resulted in perfect MMN performance. The exception yielded $98 \%$ accuracy. Interestingly in that case, we see that if we only insert one of the bottlenecks at a time, we yield perfect performance, which indicates that the combined error accumulation of the two bottlenecks is responsible for the reduced performance.
|
| 107 |
+
|
| 108 |
+
Moore Machine Extraction. Table 1 also gives the number of states and observations of the MMs extracted from the MMNs both before and after minimization. Recall that the number of states and obsevations before minimization is the number of distinct combinations of values observed for the bottleneck nodes during long executions of the MMN. We see that there are typically significantly more states and observations before minimization than after. This indicates that the MMN learning does not necessarily learn minimal discrete state and observation representations, though the representations accurately describe the RNN. After minimization (Section 4.3), however, in all but one case we get exact minimal machines for each MCE domain. The ground truth minimal machines that are found are shown in the Appendix (Figure 3). This shows that the MMNs learned via QBN insertions were equivalent to the true minimal machines and hence indeed optimal in most cases. The exception matches the case where the MMN did not achieve perfect accuracy.
|
| 109 |
+
|
| 110 |
+
Examining these machines allows one to understand the memory use. For example, the machine for Blind has just a single observation symbol and hence its transitions cannot depend on the input observations. In contrast, the machine for Amnesia shows that each distinct observation symbol leads to the same state (and hence action choice) regardless of the source state. Thus, the policies action is completely determined by the current observation.
|
| 111 |
+
|
| 112 |
+
Table 1: Moore Machine extraction for MCE
|
| 113 |
+
|
| 114 |
+
<table><tr><td rowspan=2 colspan=1>Game</td><td rowspan=2 colspan=1>Bh,Bf</td><td rowspan=1 colspan=2>Fine-TuningScore</td><td rowspan=1 colspan=3>BeforeMinimization</td><td rowspan=1 colspan=3>AfterMinimization</td></tr><tr><td rowspan=1 colspan=1>Before(%)</td><td rowspan=1 colspan=1>After(%)</td><td rowspan=1 colspan=1>H</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>Acc.(%)</td><td rowspan=1 colspan=1>H</td><td rowspan=1 colspan=1>|0|</td><td rowspan=1 colspan=1>Acc.(%)</td></tr><tr><td rowspan=3 colspan=1>Amnesia</td><td rowspan=2 colspan=1>4,44,8</td><td rowspan=2 colspan=1>0.980.99</td><td rowspan=2 colspan=1>11</td><td rowspan=2 colspan=1>77</td><td rowspan=2 colspan=1>57</td><td rowspan=1 colspan=1>1</td><td rowspan=2 colspan=1>44</td><td rowspan=2 colspan=1>44</td><td rowspan=2 colspan=1>11</td></tr><tr><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>8,48,8</td><td rowspan=1 colspan=1>10.99</td><td rowspan=1 colspan=1>-1</td><td rowspan=1 colspan=1>67</td><td rowspan=1 colspan=1>57</td><td rowspan=1 colspan=1>11</td><td rowspan=1 colspan=1>44</td><td rowspan=1 colspan=1>44</td><td rowspan=1 colspan=1>11</td></tr><tr><td rowspan=2 colspan=1>Blind</td><td rowspan=1 colspan=1>4,44,8</td><td rowspan=1 colspan=1>11</td><td rowspan=1 colspan=1>-1</td><td rowspan=1 colspan=1>1212</td><td rowspan=1 colspan=1>68</td><td rowspan=1 colspan=1>11</td><td rowspan=1 colspan=1>1010</td><td rowspan=1 colspan=1>11</td><td rowspan=1 colspan=1>11</td></tr><tr><td rowspan=1 colspan=1>8,48,8</td><td rowspan=1 colspan=1>10.78</td><td rowspan=1 colspan=1>-1</td><td rowspan=1 colspan=1>513</td><td rowspan=1 colspan=1>68</td><td rowspan=1 colspan=1>11</td><td rowspan=1 colspan=1>1010</td><td rowspan=1 colspan=1>11</td><td rowspan=1 colspan=1>11</td></tr><tr><td rowspan=4 colspan=1>Tracker</td><td rowspan=2 colspan=1>4,44,8</td><td rowspan=2 colspan=1>0.980.99</td><td rowspan=2 colspan=1>0.981</td><td rowspan=2 colspan=1>5823</td><td rowspan=2 colspan=1>55</td><td rowspan=2 colspan=1>0.981</td><td rowspan=2 colspan=1>5010</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>0.98</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=2 colspan=1>8,48,8</td><td rowspan=2 colspan=1>0.980.99</td><td rowspan=2 colspan=1>11</td><td rowspan=2 colspan=1>9185</td><td rowspan=2 colspan=1>55</td><td rowspan=2 colspan=1>11</td><td rowspan=2 colspan=1>1010</td><td rowspan=1 colspan=1>4</td><td rowspan=2 colspan=1>11</td></tr><tr><td rowspan=1 colspan=1>4</td></tr></table>
|
| 115 |
+
|
| 116 |
+
# 5.2 TOMITA GRAMMARS
|
| 117 |
+
|
| 118 |
+
The Tomita Grammars are popular benchmarks for learning finite state machines (FSMs), including work on extracting FSMs from RNNs (e.g. (Watrous & Kuhn, 1992; Weiss et al., 2017)). Here we evaluate our approach over the 7 Tomita Grammars4, where each grammar defines the set of binary strings that should be accepted or rejected. Since, our focus is on policy learning problems, we treat the grammars as environments with two actions ‘accept’ and ‘reject’. Each episode corresponds to a random string that is either part of the particular grammar or not. The agent receives a reward of 1 if the correct action accept/reject is chosen on the last symbol of a string.
|
| 119 |
+
|
| 120 |
+
RNN Training. The RNN for each grammar is comprised of a one-layer GRU with 10 hidden units, followed by a fully connected softmax layer with 2 nodes (accept/reject). Since we know the optimal policy, we again use imitation learning to train each RNN using the Adam optimizer and learning rate of 0.001. The training dataset is comprised of an equal number of accept/reject strings with lengths uniformly sampled in the range [1,50]. Table 2 presents the test results for the trained RNNs giving the accuracy over a test set of 100 strings drawn from the same distribution as used for training. Other than grammar $\# 6 ^ { 5 }$ , the RNNs were $100 \%$ accurate.
|
| 121 |
+
|
| 122 |
+
MMN Training. Since the raw observations for this problem are from a finite alphabet, we don’t need to employ a bottleneck encoder to discretize the observation features. Thus the only bottleneck learned here is $b _ { h }$ for the hidden memory state. We use the same architecture for $b _ { h }$ as used for the MCE experiments and conduct experiments with $B _ { h } \in \{ 8 , 1 6 \}$ . These bottlenecks were then inserted in the RNNs to give MMNs. The performance of the MMNs before and after fine-tuning are shared in Table 2. In almost all cases, the MMN is able to maintain the performance of the RNN without fine-tuning. Fine tuning provides only minor improvements in other cases, which already are achieving high accuracy.
|
| 123 |
+
|
| 124 |
+
Moore Machine Extraction. Our results for MM extraction and minimization are in Table 2. In each case, we see a considerable reduction in the MM’s state-space after minimization while accurately maintaining the MMN’s performance. Again, this shows that the MMN learning does not directly result in minimal machines, yet are equivalent to the minimal machines and hence are exact solutions. In all cases, except for grammar 6 the minimized machines are identical to the minimal machines that are known for these grammars (Tomita, 1982).
|
| 125 |
+
|
| 126 |
+
Table 2: Moore Machine extraction for Tomita grammar
|
| 127 |
+
|
| 128 |
+
<table><tr><td rowspan=2 colspan=1>#Grammar</td><td rowspan=2 colspan=1>RNNAcc. (%)</td><td rowspan=2 colspan=1>Bh</td><td rowspan=1 colspan=2>Fine-TuningAcc.(%)</td><td rowspan=1 colspan=2>BeforeMinimization</td><td rowspan=1 colspan=2>AfterMinimization</td></tr><tr><td rowspan=1 colspan=1>Before</td><td rowspan=1 colspan=1>After</td><td rowspan=1 colspan=1>H</td><td rowspan=1 colspan=1>Acc.(%)</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>Acc.(%)</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>816</td><td rowspan=1 colspan=1>100100</td><td rowspan=1 colspan=1>--</td><td rowspan=1 colspan=1>1328</td><td rowspan=1 colspan=1>100100</td><td rowspan=1 colspan=1>22</td><td rowspan=1 colspan=1>100100</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>816</td><td rowspan=1 colspan=1>100100</td><td rowspan=1 colspan=1>--</td><td rowspan=1 colspan=1>1314</td><td rowspan=1 colspan=1>100100</td><td rowspan=1 colspan=1>33</td><td rowspan=1 colspan=1>100100</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>816</td><td rowspan=1 colspan=1>100100</td><td rowspan=1 colspan=1>--</td><td rowspan=1 colspan=1>3439</td><td rowspan=1 colspan=1>100100</td><td rowspan=1 colspan=1>55</td><td rowspan=1 colspan=1>100100</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>816</td><td rowspan=1 colspan=1>100100</td><td rowspan=1 colspan=1>-1</td><td rowspan=1 colspan=1>1718</td><td rowspan=1 colspan=1>100100</td><td rowspan=1 colspan=1>44</td><td rowspan=1 colspan=1>100100</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>816</td><td rowspan=1 colspan=1>95100</td><td rowspan=1 colspan=1>961</td><td rowspan=1 colspan=1>192316</td><td rowspan=1 colspan=1>96100</td><td rowspan=1 colspan=1>1154</td><td rowspan=1 colspan=1>96100</td></tr><tr><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>99</td><td rowspan=1 colspan=1>816</td><td rowspan=1 colspan=1>9899</td><td rowspan=1 colspan=1>9899</td><td rowspan=1 colspan=1>100518</td><td rowspan=1 colspan=1>9899</td><td rowspan=1 colspan=1>1211</td><td rowspan=1 colspan=1>9899</td></tr><tr><td rowspan=1 colspan=1>7</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>816</td><td rowspan=1 colspan=1>100100</td><td rowspan=1 colspan=1>-1</td><td rowspan=1 colspan=1>25107</td><td rowspan=1 colspan=1>100100</td><td rowspan=1 colspan=1>55</td><td rowspan=1 colspan=1>100100</td></tr></table>
|
| 129 |
+
|
| 130 |
+
# 6 ATARI EXPERIMENTS
|
| 131 |
+
|
| 132 |
+
In this section, we consider applying our technique to RNNs learned for six Atari6 games using the OpenAI gym (Brockman et al., 2016). Unlike the above experiments, where we knew the ground truth MMs, for Atari we did not have any preconception of what the MMs might look and how large they might be. The fact that the input observations for Atari (i.e. images) are much more complex than the previous experiments inputs makes it completely unclear if we can expect similar types of results. There have been other recent efforts towards understanding Atari agents (Zahavy et al., 2016; Greydanus et al., 2017). However, we are not aware of any other work which aims to extract finite state representations for Atari policies.
|
| 133 |
+
|
| 134 |
+
RNN Training. All the Atari agents have the same recurrent architecture. The input observation is an image frame, preprocessed by gray-scaling, $2 \mathbf { x }$ down-sampling, cropping to an $8 0 \times 8 0$ square and normalizing the values to [0, 1]. The network has 4 convolutional layers (kernel size 3, strides 2, padding 1, and 32,32,16,4 filters respectively). We used Relu as the intermediate activation and Relu6 over the last convolutional layer. This is followed by a GRU layer with 32 hidden units and a fully connected layer with $n { + 1 }$ units, where $n$ is the dimension of the Atari action space. We applied a softmax to first $n$ neurons to obtain the policy and used the last neuron to predict the value function. We used the A3C RL algorithm (Mnih et al., 2016) (learning rate $1 0 ^ { - 4 }$ , discount factor 0.99) and computed loss on the policy using Generalized Advantage Estimation $\lambda = 1 . 0$ ) (Schulman et al., 2015). We report the trained RNN performance on our six games in the second column of Table 3.
|
| 135 |
+
|
| 136 |
+
MMN Training. We used the same general architecture for the QBN $b _ { f }$ as used for the MCE experiments, but adjusted the encoder input and decoder output sizes to match the dimension of the continuous observation features $f _ { t }$ . For $b _ { h }$ , the encoder has 3 feed-forward layers with $( 8 \times$ $B _ { h . }$ ), $( 4 \times B _ { h } )$ and $B _ { h }$ nodes. The decoder is symmetric to the encoder. For the Atari domains, the training data for $b _ { f }$ and $b _ { h }$ was generated using noisy rollouts. In particular, each training episode was generated by executing the learned RNN for a random number of steps and then executing an $\epsilon$ -greedy (with $\epsilon = 0 . 3$ ) version of the RNN policy. This is intended to increase the diversity of the training data and we found that it helps to more robustly learn the QBNs. We trained bottlenecks for
|
| 137 |
+
|
| 138 |
+
$B _ { h } \in \{ 6 4 , 1 2 8 \}$ and $B _ { f } \in \{ 1 0 0 , 4 0 0 \}$ noting that these values are significantly larger than for our earlier experiments due to the complexity of Atari. Note that while there are an enormous number of potential discrete states for these values of $B _ { h }$ the actual number of states observed and hence the number of MMN states can be substantially smaller. Each bottleneck was trained to the point of saturation of training loss and then inserted into the RNN to give an MMN for each Atari game.
|
| 139 |
+
|
| 140 |
+
MMN Performance. Table 3 gives the performance of the trained MMNs before and after finetuning for different combinations of $B _ { h }$ and $B _ { f }$ . We see that for 4 games, Pong, Freeway, Bowling, and Boxing, the MMNs after fine tuning either achieve identical scores to the RNN or very close (in the case of boxing). This demonstrates the ability to learn a discrete representation of the input and memory for these complex games with no impact on performance. We see that for Boxing and Pong fine tuning was required to match the RNN performance. In the case of Freeway and Bowling, fine-tuning was not required.
|
| 141 |
+
|
| 142 |
+
In the remaining two games, Breakout and Space Invaders, we see that the MMNs learned after fine tuning achieve lower scores than the original RNNs, though the scores are still relatively good. On further investigation, we found that this drop in performance was due to poor reconstruction on some rare parts of the game. For example, in Breakout, after the first board is cleared, the policy needs to press the fire-button to continue, but the learned MMN does not do this and instead times out, which results in less score. This motivates the investigation into more intelligent approaches for training QBNs to capture critical information in such rare, but critically important, states.
|
| 143 |
+
|
| 144 |
+
MM Minimization. We see from Table 3 that before minimization, the MMs often have relatively large numbers of discrete states and observations. This is unsurprising given that we are using relatively large values of $B _ { h }$ and $B _ { f }$ . However, we see that after minimizing the MMNs the number of states and observations reduces by orders of magnitude, sometimes to just a single state and/or single observation. The number of states and observations in many cases are small enough to write out and analyze by hand, making them amenable to careful analysis. However, this analysis is likely to be non-trivial for moderately complex policies due to the need to understand the “meaning” of the observations and in turn of the states.
|
| 145 |
+
|
| 146 |
+
Understanding Memory Use. We were surprised to observe in Atari the same three types of memory use considered for the MCE domains above. First, we see that the MM for Pong has just three states (one per action) and 10 discrete observation symbols (see Figure 2a). Most importantly we see that each observation transitions to the same state (and hence action) regardless of the current state. So we can view this MM as defining a set of rule that maps individual observations to actions with no memory necessary. In this sense, the Pong policy is analogous to the Amnesia MCE [5.1].
|
| 147 |
+
|
| 148 |
+
In contrast, we see that in both Bowling and Freeway there is only one observation symbol in the minimal MM. This means that the MM actually ignores the input image when selecting actions. Rather the policies are open-loop controllers whose action just depends on the time-step rather than the observations. Thus, these policies are analogous to the Blind MCE [5.1]. Freeway has a particularly trivial policy that always takes the Up action at each time step. While this policy behavior could have been determined by looking at the action sequence of the rollouts, it is encouraging that our MM extraction approach also discovered this. As shown in Figure 2b, Bowling has a more interesting open-loop policy structure where it has an initial sequence of actions and then a loop is entered where the action sequence is repeated. It is not immediately obvious that this policy has such an open-loop structure by just watching the policy. Thus, we can see that the MM extraction approach we use here can provide significant additional insight.
|
| 149 |
+
|
| 150 |
+
Breakout, Space Invaders and Boxing use both memory and observations based on our analysis of the MM transition structures. We have not yet attempted a full semantic analysis of the discrete observations and states for any of the Atari policies. This will require additional visualization and interaction tools and is an important direction of future work that is enabled by our approach.
|
| 151 |
+
|
| 152 |
+
# 7 SUMMARY AND FUTURE WORK
|
| 153 |
+
|
| 154 |
+
Motivated by the goal of better understanding memory use in RNN polices, we introduced an approach for extracting finite state Moore Machines from those policies. The key idea, bottleneck insertion, is to train Quantized Bottleneck Networks to produce binary encodings of continuous RNN memory and input features, and then insert those bottlenecks into the RNN. This yields a near equivalent Moore Machine Network (MMN) which has quantized memory and observation features. From the MMN we then extract a discrete Moore machine that can then be transformed into an equivalent minimal machine for analysis and usage. Our results on two environments where the ground truth machines are known show that our approach is able to accurately extract the ground truth. We also show experiments in six Atari games, where we have no prior insight into the ground truth machines. We show that, in most cases, the learned MMNs maintain similar performance to the original RNN policies. Further, the extracted machines provide insight into the memory usage of the policies. First, we see that the number of required memory states and observations is surprisingly small. Second, we can identify cases where the policy did not use memory in a significant way (e.g. Pong) and policies that relied only on memory and ignored the observations (e.g. Bowling and Freeway). To our knowledge, this is the first work where this type of insight was reported for policies in such complex domains. A key direction for future work is to develop tools and visualizations for attaching meaning to the discrete observations and in turn states, which will allow for an additional level of insight into the policies. It is also worth considering the use of tools for analyzing finite-state machine structure to gain further insight and analyze formal properties of the policies.
|
| 155 |
+
|
| 156 |
+
Table 3: Moore Machine extraction for trained Atari RNN policies. DQN (Mnih et al., 2015), A3C (Mnih et al., 2016) scores have been reported for performance comparison with trained policies.
|
| 157 |
+
|
| 158 |
+
<table><tr><td rowspan="3">Game (# of actions)</td><td rowspan="3">DQN (Score)</td><td rowspan="3">A3C LSTM (Score)</td><td rowspan="3">RNN (Score)</td><td rowspan="3">(Bh,Bf)</td><td colspan="2">Fine-Tuning Score</td><td colspan="3">Before Minimization</td><td colspan="3">After Minimization</td></tr><tr><td>Before</td><td>After</td><td>H</td><td>10</td><td>Score</td><td>间</td><td>10</td><td>Score</td></tr><tr><td>20</td><td>21</td><td>380</td><td>374</td><td>21</td><td></td><td></td><td></td></tr><tr><td rowspan="4">Pong (3)</td><td rowspan="4">18.9</td><td rowspan="4">10.7</td><td rowspan="4">21</td><td>64,100 64,400</td><td>20</td><td>21</td><td>373</td><td>372</td><td>21</td><td>4 3</td><td>12 10</td><td>21 21</td></tr><tr><td>128,100</td><td>20</td><td>21</td><td>383</td><td>373</td><td>21</td><td>3</td><td>12</td><td>21</td></tr><tr><td>128,400</td><td>20</td><td>21</td><td>379</td><td>371</td><td>21</td><td>3</td><td>11</td><td>21</td></tr><tr><td>64,100</td><td>21</td><td>:</td><td>11</td><td>11</td><td>21</td><td>11</td><td>1</td><td>21</td></tr><tr><td rowspan="3">Freeway (3)</td><td rowspan="3">30.3</td><td rowspan="3">0.1</td><td rowspan="3">21</td><td>64,400</td><td>21</td><td></td><td></td><td></td><td>21</td><td></td><td></td><td>21</td></tr><tr><td>128,100 128,400</td><td>21 21</td><td>:</td><td>1 1</td><td>1 1</td><td>21 21</td><td>11</td><td>1 1</td><td>21</td></tr><tr><td>64,100</td><td>32</td><td>423</td><td>1898</td><td>1874</td><td>423</td><td>8</td><td>3</td><td>21 423</td></tr><tr><td rowspan="4">Breakout (4)</td><td rowspan="4">401.2</td><td rowspan="4">766.8</td><td rowspan="4">773</td><td>64,400</td><td>25</td><td>415</td><td>1888</td><td>1871</td><td>415</td><td>8</td><td></td><td>415</td></tr><tr><td>128,100</td><td>41</td><td>377</td><td>1583</td><td>1514</td><td>377</td><td>11</td><td>30</td><td>377</td></tr><tr><td>128,400</td><td>85</td><td>379</td><td>1729</td><td>1769</td><td>379</td><td>8</td><td></td><td>379</td></tr><tr><td>64,100</td><td>520</td><td>1335</td><td>1495</td><td>1502</td><td>1335</td><td>8</td><td></td><td>1335</td></tr><tr><td rowspan="3">Space Invaders (4)</td><td rowspan="3">1976</td><td rowspan="3">23846</td><td rowspan="3">1820</td><td>64,400</td><td>365</td><td>1235</td><td>1625</td><td>1620</td><td>1235</td><td>12</td><td>29</td><td>1235</td></tr><tr><td>128,100</td><td>390</td><td>1040</td><td>1563</td><td>1457</td><td>1040</td><td>12</td><td>35</td><td>1040</td></tr><tr><td>128,400</td><td>520</td><td>1430</td><td>1931</td><td>1921</td><td>1430</td><td>6</td><td>27</td><td>1430</td></tr><tr><td rowspan="4">Bowling (6)</td><td rowspan="4">42.4</td><td rowspan="4">41.8</td><td rowspan="4">60</td><td>64,100 64,400</td><td>60</td><td>-</td><td>49</td><td>1</td><td>60</td><td>33</td><td>1</td><td>60</td></tr><tr><td></td><td>60</td><td>-</td><td>49</td><td>1</td><td>60</td><td>33</td><td>1</td><td>60</td></tr><tr><td>128,100</td><td>60</td><td>-</td><td>26</td><td>11</td><td>60</td><td>24</td><td>T</td><td>60</td></tr><tr><td>128,400</td><td>60</td><td>-</td><td>26</td><td></td><td>60</td><td>24</td><td></td><td>60</td></tr><tr><td rowspan="4">Boxing (18)</td><td rowspan="4">71.8</td><td rowspan="4">37.3</td><td rowspan="4">100</td><td>64,100</td><td>94</td><td>100</td><td>1173</td><td>1167</td><td>100</td><td>13</td><td>79</td><td>100</td></tr><tr><td>64,400</td><td>98</td><td>100</td><td>2621</td><td>2605</td><td>100</td><td>14</td><td>119</td><td>100</td></tr><tr><td>128,100</td><td>94</td><td>97</td><td>2499</td><td>2482</td><td>97</td><td>14</td><td>106</td><td>97</td></tr><tr><td>128,400</td><td>97</td><td>100</td><td>1173</td><td>1169</td><td>100</td><td>14</td><td>88</td><td>100</td></tr></table>
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 2: Moore Machine representation for Atari policies
|
| 162 |
+
|
| 163 |
+
# REFERENCES
|
| 164 |
+
|
| 165 |
+
Leila Arras, Gregoire Montavon, Klaus-Robert M ´ uller, and Wojciech Samek. Explaining recurrent ¨ neural network predictions in sentiment analysis. arXiv preprint arXiv:1706.07206, 2017.
|
| 166 |
+
|
| 167 |
+
Yoshua Bengio, Nicholas Leonard, and Aaron Courville. Estimating or propagating gradients ´ through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
|
| 168 |
+
|
| 169 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 170 |
+
|
| 171 |
+
Adelmo Luis Cechin, D Regina, P Simon, and K Stertz. State automata extraction from recurrent neural nets using k-means and fuzzy clustering. In Chilean Computer Science Society, 2003. SCCC 2003. Proceedings. 23rd International Conference of the, pp. 73–78. IEEE, 2003.
|
| 172 |
+
|
| 173 |
+
Kyunghyun Cho, Bart Van Merrienboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties ¨ of neural machine translation: Encoder-decoder approaches. arXiv preprint arXiv:1409.1259, 2014.
|
| 174 |
+
|
| 175 |
+
Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014.
|
| 176 |
+
|
| 177 |
+
Matthieu Courbariaux, Itay Hubara, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks: Training deep neural networks with weights and activations constrained to $+ 1$ or-1. arXiv preprint arXiv:1602.02830, 2016.
|
| 178 |
+
|
| 179 |
+
Sam Greydanus, Anurag Koul, Jonathan Dodge, and Alan Fern. Visualizing and understanding atari agents. arXiv preprint arXiv:1711.00138, 2017.
|
| 180 |
+
|
| 181 |
+
Geoffrey Hinton. Neural networks for machine learning. video lectures, 2012.
|
| 182 |
+
|
| 183 |
+
Geoffrey E Hinton and Ruslan R Salakhutdinov. Reducing the dimensionality of data with neural networks. science, 313(5786):504–507, 2006.
|
| 184 |
+
|
| 185 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 186 |
+
|
| 187 |
+
Henrik Jacobsson. Rule extraction from recurrent neural networks: Ataxonomy and review. Neural Computation, 17(6):1223–1263, 2005.
|
| 188 |
+
|
| 189 |
+
Andrej Karpathy, Justin Johnson, and Li Fei-Fei. Visualizing and understanding recurrent networks. arXiv preprint arXiv:1506.02078, 2015.
|
| 190 |
+
|
| 191 |
+
Alex Krizhevsky and Geoff Hinton. Convolutional deep belief networks on cifar-10. Unpublished manuscript, 40(7), 2010.
|
| 192 |
+
|
| 193 |
+
Tom Mikolov, Martin Karafiat, Luk Burget, and Sanjeev Khudanpur.´ Recurrent neural network based language model. INTERSPEECH 2010, 11th Annual Conference of the International Speech Communication Association, pp. 1045–1048, 2010. URL http://www.fit.vutbr.cz/research/groups/speech/publi/2010/ mikolov_interspeech2010_IS100722.pdf.
|
| 194 |
+
|
| 195 |
+
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, 2015. doi: 10.1038/nature14236. URL https://storage.googleapis. com/deepmind-media/dqn/DQNNaturePaper.pdf.
|
| 196 |
+
|
| 197 |
+
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 International conference on machine learning, pp. 1928–1937, 2016.
|
| 198 |
+
|
| 199 |
+
W James Murdoch and Arthur Szlam. Automatic rule extraction from long short term memory networks. arXiv preprint arXiv:1702.02540, 2017.
|
| 200 |
+
|
| 201 |
+
Christian W Omlin and C Lee Giles. Extraction of rules from discrete-time recurrent neural networks. Neural networks, 9(1):41–52, 1996.
|
| 202 |
+
|
| 203 |
+
Marvin C Paull and Stephen H Unger. Minimizing the number of states in incompletely specified sequential switching functions. IRE Transactions on Electronic Computers, (3):356–367, 1959.
|
| 204 |
+
|
| 205 |
+
Silviu Pitis. Beyond binary: Ternary and one-hot neurons. https://r2rt.com/ beyond-binary-ternary-and-one-hot-neurons.html, 2017.
|
| 206 |
+
|
| 207 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. Highdimensional continuous control using generalized advantage estimation. arXiv preprint arXiv:1506.02438, 2015.
|
| 208 |
+
|
| 209 |
+
David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, Yutian Chen, Timothy Lillicrap, Fan Hui, Laurent Sifre, George van den Driessche, Thore Graepel, and Demis Hassabis. Mastering the game of Go without human knowledge. Nature Publishing Group, 550, 2017. doi: 10.1038/nature24270. URL https://www.nature.com/nature/journal/ v550/n7676/pdf/nature24270.pdf.
|
| 210 |
+
|
| 211 |
+
Hendrik Strobelt, Sebastian Gehrmann, Bernd Huber, Hanspeter Pfister, and Alexander M Rush. Visual analysis of hidden state dynamics in recurrent neural networks. arXiv preprint arXiv:1606.07461, 2016.
|
| 212 |
+
|
| 213 |
+
Peter Tino, Bill G Horne, C Lee Giles, and Pete C Collingwood. Finite state machines and recurrent ˇ neural networksautomata and dynamical systems approaches. In Neural networks and pattern recognition, pp. 171–219. Elsevier, 1998.
|
| 214 |
+
|
| 215 |
+
Masaru Tomita. Dynamic construction of finite-state automata from examples using hill-climbing. In Proceedings of the Fourth Annual Conference of the Cognitive Science Society, pp. 105–108, 1982.
|
| 216 |
+
|
| 217 |
+
Raymond L Watrous and Gary M Kuhn. Induction of finite-state automata using second-order recurrent networks. In Advances in neural information processing systems, pp. 309–317, 1992.
|
| 218 |
+
|
| 219 |
+
Gail Weiss, Yoav Goldberg, and Eran Yahav. Extracting automata from recurrent neural networks using queries and counterexamples. arXiv preprint arXiv:1711.09576, 2017.
|
| 220 |
+
|
| 221 |
+
Tom Zahavy, Nir Ben-Zrihem, and Shie Mannor. Graying the black box: Understanding dqns. In International Conference on Machine Learning, pp. 1899–1908, 2016.
|
| 222 |
+
|
| 223 |
+
Zheng Zeng, Rodney M Goodman, and Padhraic Smyth. Learning finite state machines with selfclustering recurrent networks. Neural Computation, 5(6):976–990, 1993.
|
| 224 |
+
|
| 225 |
+
# APPENDIX
|
| 226 |
+
|
| 227 |
+
# 7.1 FORMAL DEFINITION OF MODE COUNTER ENVIRONMENT
|
| 228 |
+
|
| 229 |
+
An MCE is parameterized by the mode number $M$ , a mode transition function $P$ , a mode life span mapping $\Delta ( m )$ that assigns a positive integer to each mode, and a count set $C$ containing zero or more natural numbers. At time $t$ the MCE hidden state is a tuple $( m _ { t } , c _ { t } )$ , where $\overline { { m _ { t } } } ~ \in ~ \{ 1 , 2 , \dots , M \}$ is the current mode and $c _ { t }$ is the count of time-steps that the system has been consecutively in mode $m _ { t }$ . The mode only changes when the lifespan is reached, i.e. $c _ { t } = \Delta ( m _ { t } ) - 1$ , upon which the next mode $m _ { t + 1 }$ is generated according to the transition distribution $P ( m _ { t + 1 } \mid m _ { t } )$ . The transition distribution also specifies the distribution over initial modes. The agent does not directly observe the state, but rather, the agent only receives a continuous-valued observations $o _ { t } \in [ 0 , 1 ]$ at each step, based on the current state $( m _ { t } , c _ { t } )$ . If $c _ { t } \in C$ then $o _ { t }$ is drawn uniformly at random from $[ m _ { t } / M , ( m _ { t } + 1 ) / M ) ]$ and otherwise $o _ { t }$ is drawn uniformly at random from [0, 1]. Thus, observations determine the mode when the mode count is in $C$ and otherwise the observations are uninformative. Note that the agent does not observe the counter. This means that to keep track of the mode for optimal performance the agent must remember the current mode and use memory to keep track of how long the mode has been active, in order to determine when it needs to “pay attention” to the current observation.
|
| 230 |
+
|
| 231 |
+
We conduct experiments with the following three MCE instances 7: 1) Amnesia. This MCE uses $\Delta ( m ) = 1$ for all modes, $C = \{ 0 \}$ , and uniformly samples random initial mode and transition distributions. Thus, an optimal policy will not use memory to track information from the past, since the current observation alone determines the current mode. This tests our ability to use MMN extraction to determine that a policy is purely reactive, i.e. not using memory. 2) Blind. Here we use deterministic initial mode and transition distributions, mode life spans that can be larger than 1, and $C = \{ \}$ . Thus, the observations provide no information about the mode and optimal performance can only be achieved by using memory to keep track of the deterministic mode sequence. This allows us to test whether the extraction of an MMN could infer that the recurrent policy is ignoring observations and only using memory. 3) Tracker. This MCE is identical to Amnesia, except that the $\Delta ( m )$ values can be larger than 1. This requires an optimal policy to pay attention to observations when $c _ { t } = 0$ and use memory to keep track of the current mode and mode count. This is the most general instance of the environment and can result in difficult problems when the number of modes and their life-spans grow. In all above instances, we used $M = 4$ .
|
| 232 |
+
|
| 233 |
+
# 7.2 GROUND TRUTH MCE MOORE MACHINES
|
| 234 |
+
|
| 235 |
+

|
| 236 |
+
Figure 3: Moore machine representation of Mode Counter Environments (MCE). We use $\cdot _ { m }$ ’ to indicate the activate mode/action required in that state. Given $M = 4$ , we have 4 observations classes, $o _ { 1 } = ( 0 , 0 . 2 5 ]$ , $o _ { 2 } = ( 0 . 2 5 , 0 . 5 ]$ , $o _ { 3 } = ( 0 . 5 , 0 . 7 5 ]$ and $o _ { 4 } = ( 0 . 7 5 , 1 ]$ . Also, $^ { O _ { * } }$ implies that the transaction is valid for all observations. The minimal moore machines extracted by our approach from trained RNN policies exactly matches these ground truth machines.
|
| 237 |
+
|
| 238 |
+

|
| 239 |
+
Figure 4: Extracted Moore machine representation for Tomita Grammar policies where $B _ { h } = 1 6$ . We use ‘A’ and $\cdot _ { \mathrm { R } } \cdot$ to denote accept and reject states, respectively. Other than Grammar 6, all machines are $100 \%$ accurate.
|
md/train/S1q_Cz-Cb/S1q_Cz-Cb.md
ADDED
|
@@ -0,0 +1,508 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TRAINING NEURAL MACHINES WITH PARTIAL TRACES
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We present a novel approach for training neural machines which incorporates additional supervision on the machine’s interpretable components (e.g., neural memory). To cleanly capture the kind of neural machines to which our method applies, we introduce the concept of a differential neural computational machine $\left( \partial \mathbf { N } \mathbf { C M } \right)$ and show that several existing architectures (e.g., NTMs, NRAMs) can be instantiated as a $\partial { \bf N C M }$ and can thus benefit from any amount of additional supervision over their interpretable components. Based on our method, we performed a detailed experimental evaluation with NTM and NRAM machines, showing the approach leads to significantly better convergence and generalization capabilities of the learning phase than standard training using only input-output examples.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recently, there has been substantial interest in neural abstract machines that can induce programs from examples Feser et al. (2015; 2016); Frankle et al. (2016); Gaunt et al. (2017); Graves et al. (2014; 2016); Kaiser & Sutskever (2016); Kurach et al. (2016); Reed & de Freitas (2016); Vinyals et al. (2015); Zaremba & Sutskever (2015); Zhang et al. (2015). While significant progress has been made towards learning interesting algorithms Graves et al. (2016), ensuring the training of these machines converges to the desired solution can be very challenging. Interestingly however, even though these machines differ architecturally, they tend to rely on components (e.g., neural memory) that are more interpretable than a typical neural network (e.g., an LSTM). A key question then is:
|
| 12 |
+
|
| 13 |
+
Can we somehow provide additional amounts of supervision for these interpretable components during training so to bias the learning towards the desired solution?
|
| 14 |
+
|
| 15 |
+
In this work we investigate this question in depth. We refer to the type of supervision mentioned above as partial trace supervision, capturing the intuition that more detailed information, beyond inputoutput examples, is provided during learning. To study the question systematically, we introduce the notion of a differential neural computational machine (∂NCM), a formalism which allows for clean characterization of the neural abstract machines that fall inside our class and that can benefit from any amount of partial trace information. We show that common architectures such as Neural Turing Machines (NTMs) and Neural Random Access Machines (NRAMs) can be phrased as ∂NCMs, useful also because these architectures form the basis for many recent extensions, e.g., Graves et al. (2016); Grefenstette et al. (2015); Kaiser & Sutskever (2016). We also explain why other machines such as the Neural Program Interpreter (NPI) Reed & de Freitas (2016) or its recent extensions (e.g., the Neural Program Lattice Li et al. (2017)) cannot be instantiated as an $\partial { \bf N C M }$ and are thus restricted to require large (and potentially prohibitive) amounts of supervision. We believe the $\partial { \bf N } { \bf C M }$ abstraction is a useful step in better understanding how different neural abstract machines compare when it comes to additional supervision. We then present $\partial { \bf N } { \bf C M }$ loss functions which abstractly capture the concept of partial trace information and show how to instantiate these for both the NTM and the NRAM. We also performed an extensive evaluation for how partial trace information affects training in both architectures. Overall, our experimental results indicate that the additional supervision can substantially improve convergence while leading to better generalization and interpretability.
|
| 16 |
+
|
| 17 |
+
To provide an intuition for the problem we study in this work, consider the simple task of training an NTM to flip the third bit in a bit stream (called Flip3rd) – such bitstream tasks have been extensively studied in the area of program synthesis (e.g., Jha et al. (2010); Raychev et al. (2016)). An example input-output pair for this task could be $[ 0 , 1 , 0 , 0 ] [ 0 , 1 , 1 , 0 ]$ . Given a set of such examples, our goal is to train an NTM that solves this task. An example NTM that generalizes well and is understandable is shown in Figure 1c. Here, the y-axis is time (descending), the $\mathbf { X }$ -axis is the accessed memory location, the white squares represent the write head of the NTM, and the orange squares represent the read head. As we can see, the model writes the input sequence to the tape and then reads from the tape in the same order. However, in the absence of richer supervision, the NTM (and other neural architectures) can easily overfit to the training set – an example of an overfitting NTM is shown in Figure 1a. Here, the traces are chaotic and difficult to interpret. Further, even if the NTM generalizes, it can do so with erratic reads and writes, an example of which is shown in Figure 1b. Here, the NTM learns to read from the third bit (circled) with a smaller weight than from other locations, and also reads and writes erratically near the end of the sequence. This model is less interpretable than the one in Figure 1c because it is unclear how the model knows which the third bit actually is, or why a different read weight would help flip that bit.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Traces of locations accessed by read/write heads for the Flip3rd task in three different training setups. The y-axis represents time (descending); $\mathbf { X }$ -axis represents head locations. First two NTMs are trained without partial trace information. White represents the distribution of the write head; orange the distribution of the read head; (b) and (c) generalize and are more interpretable than (a); (c) was trained using partial trace information and is more interpretable than (b).
|
| 21 |
+
|
| 22 |
+
In this work we will develop principled ways for guiding the training of a neural abstract machine towards the behavior shown in Figure 1c. For instance, for Flip3rd, providing partial trace information on the NTM’s read heads for $10 \%$ of the input-output examples is sufficient to bias the learning towards the NTM shown in Figure 1c $100 \%$ of the time.
|
| 23 |
+
|
| 24 |
+
# 2 NEURAL COMPUTATIONAL MACHINES
|
| 25 |
+
|
| 26 |
+
To capture the essence of our method and illustrate its applicability, we now define the abstract notion of a neural computational machine (NCM). NCMs mimic classic computational machines with a controller and a memory, and generalize multiple existing architectures. Our approach for supervision with partial trace information applies to all neural architectures expressible as NCMs. A useful feature of the NCM abstraction is that it clearly delineates end-to-end differentiable architectures (Graves et al. (2014)’s NTM, Kurach et al. (2016)’s NRAM), which can train with little to no trace supervision, from architectures that are not end-to-end differentiable (Reed & de Freitas (2016)’s NPI) and hence require a certain minimum amount of trace information. In the follow-up section, we show how to phrase two existing neural architectures (NTMs and NRAMs) as an NCM.
|
| 27 |
+
|
| 28 |
+
An NCM is a triple of functions: a processor, a controller, and a loss:
|
| 29 |
+
|
| 30 |
+
Processor The processor $\pi : W \times C \times M \to B \times M$ performs a pre-defined set of commands $C$ , which might involve manipulating memories in $M$ . The commands may produce additional feedback in $B$ . Also, the processor’s operation may depend on parameters in $W$ .
|
| 31 |
+
|
| 32 |
+
Controller The controller $\kappa : W \times B \times Q \times I C \times Q \times O$ decides which operations the machine performs at each step. It receives external inputs from $I$ and returns external outputs in $O$ . It can also receive feedback from the processor and command it to do certain operations (e.g., memory read). The decisions the controller takes may depend on its internal state (from $Q$ ). The controller can also depend on parameters in $W$ . For instance, if the controller is a neural network, then the network’s weights will range over $W$ .
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
Figure 2: (a) is depiction of the generic NCM structure (b) is a high-level overview of an NTM and (c) is a high level overview of the NRAM architecture. The controller outputs a circuit, which in this case contains the modules READ, ADD, SUB, LT, and WRITE. The controller encodes the two inputs to the modules as probability vectors, $a , b$ and $c$ , over the possible choices. The most likely choice is shown in green. The only input to the controller are the registers $r _ { 1 }$ and $r _ { 2 }$ .
|
| 36 |
+
|
| 37 |
+
Loss Function The loss function $L _ { e } : T r a c e \times E \mathbb { R }$ indicates how close a trace $\tau \in T r a c e$ of an execution of the machine (defined below) is to a behavior from a set $E$ . The loss function provides a criterion for training a machine to follow a prescribed set of behaviors, and hence we impose certain differentiability conditions. We require that the loss surface is continuous and piecewise differentiable with respect to the weights $w \in W$ for all examples $e$ and inputs $x$ with traces $\tau ( w , x )$ :
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
l ( w ; x , e ) = L _ { e } ( \tau ( w , x ) , e )
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
Execution The execution of the machine begins with an input sequence $x = \{ x _ { t } \} _ { 1 } ^ { n }$ and initial values of the controller state $q _ { 0 }$ , memory $m _ { 0 }$ , and processor feedback $b _ { 0 }$ . At each time step $t = 1 \ldots n$ controller and processor take turns executing according to the following equations:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\begin{array} { c } { { ( c _ { t } , q _ { t } , y _ { t } ) = \kappa ( w , b _ { t - 1 } , q _ { t - 1 } , x _ { t } ) } } \\ { { ( b _ { t } , m _ { t } ) = \pi ( w , c _ { t } , m _ { t - 1 } ) } } \end{array}
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
A trace $\tau ( w , x , b _ { 0 } , m _ { 0 } , q _ { 0 } ) = \{ ( c _ { t } , b _ { t } , q _ { t } , y _ { t } , m _ { t } ) \} _ { 1 } ^ { n }$ records these quantities’ values at each time step.
|
| 50 |
+
We will occasionally write $\tau _ { C } , \tau _ { B } , \ldots$ for the trace projected onto one of its components $c , b , \ldots$ .
|
| 51 |
+
|
| 52 |
+
∂NCMs Note that the differentiability conditions that we impose on the loss do not imply that any of the NCM functions $\pi$ , $\kappa$ and $L _ { e }$ are continuous or differentiable. They indeed can be highly discontinuous as in NCMs like Weston et al. (2014)’s memory networks with a hard attention mechanism, or as in Reed $\&$ de Freitas (2016)’s neural programmer-interpreters. In order to fix these discontinuities and recover a differentiable loss surface, these architectures train with strong supervision only: the training examples $e \in E$ must provide a value for every traced quantity that comes from a discontinuous parameter.
|
| 53 |
+
|
| 54 |
+
In contrast, what we call differentiable neural computational machines (∂NCM), have $\kappa , \pi$ and $L _ { e }$ continuous and piecewise differentiable. In this case, the loss surface is differentiable with respect to every parameter. Thus, there is no need to specify corresponding values in the examples, and so we can train with as much trace information as available.
|
| 55 |
+
|
| 56 |
+
# 3 NTMS AND NRAMS AS NCMS
|
| 57 |
+
|
| 58 |
+
We now show how NTMs and NRAMs can be instantiated as ∂NCMs.
|
| 59 |
+
|
| 60 |
+
NTM as ∂NCM An Neural Turing Machine (NTM) Graves et al. (2014) (Figure 2b) has access to a memory $\mathcal { M } \in \mathbb { R } ^ { c \times n }$ of $c$ cells of $n$ real numbers each. We suppose the machine has one read head and one write head, whose addresses are, respectively, the probability vectors $r , w \in [ 0 , 1 ] ^ { \{ 1 \ldots c \} }$ At every time step, the read head computes the expected value $m \in \mathbb { R } ^ { n }$ of a random cell at index $i \sim r$ . This value together with the current input are fed into a controller neural network, which then decides on several commands. It decides what fraction $e \in \mathbb { R } ^ { n }$ to erase and how much $a \in \mathbb { R } ^ { n }$ to add to the cells underneath the write head. The write head stores the tape expected after a random modification at index $i \sim w$ . Then the controller indicates the head movement with two probability vectors $\Delta r , \Delta w \in [ 0 , 1 ] ^ { \{ - 1 , 0 , + 1 \} }$ which are convolved with the respective head addresses (the actual addressing mechanism is more involved, but we omit it for brevity) Finally, the controller produces the current output value. In terms of NCMs, the NTM’s variables fall into the following classes:
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\frac { \mathrm { I } / \mathrm { O } } { x \in I } \qquad \begin{array} { r l r } { \mathrm { S t a t e } } & { } & { \mathrm { C o m m u n i c a t i o n } } \\ { q \in Q } & { ( e , a , \Delta r , \Delta w ) \in C } \\ { y \in O } & { ( r , w , \mathcal { M } ) \in M } & { m \in B } \end{array}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
Each of these variables change over time according to certain equations (see Appendix A for details). The processor $\pi$ and the controller $\kappa$ functions for each time step satisfy:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\begin{array} { r l } & { ( ( e _ { t } , a _ { t } , \Delta r _ { t } , \Delta w _ { t } ) , \ q _ { t } , \ y _ { t } ) = \kappa ( w , m _ { t } , q _ { t - 1 } , x _ { t } ) } \\ & { \qquad ( m _ { t + 1 } , \ ( r _ { t } , w _ { t } , M _ { t } ) ) = \pi ( ( e _ { t } , a _ { t } , \Delta r _ { t } , \Delta w _ { t } ) , \ ( r _ { t - 1 } , w _ { t - 1 } , \mathcal { M } _ { t - 1 } ) ) . } \end{array}
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
The standard loss function $L _ { e }$ for the NTM simply includes a term, such as cross-entropy or $L _ { 2 }$ distance, for the machine output at every time step. Each of these compare the machine output to the respective values contained in the examples $e \in E$ .
|
| 73 |
+
|
| 74 |
+
NRAM as ∂NCM A Neural Random Access Machine (NRAM) Kurach et al. (2016) is a neural machine designed for ease of pointer (de-)referencing. An NRAM has a variable sized memory $\mathcal { M } \in \mathbb { R } ^ { c \times c }$ whose size varies between runs. It also has access to a register file $r \in \mathbb { R } ^ { n \times c }$ with a constant number $n$ of registers. Both the memory and the registers store probability vectors over $\{ 1 \ldots c \}$ . The controller receives no external inputs, but at each time step reads the probability that a register assigns to 0. It also produces no external output, except a probability $f \in [ 0 , 1 ]$ for termination at the current time step. The output of the run is considered to be the final memory state.
|
| 75 |
+
|
| 76 |
+
Unlike the NTM, computation in the NRAM is performed by a fixed sequence of modules. Each module implements a simple integer operation/memory manipulation lifted to probability vectors. For example, addition lifts to convolution, while memory access is like that of the NTM. At every time step the controller organizes the sequence of modules into a circuit, which is then executed. The circuit is encoded by a pair of probability distributions per module, as shown in Figure $_ { 2 \mathrm { c } }$ . These distributions specify respectively which previous modules or registers will provide a given module first/second arguments. The distributions are stacked in the matrices $a$ and $b$ . A similar matrix $c$ is responsible for specifying what values should be written to the registers at the end of the time step. The NCM instantiation of an NRAM is the following:
|
| 77 |
+
|
| 78 |
+
<table><tr><td>I/0</td><td>State Communication</td></tr><tr><td>{1}=I qt∈Q</td><td>(at,bt,ct) ∈C</td></tr><tr><td>ft∈O (rt,Mt) ∈ M</td><td>Tt,-,0 ∈B</td></tr></table>
|
| 79 |
+
|
| 80 |
+
The equations that determine these quantities can be found in Appendix B. The processor function $\pi$ and the controller function $\kappa$ expressed in terms of these quantities are:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\begin{array} { r l } & { ( ( a _ { t } , b _ { t } , c _ { t } ) , h _ { t } , f _ { t } ) = \kappa ( w , r _ { ( t - 1 ) , - , 0 } , h _ { t - 1 } , 1 ) } \\ & { ( r _ { t , - , 0 } , ( r _ { t } , \mathcal { M } _ { t } ) ) = \pi ( ( a _ { t } , b _ { t } , c _ { t } ) , \ ( r _ { t - 1 } , \mathcal { M } _ { t - 1 } ) ) . } \end{array}
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
The loss of the NRAM is more complex than the NTM loss: it is an expectation with respect to the probability distribution $p$ of termination time, as determined by the termination probabilities $f _ { t }$ (see Appendix B). For every $t = 1 \ldots k$ , the loss considers the negative log likelihood that the $i$ -th memory cell at that time step equals the value $e _ { i }$ provided in the example, independently for each $i$ :
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
L _ { e } ( \tau , e ) = - \sum _ { t < k } p _ { t } \sum _ { i < c } \log ( \mathcal { M } _ { t , i , e _ { i } } ) .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
# 4 SUBTRACE SUPERVISION OF NCMS
|
| 93 |
+
|
| 94 |
+
Incorporating supervision during NCM training can be helpful with: (i) convergence: additional bias may steer the minimization of the NCM’s loss function $L _ { e }$ , as much as possible, away from local minima that do not correspond to good solutions, (ii) interpretability: the bias can also be useful in guiding the NCM towards learning a model that is more intuitive/explainable to a user (especially if the user already has an intuition on what it is that parts of the model should do), and (iii) generalization: the bias can steer the NCM towards solutions which minimize not just the loss on example of difficulties it has seen, but on significantly more difficult examples.
|
| 95 |
+
|
| 96 |
+
The way we provide additional supervision to NCMs is, by encoding, for example, specific commands issued to the processor, into extra loss terms. Let us illustrate how we can bias the learning with an NTM. Consider the task of copying the first half of an input sequence $\{ x _ { t } \} _ { 1 } ^ { 2 l }$ into the second half of the machine’s output $\{ y _ { t } \} _ { 1 } ^ { 2 l }$ , where the last input $x _ { l }$ from the first half is a special value indicating that the first half ended. Starting with both heads at position 1, the most direct solution is to consecutively store the input to the tape during the first half of the execution, and then recall the stored values during the second half. In such a solution, we expect the head positions to be:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
w _ { t } = p ( t ) = { \left\{ \begin{array} { l l } { { \mathrm { o n e - h o t } } ( t ) } & { { \mathrm { i f ~ } } t = 1 \dots l } \\ { { \mathrm { o n e - h o t } } ( l ) } & { { \mathrm { i f ~ } } t \geq l + 1 } \end{array} \right. } \quad r _ { t } = q ( t ) = { \left\{ \begin{array} { l l } { { \mathrm { o n e - h o t } } ( 1 ) } & { { \mathrm { i f ~ } } t = 1 \dots l } \\ { { \mathrm { o n e - h o t } } ( t - l ) } & { { \mathrm { i f ~ } } t \geq l + 1 } \end{array} \right. }
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
To incorporate this information into the training, we add loss terms that measure the cross-entropy $( H )$ between $p ( t )$ and $w _ { t }$ as well as between $q ( t )$ and $r _ { t }$ . Importantly, we need not add terms for every time-step, but instead we can consider only the corner cases where heads change direction:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\sum _ { t = 1 , l + 1 , 2 l } H ( p ( t ) , w _ { t } ) + H ( q ( t ) , r _ { t } ) .
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
# 4.1 GENERIC SUBTRACE LOSS FOR NCMS
|
| 109 |
+
|
| 110 |
+
We now describe the general shape of the extra loss terms for arbitrary NCMs. Since, typically, we can interpret only the memory and the processor in terms of well-understood operations, we will consider loss terms only for the memory state and the communication flow between the controller and the processor. We leave the controller’s hidden state unconstrained – this also permits us to use the same training procedure with different controllers.
|
| 111 |
+
|
| 112 |
+
The generic loss is expressed with four loss functions for the different components of an NCM trace:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\begin{array} { r l r l } & { L _ { C } : C \times E _ { C } \to \mathbb { R } \quad } & & { L _ { B } : B \times E _ { B } \to \mathbb { R } } \\ & { L _ { O } : O \times E _ { O } \to \mathbb { R } \quad } & & { L _ { M } : M \times E _ { M } \to \mathbb { R } } \end{array}
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
For each part $\alpha \in \{ C , B , O , M \}$ , we provide hints $( t , v , \mu ) \in \sigma _ { \alpha }$ that indicate a time step $t$ at which the hint applies, an example $v \in E _ { \alpha }$ for the relevant component, and a weight $w \in \mathbb { R }$ of the hint. The weight is included to account for hints having a different importance at different time-steps, but also to express our confidence in the hint, e.g., hints coming from noisy sources would get less weight.
|
| 119 |
+
|
| 120 |
+
A subtrace $\sigma$ is a collection of hints used for a particular input-output example $e$ . We call it a subtrace because, typically, it contains hints for a proper subset of the states traced by the NCM during execution. The net loss for a given input-output example and subtrace equals the original loss $L _ { e }$ added to the weighted losses for all the hints, scaled by a constant factor $\lambda$ :
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
L ( \tau , ( \sigma , e ) ) = L _ { e } ( \tau , e ) + \lambda \frac { \sum _ { \alpha \in \{ C , B , O , M \} } \sum _ { ( t , v , \mu ) \in \sigma _ { \alpha } } \mu L _ { \alpha } ( \tau _ { \alpha , t } , v ) } { \sum _ { \alpha \in \{ C , B , O , M \} } \sum _ { ( t , v , \mu ) \in \sigma _ { \alpha } } \mu }
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 3: An example circuit for the task of adding one to all memory cells. The arrows for register updates are shown in red. Technically, modules take two arguments, but some ignore an argument, such as INC or READ. For them, we show only the relevant arrows.
|
| 128 |
+
|
| 129 |
+
# 4.2 SUBTRACES FOR NTM
|
| 130 |
+
|
| 131 |
+
For NTMs, we allow hints on the output $y$ , the addresses $r$ and $w$ , and the tape $\mathcal { M }$ . We include extra loss terms for the memory state only (all other loss terms are zero):
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\begin{array} { r } { \begin{array} { r l } & { L _ { M } ( ( r _ { t } , w _ { t } , \mathcal { M } _ { t } ) , ( \mathrm { w r } , v ) ) = H ( v , w _ { t } ) } \\ & { L _ { M } ( ( r _ { t } , w _ { t } , \mathcal { M } _ { t } ) , ( \mathrm { r d } , v ) ) = H ( v , r _ { t } ) } \end{array} } \end{array}
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
Unlike the output and addresses, values on the tape are interpreted according to an encoding internal to the controller (which emerges only during training). Forcing the controller to use a specific encoding for the tape, as we do with NTM output, can have a negative effect on training (in our experiments, training diverged consistently). To remedy this, we do not apply loss to the tape directly but to a decoded version of a cell on the tape. While a decoder might find multiple representations and overfit, we found that it forced just enough consistency to improve the convergence rate. The decoder itself is an auxiliary network $\phi$ trained together with the NTM, which takes a single cell from memory as input. The output of the decoder is compared against the expected value which should be in that cell:
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
L _ { M } ( ( - , - , \mathcal { M } _ { t } ) , ( \mathsf { t a p e } , i , v ) ) = H ( \phi ( \mathcal { M } _ { t , i } ) , v ) .
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
For all subtraces we provide in our experiments with NTMs, the hints have the same unit weight.
|
| 144 |
+
|
| 145 |
+
# 4.3 SUBTRACES FOR NRAM
|
| 146 |
+
|
| 147 |
+
For NRAMs, we hint which connections should be present in the circuit the controller constructs at each step, including the ones for register updates. An example circuit is shown in Figure 3. In terms of an NCM, this amounts to providing loss for commands and no loss for anything else. We set the loss to the negative log likelihood of the controller choosing specific connections revealed in the hint:
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\begin{array} { r l } & { L _ { C } ( ( a _ { t } , b _ { t } , c _ { t } ) , ( \mathrm { m o d u l e } , m , i , j ) ) = - \log ( a _ { t , m , i } ) - \log ( b _ { t , m , j } ) } \\ & { L _ { C } ( ( a _ { t } , b _ { t } , c _ { t } ) , ( \mathrm { r e g i s t e r } , r , i ) ) = - \log ( c _ { t , r , i } ) } \end{array}
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
In our experiments, we observed that assigning higher weight to hints at earlier timesteps is crucial for convergence of the training process. For a hint at time-step $t$ , we use the weight $\mu \bar { = } ( t + 1 ) ^ { - 2 }$ . A possible reason for why this helps is that the machine’s behavior at later time-steps is highly dependent on its behavior at the early time-steps. Thus, the machine cannot reach a later behavior that is right before it fixes its early behavior. Unless the behavior is correct early on, the loss feedback from later time-steps will be mostly noise, masking the feedback from early time-steps.
|
| 154 |
+
|
| 155 |
+
Other Architectures The NCM can be instantiated to architectures as diverse as a common LSTM network or End-To-End Differentiable Memory Networks. Any programming inducing neural network with at least partially interpretable intermediate states for which the dataset contains additional hints could be considered a good candidate for application of this abstraction.
|
| 156 |
+
|
| 157 |
+
# 5 EXPERIMENTAL EVALUATION
|
| 158 |
+
|
| 159 |
+
We evaluated our NCM supervision method on the NTM and NRAM architectures. For each of the two architectures we implemented a variety of tasks and experimented with different setups of trace supervision. The main questions that we address are: (i) does trace supervision help convergence, interpretability, and generalization? (ii) how much supervision is needed to train such models? Below, we summarize our findings – further details are provided in the appendix.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 4: Relative percentage of training instances which generalized out of ten runs per task for the NTM. We provide a subtrace $100 \%$ of the time and use $\lambda = 1$ . $\mathbf { X }$ -axis shows the type of supervision.
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 5: The number of initial runs which generalized for Flip3rd. The first dimension listed in the rows controls the execution details revealed in a subtrace, while the second dimension (the density column) controls the proportion of examples that receive extra subtrace supervision.
|
| 166 |
+
|
| 167 |
+
Subtraces For NTMs We measured how often we successfully trained an NTM that achieves strong generalization. We consider a model to generalize if relative to the training size limit $n$ , it achieves perfect accuracy on all of tests of $\mathrm { s i z e } \le 1 . 5 n$ , and perfect accuracy on $90 \%$ of the tests of size $\leq 2 n$ . Figure 4 reports the average improvement compared to a baseline using only $\mathrm { I / O }$ examples. We ran experiments with four different tasks and various types of hints (cf. Appendices C, E). Some of the hint types are: read and write specify respective head addresses for all time steps; address combines the previous two; corner reveals the head addresses, but only when the heads change direction; value gives value for a single cell. Except for three cases, trace supervision helped improve generalization. Here, RepeatFlip3d is most challenging, with baseline generalizing only $5 \%$ of the time (cf. Appendix I). Here we have the largest improvement with extra supervision: corner type of hints achieve eight-fold increase in success rate, reaching $40 \%$ . Another task with an even larger ratio is RepeatCopyTwice (cf. Appendix), where success increases from $1 5 . 5 \%$ to $100 \%$ .
|
| 168 |
+
|
| 169 |
+
In addition to this experiment, we performed an extensive evaluation of different setups, varying the global $\lambda$ parameter of the loss Eq. 8, and providing hints for just a fraction of the examples. The full results are in Appendix I; here we provide those for RepeatFlip3d in Table 5. The table reveals that the efficacy of our method heavily depends on these two parameters. The best results in this case are for the read/corner type of hints $\mathbf { \dot { \frac { 1 } { 2 } } } / \mathbf { \frac { 1 } { 1 0 } } ^ { - }$ of the time, with $\bar { \lambda } \in \{ 0 . 1 , 1 \}$ . The best results for other tasks are achieved with different setups. Generally, our conclusion is that training with traces $50 \%$ of the time usually improves performance (or does not lower it much) when compared to the best method. This observation raises the interesting question of what the best type and amount of hints are for a given task.
|
| 170 |
+
|
| 171 |
+
Finally, we observed that in all cases where training with trace supervision converged, it successfully learned the head movements/tape values we had intended. This show that trace supervision can bias the architecture towards more interpretable behaviors. In those cases, the NTM learned consistently sharper head positions/tape values than the baseline, as Figure 6 shows for Flip3rd.
|
| 172 |
+
|
| 173 |
+
Effect of Subtraces For NRAMs Ease of generalization for the NRAM is a known issue, with Neelakantan et al. (2015) reporting that ListK for example generalizes poorly, even when trained with noise in the gradient, curriculum learning, and an entropy bonus. We observed that when run on an indefinite number of examples with the correct number of timesteps and a correct module sequence, Swap and Increment would in fact occasionally generalize perfectly, but did not have the resources to run such indefinite tests with Permute, ListK, and Merge.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 6: Execution traces of two NTMs trained on $\mathtt { F 1 1 p 3 r d }$ until generalization. First is baseline (no trace supervision); second is trained with corner hints. Time flows top to bottom. The first pane from every pair shows the value written to tape; second shows head locations. Figures show that a little extra supervision helps the NTM write sharper 0–1 values and have more focused heads.
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 7: (a) average number of errors after training had completed for NRAM. Observe that full training results in a significantly higher percent of generalization after training stopped. (b) shows the distribution of errors to problem length for Permute (one character of noise in $10 \%$ of samples).
|
| 180 |
+
|
| 181 |
+
Figure 7a demonstrates that when training had finished, either because it had ended early or had reached 5000 training examples (our upper bound), generalization would in fact be on average significantly better than the baseline the more hints that were used for all tasks. Here, number of hints used seemed to be a sufficient predictor for the quality of the trained model.
|
| 182 |
+
|
| 183 |
+
Robustness to Noise The effect of increasing supervision on the quality of the trained model was so strong that not even noise in the input was able to significantly hinder generalization. In Figure 7b, we corrupted a single character in the output examples for the Permute problem in $10 \%$ of the examples. We found that without any extra hints, no convergence was seen after training was complete, whereas with just corner subtraces, the generalization was nearly optimal.
|
| 184 |
+
|
| 185 |
+
Furthermore, we found that noise in the trace does not seriously harm performance. We corrupted a single hint for $20 \%$ of the traces of the Increment task using otherwise full supervision, as can be seen in the NoisyFull line of Figure 14.
|
| 186 |
+
|
| 187 |
+
# 6 CONCLUSION
|
| 188 |
+
|
| 189 |
+
We presented a method for incorporating (any amount of) additional supervision into the training of neural abstract machines. The basic idea was to provide this supervision (called partial trace information) over the interpretable components of the machine and to thus more effectively guide the learning towards the desired solution. We introduced the $\partial { \bf N } { \bf C M }$ architecture in order to precisely capture the neural abstract machines to which our method applies. We showed how to formulate partial trace information as abstract loss functions, how to instantiate common neural architectures such as NTMs and NRAMs as ∂NCMs and concretize the $\partial { \bf N C M }$ loss functions. Our experimental results indicate that partial trace information is effective in biasing the learning of both NTM’s and NRAM’s towards better converge, generalization and interpretability of the resulting models.
|
| 190 |
+
|
| 191 |
+
# REFERENCES
|
| 192 |
+
|
| 193 |
+
Matko Bošnjak, Tim Rocktäschel, Jason Naradowsky, and Sebastian Riedel. Programming with a differentiable forth interpreter. In under review for ICLR (2017). URL http://arxiv.org/ abs/1605.06640.
|
| 194 |
+
|
| 195 |
+
Corinna Cortes, Neil D. Lawrence, Daniel D. Lee, Masashi Sugiyama, and Roman Garnett (eds.). Advances in Neural Information Processing Systems 28, 2015. URL http://papers.nips.cc/ book/advances-in-neural-information-processing-systems-28-2015.
|
| 196 |
+
|
| 197 |
+
John K Feser, Swarat Chaudhuri, and Isil Dillig. Synthesizing data structure transformations from input-output examples. In ACM SIGPLAN Notices, volume 50, pp. 229–239. ACM, 2015.
|
| 198 |
+
|
| 199 |
+
John K Feser, Marc Brockschmidt, Alexander L Gaunt, and Daniel Tarlow. Differentiable functional program interpreters. arXiv preprint arXiv:1611.01988, 2016.
|
| 200 |
+
|
| 201 |
+
Jonathan Frankle, Peter-Michael Osera, David Walker, and Steve Zdancewic. Example-directed synthesis: a type-theoretic interpretation. ACM SIGPLAN Notices, 51(1):802–815, 2016.
|
| 202 |
+
|
| 203 |
+
Karlis Freivalds and Renars Liepins. Improving the neural gpu architecture for algorithm learning. arXiv preprint arXiv:1702.08727, 2017.
|
| 204 |
+
|
| 205 |
+
Alexander L. Gaunt, Marc Brockschmidt, Nate Kushman, and Daniel Tarlow. Lifelong perceptual programming by example. In under review for ICLR (2017). URL https://arxiv.org/ abs/1611.02109.
|
| 206 |
+
|
| 207 |
+
Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. CoRR, abs/1410.5401, 2014. URL http://arxiv.org/abs/1410.5401.
|
| 208 |
+
|
| 209 |
+
Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka GrabskaBarwinska, Sergio Gómez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, ´ Adrià Puigdomènech Badia, Karl Moritz Hermann, Yori Zwols, Georg Ostrovski, Adam Cain, Helen King, Christopher Summerfield, Phil Blunsom, Koray Kavukcuoglu, and Demis Hassabis. Hybrid computing using a neural network with dynamic external memory. Nature, 538(7626):471– 476, Oct 2016. ISSN 0028-0836. URL http://dx.doi.org/10.1038/nature20101.
|
| 210 |
+
|
| 211 |
+
Edward Grefenstette, Karl Moritz Hermann, Mustafa Suleyman, and Phil Blunsom. Learning to transduce with unbounded memory. In Cortes et al. (2015), pp. 1828–1836. URL http://papers. nips.cc/paper/5648-learning-to-transduce-with-unbounded-memory.
|
| 212 |
+
|
| 213 |
+
Susmit Jha, Sumit Gulwani, Sanjit A Seshia, and Ashish Tiwari. Oracle-guided component-based program synthesis. In Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering-Volume 1, pp. 215–224. ACM, 2010.
|
| 214 |
+
|
| 215 |
+
Lukasz Kaiser and Ilya Sutskever. Neural GPUs learn algorithms. In Kingsbury & Bengio (2016). URL http://arxiv.org/abs/1511.08228.
|
| 216 |
+
|
| 217 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 218 |
+
|
| 219 |
+
Brian Kingsbury and Samy Bengio (eds.). 4th International Conference on Learning Representations, May 2-4, 2016, San Juan, Puerto Rico, 2016. URL http://www.iclr.cc/doku.php?id= iclr2016:main.
|
| 220 |
+
|
| 221 |
+
Karol Kurach, Marcin Andrychowicz, and Ilya Sutskever. Neural random-access machines. ERCIM News, 2016(107), 2016. URL http://ercim-news.ercim.eu/en107/special/ neural-random-access-machines.
|
| 222 |
+
|
| 223 |
+
Chengtao Li, Daniel Tarlow, Alexander L. Gaunt, Marc Brockschmidt, and Nate Kushman. Neural program lattices. In under review for ICLR (2017). URL https://openreview.net/pdf? id=HJjiFK5gx.
|
| 224 |
+
|
| 225 |
+
Arvind Neelakantan, Luke Vilnis, Quoc V Le, Ilya Sutskever, Lukasz Kaiser, Karol Kurach, and James Martens. Adding gradient noise improves learning for very deep networks. arXiv preprint arXiv:1511.06807, 2015.
|
| 226 |
+
|
| 227 |
+
Veselin Raychev, Pavol Bielik, Martin T. Vechev, and Andreas Krause. Learning programs from noisy data. In Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2016, St. Petersburg, FL, USA, January 20 - 22, 2016, pp. 761–774, 2016. doi: 10.1145/2837614.2837671. URL http://doi.acm.org/10.1145/ 2837614.2837671.
|
| 228 |
+
|
| 229 |
+
Scott Reed and Nando de Freitas. Neural programmer-interpreters. In Kingsbury & Bengio (2016). URL https://arxiv.org/abs/1511.06279.
|
| 230 |
+
|
| 231 |
+
under review for ICLR (ed.). 5th International Conference on Learning Representations, April 24- 26, 2017, Toloun, France, 2017. URL http://www.iclr.cc/doku.php?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ ICLR2017: main.
|
| 232 |
+
|
| 233 |
+
Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Cortes et al. (2015), pp. 2692–2700. URL http://papers.nips.cc/paper/5866-pointer-networks.
|
| 234 |
+
|
| 235 |
+
Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. arXiv preprint arXiv:1410.3916, 2014.
|
| 236 |
+
|
| 237 |
+
Wojciech Zaremba and Ilya Sutskever. Learning to execute. CoRR, abs/1410.4615, 2014. URL http://arxiv.org/abs/1410.4615.
|
| 238 |
+
|
| 239 |
+
Wojciech Zaremba and Ilya Sutskever. Reinforcement learning neural turing machines. CoRR, abs/1505.00521, 2015. URL http://arxiv.org/abs/1505.00521.
|
| 240 |
+
|
| 241 |
+
Wei Zhang, Yang Yu, and Bowen Zhou. Structured memory for neural turing machines. CoRR, abs/1510.03931, 2015. URL http://arxiv.org/abs/1510.03931.
|
| 242 |
+
|
| 243 |
+
# A NTM EQUATIONS
|
| 244 |
+
|
| 245 |
+
The controller for the NTM consists of the networks $\varphi$ $\varphi , \psi _ { y } , \psi _ { e } , \psi _ { a } , \chi _ { r } , \chi _ { w }$ , which operate on the variables:
|
| 246 |
+
|
| 247 |
+
$$
|
| 248 |
+
\begin{array} { r l r l r l } { x - \operatorname* { i n } \quad } & { q \mathrm { - c o n t r o l l e r ~ s t a t e } } & { r \mathrm { - r e a d ~ a d d r e s s } } & { \Delta r \mathrm { - c h a n g e ~ i n } r } & { e \mathrm { - e r a s e } } & { \mathcal { M } \mathrm { - t a p e } } \\ { y \mathrm { - o u t } \quad m \mathrm { - r e a d ~ v a l u e } } & { w \mathrm { - w r i t e ~ a d d r e s s } } & { \Delta w \mathrm { - c h a n g e ~ i n } w } & { a \mathrm { - a d d } } & { ( 1 \mathrm { - } r \mathrm { - } \mathrm { ~ a d d } ) } \end{array}
|
| 249 |
+
$$
|
| 250 |
+
|
| 251 |
+
The equations that describe NTM executions are:
|
| 252 |
+
|
| 253 |
+
$$
|
| 254 |
+
\begin{array} { r } { \Delta r _ { t } = \chi _ { r } ( q _ { t } ) } \\ { \Delta w _ { t } = \chi _ { w } ( q _ { t } ) } \\ { y _ { t } = \psi _ { y } ( q _ { t } ) } \\ { e _ { t } = \psi _ { e } ( q _ { t } ) } \\ { a _ { t } = \psi _ { a } ( q _ { t } ) } \end{array}
|
| 255 |
+
$$
|
| 256 |
+
|
| 257 |
+
$$
|
| 258 |
+
\begin{array} { r l } & { { \boldsymbol { r } } _ { t } = a d d r e s s ( \Delta { \boldsymbol { r } } _ { t } , { \boldsymbol { r } } _ { t - 1 } , \mathcal { M } _ { t - 1 } ) } \\ & { { \boldsymbol { w } } _ { t } = a d d r e s s ( \Delta { \boldsymbol { w } } _ { t } , { \boldsymbol { w } } _ { t - 1 } , \mathcal { M } _ { t - 1 } ) } \\ & { { \boldsymbol { m } } _ { t } = { \boldsymbol { r } } _ { t } { \boldsymbol { M } } _ { t - 1 } } \\ & { { \boldsymbol { \mathcal { M } } } _ { t } = \mathcal { M } _ { t - 1 } - ( { \boldsymbol { w } } _ { t } \otimes { \boldsymbol { e } } _ { t } ) \odot \mathcal { M } _ { t - 1 } + { \boldsymbol { w } } _ { t } \otimes { \boldsymbol { a } } _ { t } } \\ & { { \boldsymbol { q } } _ { t } = \varphi ( { \boldsymbol { x } } _ { t } , { \boldsymbol { q } } _ { t - 1 } , { \boldsymbol { m } } _ { t } ) . } \end{array}
|
| 259 |
+
$$
|
| 260 |
+
|
| 261 |
+
# B NRAM EQUATIONS
|
| 262 |
+
|
| 263 |
+
The controller of the NRAM consists of the networks $\varphi , \psi _ { a } , \psi _ { b } , \psi _ { c } , \psi _ { f }$ , which operate on the variables:
|
| 264 |
+
|
| 265 |
+
$$
|
| 266 |
+
\begin{array} { r l r l r l } & { a - \mathrm { l h s ~ c i r c u i t } } & & { b - \mathrm { r h s ~ c i r c u i t } } & & { c - \mathrm { r e g i s t e r ~ i n p u t s } } & & { o - \mathrm { m o d u l e ~ o u t p u t s } } \\ & { r - \mathrm { r e g i s t e r ~ s t a t e } } & & { \mathcal { M } - \mathrm { m e m o r y ~ t a p e } } & & { h - \mathrm { c o n t r o l l e r ~ s t a t e } } & & { f - \mathrm { s t o p ~ p r o b a b i l i t y } . } \end{array}
|
| 267 |
+
$$
|
| 268 |
+
|
| 269 |
+
The equations that describe the NRAM execution are:
|
| 270 |
+
|
| 271 |
+
$$
|
| 272 |
+
\begin{array} { r l r } { a _ { t } = \mathrm { s o f m a x } ( \psi _ { a } ( q _ { t } ) ) } & { A _ { t , i } = ( r _ { 1 } , \dots , r _ { R } , o _ { 0 } , \dots , o _ { i - 1 } ) ^ { T } a _ { t , i } } & { \forall i < M } \\ { b _ { t } = \mathrm { s o f m a x } ( \psi _ { b } ( q _ { t } ) ) } & { B _ { t , i } = ( r _ { 1 } , \dots , r _ { R } , o _ { 0 } , \dots , o _ { i - 1 } ) ^ { T } b _ { t , i } } & { \forall i < M } \\ { c _ { t } = \mathrm { s o f m a x } ( \psi _ { c } ( q _ { t } ) ) } & { r _ { t , i } = ( r _ { 1 } , \dots , r _ { R } , o _ { 1 } , \dots , o _ { Q } ) ^ { T } c _ { t , i } } & { \forall i < R } \\ { f _ { t } = \psi _ { f } ( q _ { t } ) } & { o _ { t , i , k } = \displaystyle \sum _ { 0 \leq a , b < M } A _ { t , i , a } B _ { t , i , b } [ m _ { i } ( a , b ) = k ] } & { \forall i \notin \{ \rho , \omega \} , k < M } \\ { q _ { t } = \varphi ( q _ { t - 1 } , r _ { t , - , 0 } ) } & { o _ { t , \rho } = \mathcal { M } _ { t } A _ { t , \rho } } & { \mathrm { ( ) } } \\ & { \mathcal { M } _ { t } = ( J - A _ { t , \omega } ) J ^ { T } \cdot \mathcal { M } _ { t - 1 } + A _ { t , \omega } B _ { t , \omega } ^ { T } } & { \mathrm { ( ) } } \\ { p _ { t } = f _ { t } \prod ( 1 - f _ { i } ) } & { p _ { T } = 1 - \displaystyle \sum _ { i \ < T } p _ { i } } & { \mathrm { ( ) } } \end{array}
|
| 273 |
+
$$
|
| 274 |
+
|
| 275 |
+
# C SETUP FOR NTM
|
| 276 |
+
|
| 277 |
+
For all of our NTM experiments we use a densely connected feed-forward controller. There are two architectural differences from the original NTM Graves et al. (2014) that helped our baseline performance: (1) the feed-forward controller, the erase and the add gates use tanh activation; (2) the output layer uses softmax. In the original architecture these are all logistic sigmoids. For the newly introduced tape decoder (active only during training) we used two alternative implementations: a tanh-softmax network, and a single affine transformation. We tested the NTM’s learning ability on five different tasks for sequence manipulation, two of which have not been previously investigated in this domain. These tasks can be found in Appendix E.
|
| 278 |
+
|
| 279 |
+
We performed experiments using several combination of losses as summarized in Appendix F. The observed training performance per task is shown in Appendix I, with rows corresponding to the different loss setups. The corner setup differs from the address setup in that the example subtraces were defined only for a few important corner cases. For example in RepeatCopyTwice, the write head was provided once at the beginning of the input sequence, and once at the end. Similarly, the read head was revealed at the beginning and at the end of every output repetition. In all other setups we provide full subtraces (defined for all time steps).
|
| 280 |
+
|
| 281 |
+
The supervision amount can be tuned by adjusting the $\lambda$ weight from Equation 8. Further, we can also control the fraction of examples which get extra subtrace supervision (the density row in Figure I). The performance metric we use is the percentage of runs that do generalize after $1 0 0 \mathrm { k }$ iterations for the given task and supervision type. By generalize we mean that the NTM has perfect accuracy on all testing examples up to $1 . 5 \times$ the size of the max training length, and also perfect accuracy on $90 \%$ of the testing examples up to $2 \times$ the maximum training length.
|
| 282 |
+
|
| 283 |
+
We used a feed-forwad controller with $2 \times 5 0$ units, except for RepeatCopyTwice, which uses $2 \times 1 0 0$ units. For training we used the Adam optimizer Kingma & Ba (2014), a learning rate of $1 0 ^ { - 3 }$ for all tasks except RepeatFlip3d and $\mathtt { F 1 1 p 3 r d }$ which use $5 \cdot 1 0 ^ { - 4 } $ . The lengths of the training sequences for the first four tasks are from 1 to 5, whereas the generalization of the model was tested with sequences of lengths up to 20. For Flip3rd and RepeatFlip3d, the training sequence length was up to 16, whereas the testing sequences have maximum length of 32.
|
| 284 |
+
|
| 285 |
+
# D SETUP FOR NRAM
|
| 286 |
+
|
| 287 |
+
Like in the NTM, we use a densely connected two layer feed forward controller for our experiments, and use ReLU as the activation function. We make no modifications to the original architecture, and use noise with the parameter $\eta = 0 . 3$ as suggested by Neelakantan et al. (2015), and curriculum learning as described by Zaremba & Sutskever (2014). We stop training once we get to a difficulty specified by the task, and increase the difficulty once 0 errors were found on a new testing batch of 10 samples. Each training iteration trains with 50 examples of the currently randomly sampled difficulty. Regardless of whether the model had converged, training is stopped after 5000 samples were used. Such a low number is used to replicate the potential conditions under which such a model might be used. As with the NTM, the Adam optimizer was used. The specific tasks we use are described in Appendix G, and the specific kinds of supervision we give are described in Appendix H. The $\lambda$ we used here was 40. The system was implemented using PyTorch.
|
| 288 |
+
|
| 289 |
+
# E NTM TASKS
|
| 290 |
+
|
| 291 |
+
Every input sequence ends with a special delimiter $x _ { E }$ not occurring elsewhere in the sequence
|
| 292 |
+
|
| 293 |
+
Copy – The input consists of generic elements, $x _ { 1 } \ldots x _ { n } x _ { E }$ . The desired output is $x _ { 1 } \ldots x _ { n } x _ { E }$
|
| 294 |
+
|
| 295 |
+
RepeatCopyTwice – The input is again a sequence of generic elements, $x _ { 1 } \ldots x _ { n } x _ { E }$ . The desired output is the input copied twice $x _ { 1 } \ldots x _ { n } x _ { 1 } \ldots x _ { n } x _ { E }$ . Placing the delimiter only at the end of the output ensures that the machine learns to keep track of the number of copies. Otherwise, it could simply learn to cycle through the tape reproducing the given input indefinitely. We kept the number of repetitions fixed in order to increase baseline task performance for the benefit of comparison.
|
| 296 |
+
|
| 297 |
+
DyckWords – The input is a sequence of open and closed parentheses, $x _ { 1 } \ldots x _ { n } x _ { E }$ . The desired output is a sequence of bits $y _ { 1 } \ldots y _ { n } x _ { E }$ such that $y _ { i } = 1$ iff the prefix $x _ { 1 } \ldots x _ { i }$ is a balanced string of parentheses (a Dyck word). Both positive and negative examples were given.
|
| 298 |
+
|
| 299 |
+
Flip3rd – The input is a sequence of bits, $x _ { 1 } x _ { 2 } x _ { 3 } \ldots x _ { n } x _ { E }$ . The desired output is the same sequence of bits but with the 3rd bit flipped: $x _ { 1 } x _ { 2 } \bar { x } _ { 3 } \ldots x _ { n } x _ { E }$ . Such a task with a specific index to be updated (e.g., 3rd) still requires handling data dependence on the contents of the index (unlike say the Copy task).
|
| 300 |
+
|
| 301 |
+
RepeatFlip3d – The input is a sequence of bits, $x _ { 1 } x _ { 2 } x _ { 3 } x _ { 4 } x _ { 5 } x _ { 5 } \ldots x _ { E }$ . The desired output is the same sequence of bits but with every 3rd bit flipped: $x _ { 1 } x _ { 2 } \bar { x } _ { 3 } x _ { 4 } x _ { 5 } \bar { x } _ { 6 } \ldots x _ { E }$ .
|
| 302 |
+
|
| 303 |
+
# F NTM SUBTRACES
|
| 304 |
+
|
| 305 |
+

|
| 306 |
+
Figure 8: A heirarchy of supervision types (but not quantities) for NTMs.
|
| 307 |
+
|
| 308 |
+
value traces provide hints for the memory at every timestep as explained in Equation 10.
|
| 309 |
+
|
| 310 |
+
read – provides a hint for the address of the read head at every timestep.
|
| 311 |
+
|
| 312 |
+
write – provides a hint for the address of the write head at every timestep.
|
| 313 |
+
|
| 314 |
+
address – provides hints for the address of both the read and the write head at every timestep.
|
| 315 |
+
|
| 316 |
+
addr+val – provides value, read and write hints for every timestep.
|
| 317 |
+
|
| 318 |
+
corner – provides hints for the address of both the read and the write head at every “important” timestep - we decided what important means here depends on which task we are referring to. In general, we consider the first and last timesteps important, and also any timestep where a head should change direction. For example, in RepeatCopyTwice for an example of size $n$ with $e$ repeats, we’d provide the heads at timesteps $0 , n , 2 n , 3 n \ldots , e n$ .
|
| 319 |
+
|
| 320 |
+
# G NRAM TASKS
|
| 321 |
+
|
| 322 |
+
Below we describe all the tasks we experimented with. We predominantly picked tasks that the NRAM is known to have trouble generalizing on. We did not introduce any new tasks, and more detailed descriptions of these tasks can be found in Kurach et al. (2016).
|
| 323 |
+
|
| 324 |
+
Swap – Provided two numbers, $a$ and $b$ and an array $p$ , swap $p [ a ]$ and $p [ b ]$ . All elements but that in the last memory cell are not zero.
|
| 325 |
+
|
| 326 |
+
Increment – Given an array $p$ , return the array with one added to each element. All elements but that in the last cell for the input are not zero. Elements can be zero in the output.
|
| 327 |
+
|
| 328 |
+
Permute – Given two arrays $p$ and $q$ return a new array $s$ such that $s [ i ] ~ = ~ q [ p [ i ] ]$ . The arrays $p$ and $q$ are preceded by a pointer, $a$ , to array $q$ . The output is expected to be $a , s [ 0 ] \ldots , s [ n ] , q [ 0 ] , q [ n ]$ .
|
| 329 |
+
|
| 330 |
+
ListK – Given a linked list in array form, and an index $k$ return the value at node $k$ .
|
| 331 |
+
|
| 332 |
+
Merge – given arrays $p$ and $q$ , and three pointers $a , b , c$ to array $p , q$ , and the output sequence (given as zeros initially), place the sorted combination of $p$ and $q$ into the output location.
|
| 333 |
+
|
| 334 |
+
The following table describes the specific NRAM instantiation used for each task. The default sequence (def) is the one described by Kurach et al. (2016). The number of timesteps is usually dependent on the length of the problem instance, $M$ (equivalently the word size or difficulty), and in the case of ListKwas given with respect to the argument $k$ . The difficulty (D) was simply the length of the sequence used.
|
| 335 |
+
|
| 336 |
+
<table><tr><td>Task</td><td>No. Regs</td><td>Module Sequence</td><td>Timesteps</td><td>Learn Rate</td><td>Start D</td><td>End D</td></tr><tr><td>Swap</td><td>5</td><td>def</td><td>7</td><td>0.01</td><td>6</td><td>10</td></tr><tr><td>Increment</td><td>2</td><td>def+R</td><td>M+2</td><td>0.01</td><td>4</td><td>10</td></tr><tr><td>Permute</td><td>4</td><td>R+def+R+W</td><td>M+3</td><td>0.05</td><td>7</td><td>12</td></tr><tr><td>ListK</td><td>6</td><td>def</td><td>k+5</td><td>0.05</td><td>9</td><td>16</td></tr><tr><td>Merge</td><td>8</td><td>def + def + def</td><td>M+3</td><td>0.05</td><td>13</td><td>16</td></tr></table>
|
| 337 |
+
|
| 338 |
+
# H NRAM SUBTRACES
|
| 339 |
+
|
| 340 |
+
For each of the tasks listed Appendix G, we hand coded a complete circuit for every module and every timestep we would provide. The following subtraces types describe how we provide hints based on this circuit.
|
| 341 |
+
|
| 342 |
+
None – provides no hints.
|
| 343 |
+
|
| 344 |
+
Full – provides the entire circuit.
|
| 345 |
+
|
| 346 |
+
SingleHint – provides a random hint at a random timestep.
|
| 347 |
+
|
| 348 |
+
SingleTimestep – provides the entire circuit at a random timestep.
|
| 349 |
+
|
| 350 |
+
Corners – provides the entire circuit at the first and last timesteps.
|
| 351 |
+
|
| 352 |
+
Registers – provides hints for the registers at every timestep.
|
| 353 |
+
|
| 354 |
+
Modules – provides hints for the modules at every timestep.
|
| 355 |
+
|
| 356 |
+
# I NTM RESULTS
|
| 357 |
+
|
| 358 |
+
(a) Copy
|
| 359 |
+
|
| 360 |
+
<table><tr><td rowspan=1 colspan=1>density</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.01</td></tr><tr><td rowspan=1 colspan=1>baseline</td><td rowspan=1 colspan=1>52.5</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>addr+val</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>10</td></tr><tr><td rowspan=1 colspan=1>address</td><td></td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>50</td></tr><tr><td rowspan=1 colspan=1>value</td><td></td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>10</td></tr><tr><td rowspan=1 colspan=1>read</td><td></td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>10</td></tr><tr><td rowspan=1 colspan=1>write</td><td></td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>40</td></tr><tr><td rowspan=1 colspan=1>corner</td><td></td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>30</td></tr></table>
|
| 361 |
+
|
| 362 |
+
(b) RepeatCopyTwice
|
| 363 |
+
|
| 364 |
+
<table><tr><td rowspan=1 colspan=1>density</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.03</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.03</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.03</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.03</td></tr><tr><td rowspan=1 colspan=1>baseline</td><td rowspan=1 colspan=1>15.5</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>addr+val</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>。</td></tr><tr><td rowspan=1 colspan=1>address</td><td></td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>30</td></tr><tr><td rowspan=1 colspan=1>value</td><td></td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>0</td></tr><tr><td rowspan=1 colspan=1>read</td><td></td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>。</td></tr><tr><td rowspan=1 colspan=1>write</td><td></td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>20</td></tr><tr><td rowspan=1 colspan=1>comer</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>0</td></tr></table>
|
| 365 |
+
|
| 366 |
+
(c) DyckWords
|
| 367 |
+
|
| 368 |
+
<table><tr><td rowspan=1 colspan=1>density</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.01</td></tr><tr><td rowspan=1 colspan=1>baseline</td><td rowspan=1 colspan=2>45</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>address</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>70</td></tr><tr><td rowspan=1 colspan=1>read</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td></tr><tr><td rowspan=1 colspan=1>corner</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>50</td></tr></table>
|
| 369 |
+
|
| 370 |
+
(d) Flip3rd
|
| 371 |
+
|
| 372 |
+
<table><tr><td rowspan=1 colspan=1>density</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.03</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.03</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.03</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.03</td></tr><tr><td rowspan=1 colspan=1>baseline</td><td rowspan=1 colspan=1>45</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>addr+val</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>10</td></tr><tr><td rowspan=1 colspan=1>address</td><td></td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>60</td></tr><tr><td rowspan=1 colspan=1>value</td><td></td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>60</td></tr><tr><td rowspan=1 colspan=1>read</td><td></td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>30</td></tr><tr><td rowspan=1 colspan=1>write</td><td></td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>50</td></tr><tr><td rowspan=1 colspan=1>corner</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>90</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>40</td></tr></table>
|
| 373 |
+
|
| 374 |
+
(e) RepeatFlip3d
|
| 375 |
+
|
| 376 |
+
<table><tr><td rowspan=1 colspan=1>density</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.03</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.03</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.03</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.03</td></tr><tr><td rowspan=1 colspan=1>baseline</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>addr+val</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>10</td></tr><tr><td rowspan=1 colspan=1>address</td><td></td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>。</td></tr><tr><td rowspan=1 colspan=1>value</td><td></td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td></tr><tr><td rowspan=1 colspan=1>read</td><td></td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>20</td></tr><tr><td rowspan=1 colspan=1>write</td><td></td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>。</td></tr><tr><td rowspan=1 colspan=1>corner</td><td></td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>。</td><td rowspan=1 colspan=1>10</td></tr></table>
|
| 377 |
+
|
| 378 |
+
Figure 9: Baselines have generalization on over 40 different initial weights. Other tests use 10.
|
| 379 |
+
|
| 380 |
+
Which Details to Reveal for NTM? The first dimension listed in the rows of the tables of Figure I controls the execution details revealed in a Subtrace. We use subtraces showing either the addresses without the tape values, only the read heads or the write heads, or even weaker supervision in a few corner cases. In tasks Copy Figure 9a), RepeatCopyTwice (Figure 9b) and DyckWords (Figure 9c), it is frequently the case that when the NTM generalizes without supervision, it converges to an algorithm which we are able to interpret. For them, we designed the addr+val traces to match this algorithm, and saw increases in generalization frequency of at least $45 \%$ . It can be concluded that when additionally provided supervision reflects the interpretable “natural” behavior of the NTM, the learning becomes significantly more robust to changes in initial weights. Additionally, for tasks Flip3rd (Figure 9d) and RepeatFlip3d (Figure 9e), both the baseline and other supervision types are outperformed by training with read supervision. It is also notable that corner supervision in RepeatFlip3d achieves highest improvement over the baseline, $60 \%$ over $5 \%$ . In essence, this means that providing only a small part of the trace can diminish the occurrence of local minima in the loss function.
|
| 381 |
+
|
| 382 |
+
How Often to Reveal for NTM? The second dimension controls the proportion of examples that receive extra subtrace supervision (the density columns in Figure I). For Flip3rd, RepeatCopyTwice and DyckWords we observed that having only a small number of examples with extra supervision leads to models which are more robust to initial weight changes than the baseline, although not necessarily always as robust as providing supervision all the time.
|
| 383 |
+
|
| 384 |
+
A couple of interesting cases stand out. For Flip3rd with $10 \%$ corner subtraces and $\lambda = 1$ , we find a surprisingly high rate of generalization. Providing address traces $10 \%$ of the time when training RepeatCopyTwice leads to better performance all the time. For RepeatFlip3d, write traces at $1 \%$ frequency and $\lambda = 0 . 1$ generalize $30 \%$ of the time vs. $5 \%$ for baseline.
|
| 385 |
+
|
| 386 |
+
While the type of trace which works best varies per task, for each task there exists a trace which can be provided only $1 \%$ of the time and still greatly improve the performance over the baseline. This suggests that a small amount of extra supervision can improve performance significantly, but the kind of supervision may differ. It is an interesting research question to find out how the task at hand relates to the optimal kind of supervision.
|
| 387 |
+
|
| 388 |
+
# J NRAM RESULTS
|
| 389 |
+
|
| 390 |
+
<table><tr><td rowspan=1 colspan=1>Subtrace Type \Task</td><td rowspan=1 colspan=1>Permute</td><td rowspan=1 colspan=1>Swap</td><td rowspan=1 colspan=1>Increment</td><td rowspan=1 colspan=1>ListK</td><td rowspan=1 colspan=1>Merge</td><td rowspan=1 colspan=1>PermuteNoise</td></tr><tr><td rowspan=8 colspan=1>NoneSingleHintCornersSingleTimestepRegistersModulesFullNoisyFull</td><td rowspan=1 colspan=1>36</td><td rowspan=1 colspan=1>44</td><td rowspan=1 colspan=1>58</td><td rowspan=1 colspan=1>41</td><td rowspan=1 colspan=1>13</td><td rowspan=3 colspan=1>121417</td></tr><tr><td rowspan=1 colspan=1>24</td><td rowspan=1 colspan=1>38</td><td rowspan=1 colspan=1>28</td><td rowspan=1 colspan=1>22</td><td rowspan=1 colspan=1>12</td></tr><tr><td rowspan=1 colspan=1>29</td><td rowspan=1 colspan=1>23</td><td rowspan=1 colspan=1>36</td><td rowspan=1 colspan=1>22</td><td rowspan=1 colspan=1>9</td></tr><tr><td rowspan=1 colspan=1>21</td><td rowspan=1 colspan=1>52</td><td rowspan=1 colspan=1>29</td><td rowspan=1 colspan=1>28</td><td rowspan=1 colspan=1>12</td><td rowspan=5 colspan=1>13-1141</td></tr><tr><td rowspan=1 colspan=1>48</td><td rowspan=1 colspan=1>58</td><td rowspan=1 colspan=1>73</td><td rowspan=1 colspan=1>54</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=1 colspan=1>48</td><td rowspan=1 colspan=1>58</td><td rowspan=1 colspan=1>107</td><td rowspan=1 colspan=1>54</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=1 colspan=1>26</td><td rowspan=1 colspan=1>33</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>44</td><td rowspan=1 colspan=1>21</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>36</td><td rowspan=1 colspan=1>1</td></tr></table>
|
| 391 |
+
|
| 392 |
+
Figure 11: The average time (in seconds) to finish training for each task and subtrace type. For most tasks it is clear that Full traces while introducing extra computations to individual timesteps, reduce the amount of time to finish training over not using supervision.
|
| 393 |
+
|
| 394 |
+
<table><tr><td rowspan=1 colspan=1>Subtrace Type \Task</td><td rowspan=1 colspan=1>Permute</td><td rowspan=1 colspan=1>Swap</td><td rowspan=1 colspan=1>Increment</td><td rowspan=1 colspan=1>ListK</td></tr><tr><td rowspan=1 colspan=1>None</td><td rowspan=1 colspan=1>6290.29</td><td rowspan=1 colspan=1>5505.22</td><td rowspan=1 colspan=1>3500.13</td><td rowspan=1 colspan=1>5880.11</td></tr><tr><td rowspan=6 colspan=1>SingleHintCornersSingleTimestepRegistersModulesFull</td><td rowspan=1 colspan=1>5565.22</td><td rowspan=1 colspan=1>3700.64</td><td rowspan=1 colspan=1>4318.20</td><td rowspan=1 colspan=1>6574.59</td></tr><tr><td rowspan=2 colspan=1>4468.856259.05</td><td rowspan=1 colspan=1>6195.75</td><td rowspan=1 colspan=1>3199.86</td><td rowspan=1 colspan=1>6601.16</td></tr><tr><td rowspan=1 colspan=1>2662.35</td><td rowspan=1 colspan=1>4042.18</td><td rowspan=1 colspan=1>5076.17</td></tr><tr><td rowspan=1 colspan=1>6618.12</td><td rowspan=1 colspan=1>5774.61</td><td rowspan=1 colspan=1>3839.18</td><td rowspan=1 colspan=1>6185.54</td></tr><tr><td rowspan=1 colspan=1>6523.16</td><td rowspan=1 colspan=1>5781.99</td><td rowspan=1 colspan=1>2335.99</td><td rowspan=1 colspan=1>6183.74</td></tr><tr><td rowspan=1 colspan=1>4919.33</td><td rowspan=1 colspan=1>4110.14</td><td rowspan=1 colspan=1>3758.99</td><td rowspan=1 colspan=1>3216.01</td></tr></table>
|
| 395 |
+
|
| 396 |
+

|
| 397 |
+
Figure 10: The number of runs which completed for each task and subtrace type. The Data in the graphs below is taken by averaging the results of these runs.
|
| 398 |
+
|
| 399 |
+
Figure 12: The average number of errors on the test set for each task and subtrace type once trained.
|
| 400 |
+
|
| 401 |
+
<table><tr><td rowspan=1 colspan=1>Subtrace Type \Task</td><td rowspan=1 colspan=1>ListK</td><td rowspan=1 colspan=1>Swap</td><td rowspan=1 colspan=1>Permute</td><td rowspan=1 colspan=1>Increment</td><td rowspan=1 colspan=1>Merge</td><td rowspan=1 colspan=1>PermuteNoise</td></tr><tr><td rowspan=7 colspan=1>NoneSingleHintCornersSingleTimestepFullRegistersModules</td><td rowspan=1 colspan=1>95.08</td><td rowspan=1 colspan=1>91.52</td><td rowspan=1 colspan=1>99.97</td><td rowspan=1 colspan=1>99.91</td><td rowspan=1 colspan=1>99.96</td><td rowspan=7 colspan=1>99.9956.9020.7933.6023.57-=</td></tr><tr><td rowspan=1 colspan=1>93.61</td><td rowspan=1 colspan=1>2.41</td><td rowspan=1 colspan=1>57.55</td><td rowspan=1 colspan=1>14.86</td><td rowspan=1 colspan=1>100.0</td></tr><tr><td rowspan=1 colspan=1>94.47</td><td rowspan=1 colspan=1>99.09</td><td rowspan=1 colspan=1>16.40</td><td rowspan=1 colspan=1>2.14</td><td rowspan=1 colspan=1>100.0</td></tr><tr><td rowspan=1 colspan=1>36.91</td><td rowspan=1 colspan=1>1.75</td><td rowspan=1 colspan=1>47.79</td><td rowspan=1 colspan=1>13.77</td><td rowspan=1 colspan=1>100.0</td></tr><tr><td rowspan=1 colspan=1>12.77</td><td rowspan=1 colspan=1>11.01</td><td rowspan=1 colspan=1>7.83</td><td rowspan=1 colspan=1>9.89</td><td rowspan=1 colspan=1>78.44</td></tr><tr><td rowspan=1 colspan=1>93.22</td><td rowspan=1 colspan=1>93.44</td><td rowspan=1 colspan=1>99.97</td><td rowspan=1 colspan=1>90.36</td><td rowspan=1 colspan=1>=</td></tr><tr><td rowspan=1 colspan=1>93.70</td><td rowspan=1 colspan=1>95.57</td><td rowspan=1 colspan=1>86.48</td><td rowspan=1 colspan=1>40.87</td><td rowspan=1 colspan=1>=</td></tr></table>
|
| 402 |
+
|
| 403 |
+

|
| 404 |
+
Figure 13: Comparing average generalization to sequence length for Swap
|
| 405 |
+
Figure 14: Comparing average generalization to sequence length for Increment
|
| 406 |
+
|
| 407 |
+

|
| 408 |
+
Figure 15: Comparing average generalization to sequence length for Permute
|
| 409 |
+
|
| 410 |
+

|
| 411 |
+
Figure 16: Comparing average generalization to sequence length for ListK
|
| 412 |
+
|
| 413 |
+

|
| 414 |
+
Figure 17: Comparing average generalization to sequence length for Merge
|
| 415 |
+
|
| 416 |
+

|
| 417 |
+
Figure 18: Comparing average generalization of the DNGPU Freivalds & Liepins (2017) with that of the NRAM using the full tracer for Merge. For this experiment, a maximum of 10000 samples were used for the DNGPU and 5000 for the NRAM. The DNGPU was run out of the box from the code supplied by the authors. 20 runs were averaged for the DNGPU and 38 runs for the NRAM. One can deduce that while neither is able to generalize this task perfectly, the simpler and easier to understand architecture, NRAM, does generalize better with fewer examples when those examples come with richer supervision.
|
| 418 |
+
|
| 419 |
+
# K PROGRAMMING NRAMS
|
| 420 |
+
|
| 421 |
+
The NRAM is parametrized by one or more straight-line partial programs, i.e., programs with no branching and no loops, chosen by register states. The machine runs in a loop, repeatedly selecting the program for that register state then executing it. The programs are expressend in a simple single-assignment imperative language. Each program statement $i$ invokes one of the modules of the architecture and assigns the result of the invocation to a local variable $x _ { i }$ . That variable cannot be changed later. The final program statement is a parallel-asignment that modifies the machine registers $r _ { 1 } \ldots r _ { k }$ . The values that appear in assignments/invocations can be: variables in scope, machine registers, or holes ?. These values are not used directly during execution: the actual values needs to be supplied by the NRAM controller. The values are only used as hints for the controller during training, with the whole ? denoting no hint. We can describe the language in an EBNF-style grammar:
|
| 422 |
+
|
| 423 |
+
$$
|
| 424 |
+
{ \begin{array} { r l r l } & { F _ { n } : : = { \mathrm { m o d u l e s ~ o f ~ a r i t y ~ } } n } & & { S _ { i } : : = x _ { i } F _ { n } ( \underbrace { V _ { i } , \dotsc , V _ { i } } _ { n } ) } \\ & { V _ { i } : = r _ { 1 } \mid \dots \mid r _ { k } \mid ? \mid x _ { 1 } \mid \dots \mid x _ { i - 1 } } & & { R _ { i } : = r _ { j 1 } , \dotsc , r _ { j _ { n } } \underbrace { V _ { i } , \dotsc , V _ { i } } _ { n } } \\ & { P _ { 1 } : = S _ { 1 } } & { P _ { i } : = P _ { i - 1 } ; S _ { i } } & & { P : : = P _ { 1 } ; R _ { 1 } \mid P _ { 2 } ; R _ { 2 } \mid \dots } \end{array} }
|
| 425 |
+
$$
|
| 426 |
+
|
| 427 |
+
An example program for the Increment task would be the following:
|
| 428 |
+
|
| 429 |
+
$x _ { 1 } \gets 1$ ;
|
| 430 |
+
$x _ { 2 } \gets \mathsf { R E A D } ( r _ { 1 } )$ ;
|
| 431 |
+
$x _ { 3 } \gets \mathsf { A D D } ( x _ { 2 } , x _ { 1 } )$ ; $x _ { 4 } \gets \mathsf { W R I T E } ( r _ { 1 } , x _ { 3 } ) ;$ $x _ { 5 } \gets \mathsf { A D D } ( r _ { 1 } , x _ { 1 } ) ;$ r1 ← x5
|
| 432 |
+
|
| 433 |
+
Here, the controller is encouraged to read the memory at the location stored in the first register $r _ { 1 }$ add one to it, then store it back, and then increment the the first register.
|
| 434 |
+
|
| 435 |
+
An alternative to the trace-based approach is to make the controller produce values only for the holes, and use directly the specified variable/register arguments. This way, only the unspecified parts of the program are learned. This is, for example, the approach taken by ∂Forth Bošnjak et al. (2017). There, programs are expressed in a suitably adapted variant of the Forth programming language, which is as expressive as the language discussed above, but less syntactically constrained.
|
| 436 |
+
|
| 437 |
+
The drawback of this alternative is that whenever an argument other than a whole is specified, one must also specify the time steps to which it applies in all possible executions and not just the training ones. That is why, typically, these values are specified either for all or for none of the time steps.
|
| 438 |
+
|
| 439 |
+
In the following examples, we will describe the register states using $\mathbf { \vec { \nabla } } _ { 0 } , \mathbf { \vec { \mathbf { \phi } } } _ { 0 } ,$ , “ $! 0 ^ { \dag }$ and “-” meaning respectively that a register has 0, that it contains anything but zero, or that it can contain anything.
|
| 440 |
+
|
| 441 |
+
# L NRAM PERMUTATION PROGRAM
|
| 442 |
+
|
| 443 |
+
For any register pattern.
|
| 444 |
+
|
| 445 |
+
# M NRAM LISTK PROGRAM
|
| 446 |
+
|
| 447 |
+
When the registers are $[ 0 , ! 0 , ! 0 , - , - ]$ :
|
| 448 |
+
|
| 449 |
+
$x _ { 1 } \gets R E A D ( r _ { 0 } )$ ; $x _ { 2 } A D D ( x _ { 1 } , 2 )$ ; $\begin{array} { r l } & { x _ { 3 } \gets W R I T E ( 0 , x _ { 1 } ) ; } \\ & { r _ { 0 } \gets 1 ; } \\ & { r _ { 1 } \gets 1 ; } \\ & { r _ { 2 } \gets 1 ; } \\ & { r _ { 3 } \gets x _ { 2 } ; } \end{array}$
|
| 450 |
+
|
| 451 |
+
When the registers are [!0, !0, !0, -, -]:
|
| 452 |
+
|
| 453 |
+
$$
|
| 454 |
+
\begin{array} { l } { { x _ { 1 } \gets R E A D ( r _ { 1 } ) ; } } \\ { { x _ { 2 } \gets A D D ( x _ { 1 } , 2 ) ; } } \\ { { x _ { 3 } \gets W R I T E ( r _ { 1 } , x _ { 1 } ) ; } } \\ { { r _ { 0 } \gets 1 ; } } \\ { { r _ { 1 } \gets 0 ; } } \\ { { r _ { 2 } \gets 1 ; } } \\ { { r _ { 3 } \gets r _ { 3 } ; } } \\ { { x _ { 4 } \gets x _ { 2 } ; } } \end{array}
|
| 455 |
+
$$
|
| 456 |
+
|
| 457 |
+
When the registers are $[ ! 0 , 0 , ! 0 , - , - ]$ :
|
| 458 |
+
|
| 459 |
+
When the registers are $[ ! 0 , 0 , 0 , \cdot , - ]$ :
|
| 460 |
+
|
| 461 |
+
$$
|
| 462 |
+
\begin{array} { l } { x _ { 1 } \gets R E A D ( r _ { 4 } ) ; } \\ { x _ { 2 } \gets W R I T E ( r _ { 4 } , r _ { 3 } ) ; } \\ { r _ { 0 } \gets 1 ; } \\ { r _ { 1 } \gets 1 ; } \\ { r _ { 2 } \gets 0 ; } \\ { r _ { 3 } \gets x _ { 1 } ; } \end{array}
|
| 463 |
+
$$
|
| 464 |
+
|
| 465 |
+
When the registers are $[ 0 , ! 0 , 0 , \cdot , - ]$ :
|
| 466 |
+
|
| 467 |
+
$$
|
| 468 |
+
\begin{array} { r l } & { x _ { 1 } \gets R E A D ( r _ { 2 } ) ; } \\ & { x _ { 2 } \gets A D D ( x _ { 1 } , 2 ) ; } \\ & { x _ { 3 } \gets W R I T E ( x _ { 2 } ) ; } \\ & { r _ { 0 } \gets 0 ; } \\ & { r _ { 1 } \gets 1 ; } \\ & { r _ { 2 } \gets 0 ; } \end{array}
|
| 469 |
+
$$
|
| 470 |
+
|
| 471 |
+
# N NRAM LISTK PROGRAM
|
| 472 |
+
|
| 473 |
+
# Timestep 0:
|
| 474 |
+
|
| 475 |
+
$$
|
| 476 |
+
\begin{array} { l } { { x _ { 1 } R E A D ( r _ { 0 } ) ; } } \\ { { x _ { 2 } I N C ( x _ { 1 } ) ; } } \\ { { x _ { 3 } 0 ; } } \\ { { x _ { 4 } W R I T E ( x _ { 3 } , x _ { 1 } ) ; } } \\ { { r _ { 0 } r _ { 1 } ; } } \\ { { r _ { 1 } r _ { 1 } ; } } \\ { { r _ { 2 } r _ { 2 } ; } } \\ { { r _ { 3 } x _ { 2 } ; } } \\ { { x _ { 4 } r _ { 4 } ; } } \end{array}
|
| 477 |
+
$$
|
| 478 |
+
|
| 479 |
+
$$
|
| 480 |
+
r _ { 5 } \gets r _ { 5 } ;
|
| 481 |
+
$$
|
| 482 |
+
|
| 483 |
+
$$
|
| 484 |
+
\begin{array} { l } { { x _ { 1 } R E A D ( r _ { 1 } ) ; } } \\ { { x _ { 2 } W R I T E ( r _ { 1 } , x _ { 1 } ) ; } } \\ { { x _ { 3 } 0 ; } } \\ { { r _ { 0 } r _ { 0 } ; } } \\ { { r _ { 1 } x _ { 1 } ; } } \\ { { r _ { 2 } r _ { 2 } ; } } \\ { { r _ { 3 } r _ { 3 } ; } } \\ { { r _ { 4 } x _ { 3 } ; } } \\ { { r _ { 5 } r _ { 5 } ; } } \end{array}
|
| 485 |
+
$$
|
| 486 |
+
|
| 487 |
+
# Timestep 2:
|
| 488 |
+
|
| 489 |
+
$x _ { 1 } \gets R E A D ( r _ { 2 } )$ ;
|
| 490 |
+
$x _ { 2 } \gets W R I T E ( r _ { 2 } , x _ { 1 } ) ;$ ;
|
| 491 |
+
x3 ← 0;
|
| 492 |
+
r0 ← r0;
|
| 493 |
+
$r _ { 1 } r _ { 1 }$ ;
|
| 494 |
+
$r _ { 2 } \gets x _ { 1 }$ ;
|
| 495 |
+
$r _ { 3 } \gets r _ { 3 }$ ;
|
| 496 |
+
$r _ { 4 } \gets x _ { 3 } { \mathrm { : } }$ r5 ← x3;
|
| 497 |
+
|
| 498 |
+
$$
|
| 499 |
+
\begin{array} { l } { { x _ { 1 } R E A D ( r _ { 0 } ) ; } } \\ { { x _ { 2 } I N C ( x _ { 1 } ) ; } } \\ { { x _ { 3 } 0 ; } } \\ { { x _ { 4 } D E C ( x _ { 1 } ) ; } } \\ { { x _ { 5 } W H T E ( r _ { 0 } , x _ { 1 } ) ; } } \\ { { r _ { 0 } x _ { 1 } ; } } \\ { { r _ { 1 } x _ { 4 } ; } } \\ { { r _ { 2 } r _ { 2 } ; } } \\ { { r _ { 3 } x _ { 2 } ; } } \\ { { r _ { 4 } x _ { 3 } ; } } \\ { { r _ { 5 } x _ { 3 } ; } } \end{array}
|
| 500 |
+
$$
|
| 501 |
+
|
| 502 |
+
Timestep $3 + \mathrm { k }$ : $x _ { 1 } \gets R E A D ( r _ { 3 } )$ ; $x _ { 2 } \gets W R I T E ( r _ { 2 } , x _ { 1 } ) ;$ ; x3 ← 0; x4 ← 1; $r _ { 0 } \gets r _ { 0 }$ ; $r _ { 1 } r _ { 1 }$ ; $r _ { 2 } \gets r _ { 2 } ;$ $r _ { 3 } \gets x _ { 1 }$ ; $r _ { 4 } \gets x _ { 4 }$ ; $r _ { 5 } s _ { 3 }$ ;
|
| 503 |
+
|
| 504 |
+
# Rest:
|
| 505 |
+
|
| 506 |
+
$$
|
| 507 |
+
\begin{array} { l } { { x _ { 1 } W R I T E ( r _ { 2 } , r _ { 3 } ) ; } } \\ { { x _ { 2 } 1 ; } } \\ { { x _ { 3 } 0 ; } } \\ { { r _ { 0 } r _ { 0 } ; } } \\ { { r _ { 1 } r _ { 1 } ; } } \\ { { r _ { 2 } r _ { 2 } ; } } \\ { { r _ { 3 } r _ { 3 } ; } } \\ { { r _ { 4 } x _ { 2 } ; } } \\ { { r _ { 5 } x _ { 3 } ; } } \end{array}
|
| 508 |
+
$$
|
md/train/SJlHwkBYDH/SJlHwkBYDH.md
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NESTEROV ACCELERATED GRADIENT AND SCALE INVARIANCE FOR ADVERSARIAL ATTACKS
|
| 2 |
+
|
| 3 |
+
Jiadong Lin & Chuanbiao Song & Kun He ∗ School of Computer Science and Technology Huazhong University of Science and Technology Wuhan, 430074, China {jdlin,cbsong,brooklet60}@hust.edu.cn
|
| 4 |
+
|
| 5 |
+
Liwei Wang
|
| 6 |
+
School of Electronics Engineering
|
| 7 |
+
and Computer Sciences, Peking University
|
| 8 |
+
Peking, China
|
| 9 |
+
wanglw@cis.pku.edu.cn
|
| 10 |
+
|
| 11 |
+
John E. Hopcroft Department of Computer Science Cornell University, NY 14853, USA jeh@cs.cornell.edu
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
Deep learning models are vulnerable to adversarial examples crafted by applying human-imperceptible perturbations on benign inputs. However, under the blackbox setting, most existing adversaries often have a poor transferability to attack other defense models. In this work, from the perspective of regarding the adversarial example generation as an optimization process, we propose two new methods to improve the transferability of adversarial examples, namely Nesterov Iterative Fast Gradient Sign Method (NI-FGSM) and Scale-Invariant attack Method (SIM). NI-FGSM aims to adapt Nesterov accelerated gradient into the iterative attacks so as to effectively look ahead and improve the transferability of adversarial examples. While SIM is based on our discovery on the scale-invariant property of deep learning models, for which we leverage to optimize the adversarial perturbations over the scale copies of the input images so as to avoid “overfitting” on the white-box model being attacked and generate more transferable adversarial examples. NI-FGSM and SIM can be naturally integrated to build a robust gradient-based attack to generate more transferable adversarial examples against the defense models. Empirical results on ImageNet dataset demonstrate that our attack methods exhibit higher transferability and achieve higher attack success rates than state-of-the-art gradient-based attacks.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Deep learning models have been shown to be vulnerable to adversarial examples (Goodfellow et al., 2014; Szegedy et al., 2014), which are generated by applying human-imperceptible perturbations on benign input to result in the misclassification. In addition, adversarial examples have an intriguing property of transferability, where adversarial examples crafted by the current model can also fool other unknown models. As adversarial examples can help identify the robustness of models (Arnab et al., 2018), as well as improve the robustness of models by adversarial training (Goodfellow et al., 2014), learning how to generate adversarial examples with high transferability is important and has gained increasing attentions in the literature (Liu et al., 2016; Dong et al., 2018; Xie et al., 2019; Dong et al., 2019; Wang et al., 2019).
|
| 20 |
+
|
| 21 |
+
Several gradient-based attacks have been proposed to generate adversarial examples, such as onestep attacks (Goodfellow et al., 2014) and iterative attacks (Kurakin et al., 2016; Dong et al., 2018). Under the white-box setting, with the knowledge of the current model, existing attacks can achieve high success rates. However, they often exhibit low success rates under the black-box setting, especially for models with defense mechanism, such as adversarial training (Madry et al., 2018; Song et al., 2019) and input modification (Liao et al., 2018; Xie et al., 2018). Under the black-box setting, most existing attacks fail to generate robust adversarial examples against defense models.
|
| 22 |
+
|
| 23 |
+
In this work, by regarding the adversarial example generation process as an optimization process, we propose two new methods to improve the transferability of adversarial examples: Nesterov Iterative Fast Gradient Sign Method (NI-FGSM) and Scale-Invariant attack Method (SIM).
|
| 24 |
+
|
| 25 |
+
• Inspired by the fact that Nesterov accelerated gradient (Nesterov, 1983) is superior to momentum for conventionally optimization (Sutskever et al., 2013), we adapt Nesterov accelerated gradient into the iterative gradient-based attack, so as to effectively look ahead and improve the transferability of adversarial examples. We expect that NI-FGSM could replace the momentum iterative gradient-based method (Dong et al., 2018) in the gradient accumulating portion and yield higher performance.
|
| 26 |
+
• Besides, we discover that deep learning models have the scale-invariant property, and propose a Scale-Invariant attack Method (SIM) to improve the transferability of adversarial examples by optimizing the adversarial perturbations over the scale copies of the input images. SIM can avoid “overfitting” on the white-box model being attacked and generate more transferable adversarial examples against other black-box models.
|
| 27 |
+
• We found that combining our NI-FGSM and SIM with existing gradient-based attack methods (e.g., diverse input method (Xie et al., 2019)) can further boost the attack success rates of adversarial examples.
|
| 28 |
+
|
| 29 |
+
Extensive experiments on the ImageNet dataset (Russakovsky et al., 2015) show that our methods attack both normally trained models and adversarially trained models with higher attack success rates than existing baseline attacks. Our best attack method, SI-NI-TI-DIM (Scale-Invariant Nesterov Iterative FGSM integrated with translation-invariant diverse input method), reaches an average success rate of $9 3 . 5 \%$ against adversarially trained models under the black-box setting. For further demonstration, we evaluate our methods by attacking the latest robust defense methods (Liao et al., 2018; Xie et al., 2018; Liu et al., 2019; Jia et al., 2019; Cohen et al., 2019). The results show that our attack methods can generate adversarial examples with higher transferability than state-of-theart gradient-based attacks.
|
| 30 |
+
|
| 31 |
+
# 2 PRELIMINARY
|
| 32 |
+
|
| 33 |
+
# 2.1 NOTATION
|
| 34 |
+
|
| 35 |
+
Let $x$ and $y ^ { t r u e }$ be a benign image and the corresponding true label, respectively. Let ${ J } ( x , y ^ { t r u e } )$ be the loss function of the classifier (e.g. the cross-entropy loss). Let $x ^ { a d \hat { v } }$ be the adversarial example of the benign image $x$ . The goal of the non-targeted adversaries is to search an adversarial example $x ^ { a d v }$ to maximize the loss $\mathsf { \bar { J } } ( x ^ { a d v } , y ^ { t r u e } )$ in the $\ell _ { p }$ norm bounded perturbations. To align with previous works, we focus on $p = \infty$ in this work to measure the distortion between $x ^ { a d v }$ and $x$ . That is $\left\| x ^ { a d v } - x \right\| _ { \infty } \leq \epsilon$ , where $\epsilon$ is the magnitude of adversarial perturbations.
|
| 36 |
+
|
| 37 |
+
# 2.2 ATTACK METHODS
|
| 38 |
+
|
| 39 |
+
Several attack methods have been proposed to generate adversarial examples. Here we provide a brief introduction.
|
| 40 |
+
|
| 41 |
+
Fast Gradient Sign Method (FGSM). FGSM (Goodfellow et al., 2014) generates an adversarial example $x ^ { a d v }$ by maximizing the loss function $J ( x ^ { a d v } , y ^ { t r u e } )$ with one-step update as:
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\begin{array} { r } { x ^ { a d v } = x + \epsilon \cdot \mathrm { s i g n } ( \nabla _ { x } J ( x , y ^ { t r u e } ) ) , } \end{array}
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $\mathrm { s i g n } ( \cdot )$ function restricts the perturbation in the $L _ { \infty }$ norm bound.
|
| 48 |
+
|
| 49 |
+
Iterative Fast Gradient Sign Method (I-FGSM). Kurakin et al. (2016) extend FGSM to an iterative version by applying FGSM with a small step size $\alpha$ :
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\begin{array} { r } { \boldsymbol { x } _ { 0 } = \boldsymbol { x } , ~ \boldsymbol { x } _ { t + 1 } ^ { a d v } = \mathrm { C l i p } _ { x } ^ { \epsilon } \{ \boldsymbol { x } _ { t } ^ { a d v } + \alpha \cdot \mathrm { s i g n } ( \nabla _ { x } J ( \boldsymbol { x } _ { t } ^ { a d v } , y ^ { t r u e } ) ) \} , } \end{array}
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where $\mathrm { C l i p } _ { x } ^ { \epsilon } ( \cdot )$ function restricts generated adversarial examples to be within the $\epsilon$ -ball of $x$
|
| 56 |
+
|
| 57 |
+
Projected Gradient Descent (PGD). PGD attack (Madry et al., 2018) is a strong iterative variant of FGSM. It consists of a random start within the allowed norm ball and then follows by running several iterations of I-FGSM to generate adversarial examples.
|
| 58 |
+
|
| 59 |
+
Momentum Iterative Fast Gradient Sign Method (MI-FGSM). Dong et al. (2018) integrate momentum into the iterative attack and lead to a higher transferability for adversarial examples. Their update procedure is formalized as follows:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r l } & { g _ { t + 1 } = \mu \cdot g _ { t } + \frac { \nabla _ { x } J ( x _ { t } ^ { a d v } , y ^ { t r u e } ) } { \left\| \nabla _ { x } J ( x _ { t } ^ { a d v } , y ^ { t r u e } ) \right\| _ { 1 } } , } \\ & { x _ { t + 1 } ^ { a d v } = \mathrm { C l i p } _ { x } ^ { \epsilon } \{ x _ { t } ^ { a d v } + \alpha \cdot \mathrm { s i g n } ( g _ { t + 1 } ) \} , } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $g _ { t }$ is the accumulated gradient at iteration $t$ , and $\mu$ is the decay factor of $g _ { t }$
|
| 66 |
+
|
| 67 |
+
Diverse Input Method (DIM). Xie et al. (2019) optimize the adversarial perturbations over the diverse transformation of the input image at each iteration. The transformations include the random resizing and the random padding. DIM can be naturally integrated into other gradient-based attacks to further improve the transferability of adversarial examples.
|
| 68 |
+
|
| 69 |
+
Translation-Invariant Method (TIM). Instead of optimizing the adversarial perturbations on a single image, Dong et al. (2019) use a set of translated images to optimize the adversarial perturbations. They further develop an efficient algorithm to calculate the gradients by convolving the gradient at untranslated images with a kernel matrix. TIM can also be naturally integrated with other gradientbased attack methods. The combination of TIM and DIM, namely TI-DIM, is the current strongest black-box attack method.
|
| 70 |
+
|
| 71 |
+
Carlini & Wagner attack (C&W). C&W attack (Carlini & Wagner, 2017) is an optimization-based method which directly optimizes the distance between the benign examples and the adversarial examples by solving:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\operatorname * { a r g m i n } _ { x ^ { a d v } } \ \left\| x ^ { a d v } - x \right\| _ { p } - c \cdot J ( x ^ { a d v } , y ^ { t r u e } ) .
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
It is a powerful method to find adversarial examples while minimizing perturbations for white-box attacks, but it lacks the transferability for black-box attacks.
|
| 78 |
+
|
| 79 |
+
# 2.3 DEFENSE METHODS
|
| 80 |
+
|
| 81 |
+
Various defense methods have been proposed to against adversarial examples, which can fall into the following two categories.
|
| 82 |
+
|
| 83 |
+
Adversarial Training. One popular and promising defense method is adversarial training (Goodfellow et al., 2014; Szegedy et al., 2014; Zhai et al., 2019; Song et al., 2020), which augments the training data by the adversarial examples in the training process. Madry et al. (2018) develop a successful adversarial training method, which leverages the projected gradient descent (PGD) attack to generate adversarial examples. However, this method is difficult to scale to large-scale datasets (Kurakin et al., 2017). Tramr et al. (2018) propose ensemble adversarial training by augmenting the training data with perturbations transferred from various models , so as to further improve the robustness against the black-box attacks. Currently, adversarial training is still one of the best techniques to defend against adversarial attacks.
|
| 84 |
+
|
| 85 |
+
Input Modification. The second category of defense methods aims to mitigate the effects of adversarial perturbations by modifying the input data. Guo et al. (2018) discover that there exists a range of image transformations, which have the potential to remove adversarial perturbations while preserving the visual information of the images. Xie et al. (2018) mitigate the adversarial effects through random transformations. Liao et al. (2018) propose high-level representation guided denoiser to purify the adversarial examples. Liu et al. (2019) propose a JPEG-based defensive compression framework to rectify adversarial examples without impacting classification accuracy on benign data. Jia et al. (2019) leverage an end-to-end image compression model to defend adversarial examples. Although these defense methods perform well in practice, they can not tell whether the model is truly robust to adversarial perturbations. Cohen et al. (2019) use randomized smoothing to obtain an ImageNet classifier with certified adversarial robustness.
|
| 86 |
+
|
| 87 |
+
# 3 METHODOLOGY
|
| 88 |
+
|
| 89 |
+
# 3.1 MOTIVATION
|
| 90 |
+
|
| 91 |
+
Similar with the process of training neural networks, the process of generating adversarial examples can also be viewed as an optimization problem. In the optimizing phase, the white-box model being attacked to optimize the adversarial examples can be viewed as the training data on the training process. And the adversarial examples can be viewed as the training parameters of the model. Then in the testing phase, the black-box models to evaluate the adversarial examples can be viewed as the testing data of the model.
|
| 92 |
+
|
| 93 |
+
From the perspective of the optimization, the transferability of the adversarial examples is similar with the generalization ability of the trained models (Dong et al., 2018). Thus, we can migrate the methods used to improve the generalization of models to the generation of adversarial examples, so as to improving the transferability of adversarial examples.
|
| 94 |
+
|
| 95 |
+
Many methods have been proposed to improve the generalization ability of the deep learning models, which can be split to two aspects: (1) better optimization algorithm, such as Adam optimizer(Kingma & Ba, 2014); (2) data augmentation (Simonyan & Zisserman, 2014). Correspondingly, the methods to improve the transferability of adversarial examples can also be split to two aspects: (1) better optimization algorithm, such as MI-FGSM, which applies the idea of momentum; (2) model augmentation (i.e., ensemble attack on multiple models), such as the work of Dong et al. (2018), which considers to attack multiple models simultaneously. Based on above analysis, we aim to improve the transferability of adversarial examples by applying the idea of Nesterov accelerated gradient for optimization and using a set of scaled images to achieve model augmentation.
|
| 96 |
+
|
| 97 |
+
# 3.2 NESTEROV ITERATIVE FAST GRADIENT SIGN METHOD
|
| 98 |
+
|
| 99 |
+
Nesterov Accelerated Gradient (NAG) (Nesterov, 1983) is a slight variation of normal gradient descent, which can speed up the training process and improve the convergence significantly. NAG can be viewed as an improved momentum method, which can be expressed as:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\begin{array} { r l } & { v _ { t + 1 } = \mu \cdot v _ { t } + \nabla _ { \theta _ { t } } J ( \theta _ { t } - \alpha \cdot \mu \cdot v _ { t } ) , } \\ & { \qquad \theta _ { t + 1 } = \theta _ { t } - \alpha \cdot v _ { t + 1 } . } \end{array}
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
Typical gradient-based iterative attacks (e.g., I-FGSM) greedily perturb the images in the direction of the sign of the gradient at each iteration, which usually falls into poor local maxima, and shows weak transferability than single-step attacks (e.g., FGSM). Dong et al. (2018) show that adopting momentum (Polyak, 1964) into attacks can stabilize the update directions, which helps to escape from poor local maxima and improve the transferability. Compared to momentum, beyond stabilize the update directions, the anticipatory update of NAG gives previous accumulated gradient a correction that helps to effectively look ahead. Such looking ahead property of NAG can help us escape from poor local maxima easier and faster, resulting in the improvement on transferability.
|
| 106 |
+
|
| 107 |
+
We integrate NAG into the iterative gradient-based attack to leverage the looking ahead property of NAG and build a robust adversarial attack, which we refer to as NI-FGSM (Nesterov Iterative Fast Gradient Sign Method). Specifically, we make a jump in the direction of previous accumulated gradients before computing the gradients in each iteration. Start with $g _ { 0 } = 0$ , the update procedure of NI-FGSM can be formalized as follows:
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
x _ { t } ^ { n e s } = x _ { t } ^ { a d v } + \alpha \cdot \mu \cdot g _ { t } ,
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
g _ { t + 1 } = \mu \cdot g _ { t } + \frac { \nabla _ { x } J ( x _ { t } ^ { n e s } , y ^ { t r u e } ) } { \| \nabla _ { x } J ( x _ { t } ^ { n e s } , y ^ { t r u e } ) \| _ { 1 } } ,
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\begin{array} { r } { x _ { t + 1 } ^ { a d v } = \mathrm { C l i p } _ { x } ^ { \epsilon } \{ x _ { t } ^ { a d v } + \alpha \cdot \mathrm { s i g n } ( g _ { t + 1 } ) \} , } \end{array}
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
where $g _ { t }$ denotes the accumulated gradients at the iteration $t$ , and $\mu$ denotes the decay factor of $g _ { t }$ .
|
| 122 |
+
|
| 123 |
+
# 3.3 SCALE-INVARIANT ATTACK METHOD
|
| 124 |
+
|
| 125 |
+
Besides considering a better optimization algorithm for the adversaries, we can also improve the transferability of adversarial examples by model augmentation. We first introduce a formal definition of loss-preserving transformation and model augmentation as follows.
|
| 126 |
+
|
| 127 |
+
Definition 1 Loss-preserving Transformation. Given an input $x$ with its ground-truth label $y ^ { t r u e }$ and a classifier $f ( x ) : x \in \mathcal { X } \to y \in \mathcal { Y }$ with the cross-entropy loss $J ( x , y )$ , if there exists an input transformation $\tau ( \cdot )$ that satisfies $J ( \mathcal { T } ( x ) , y ^ { t r u e } ) \approx J ( x , y ^ { t r u e } )$ for any $x \in \mathcal { X }$ , we say $\tau ( \cdot )$ is $a$ loss-preserving transformation.
|
| 128 |
+
|
| 129 |
+
Definition 2 Model Augmentation. Given an input $x$ with its ground-truth label $y ^ { t r u e }$ and a model $f ( x ) : x \in \mathcal { X } \to y \in \mathcal { Y }$ with the cross-entropy loss $J ( x , y )$ , if there exists a loss-preserving transformation $\tau ( \cdot )$ , then we derive a new model by $f ^ { \prime } ( x ) = f ( \mathcal { T } ( x ) )$ from the original model $f$ . we define such derivation of models as model augmentation.
|
| 130 |
+
|
| 131 |
+
Intuitively, similar to the generalization of models that can be improved by feeding more training data, the transferability of adversarial examples can be improved by attacking more models simultaneously. Dong et al. (2018) enhance the gradient-based attack by attacking an ensemble of models. However, their approach requires training a set of different models to attack, which has a large computational cost. Instead, in this work, we derive an ensemble of models from the original model by model augmentation, which is a simple way of obtaining multiple models via the loss-preserving transformation.
|
| 132 |
+
|
| 133 |
+
To get the loss-preserving transformation, we discover that deep neural networks might have the scale-invariant property, besides the translation invariance. Specifically, the loss values are similar for the original and the scaled images on the same model, which is empirically validated in Section 4.2. Thus, the scale transformation can be served as a model augmentation method. Driven by the above analysis, we propose a Scale-Invariant attack Method (SIM), which optimizes the adversarial perturbations over the scale copies of the input image:
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\begin{array} { c } { { \displaystyle \arg \operatorname* { m a x } _ { \boldsymbol { x } ^ { a d v } } \frac { 1 } { m } \sum _ { i = 0 } ^ { m } J ( S _ { i } ( x ^ { a d v } ) , y ^ { t r u e } ) , } } \\ { { \mathrm { s . t . } \left\| x ^ { a d v } - x \right\| _ { \infty } \leq \epsilon , } } \end{array}
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
where $S _ { i } ( x ) = x / 2 ^ { i }$ denotes the scale copy of the input image $x$ with the scale factor $1 / 2 ^ { i }$ , and $m$ denotes the number of the scale copies. With SIM, instead of training a set of models to attack, we can effectively achieve ensemble attacks on multiple models by model augmentation. More importantly, it can help avoid “overfitting” on the white-box model being attacked and generate more transferable adversarial examples.
|
| 140 |
+
|
| 141 |
+
# 3.4 ATTACK ALGORITHM
|
| 142 |
+
|
| 143 |
+
For the gradient processing of crafting adversarial examples, NI-FGSM introduces a better optimization algorithm to stabilize and correct the update directions at each iteration. For the ensemble attack of crafting adversarial examples, SIM introduces model augmentation to derive multiple models to attack from a single model. Thus, NI-FGSM and SIM can be naturally combined to build a stronger attack, which we refer to as SI-NI-FGSM (Scale-Invariant Nesterov Iterative Fast Gradient Sign Method). The algorithm of SI-NI-FGSM attack is summarized in Algorithm 1.
|
| 144 |
+
|
| 145 |
+
In addition, SI-NI-FGSM can be integrated with DIM (Diverse Input Method), TIM (TranslationInvariant Method) and TI-DIM (Translation-Invariant with Diverse Input Method) as SI-NI-DIM, SINI-TIM and SI-NI-TI-DIM, respectively, to further boost the transferability of adversarial examples. The detailed algorithms for these attack methods are provided in Appendix A.
|
| 146 |
+
|
| 147 |
+
# 4 EXPERIMENTAL RESULTS
|
| 148 |
+
|
| 149 |
+
In this section, we provide experimental evidence on the advantage of the proposed methods. We first provide experimental setup, followed by the exploration of the scale-invariance property for deep learning models. We then compare the results of the proposed methods with baseline methods in Section 4.3 and 4.4 on both normally trained models and adversarially trained models. Beyond the defense models based on adversarial training, we also quantify the effectiveness of the proposed methods on other advanced defense in Section 4.5. Additional discussions, the comparison between NI-FGSM and MI-FGSM and the comparison with classic attacks, are in Section 4.6. Code is available at https://github.com/JHL-HUST/SI-NI-FGSM.
|
| 150 |
+
|
| 151 |
+
# Algorithm 1 SI-NI-FGSM
|
| 152 |
+
|
| 153 |
+
Input: A clean example $x$ with ground-truth label $y ^ { t r u e }$ ; a classifier $f$ with loss function $J$ ; Input: Perturbation size $\epsilon$ ; maximum iterations $T$ ; number of scale copies $m$ and decay factor $\mu$ Output: An adversarial example $x ^ { a d v }$
|
| 154 |
+
|
| 155 |
+
1: $\alpha = \epsilon / T$
|
| 156 |
+
2: $g _ { 0 } = { \dot { 0 } } ; x _ { 0 } ^ { a d v } = x$
|
| 157 |
+
3: for $t = 0$ to $T - 1$ do
|
| 158 |
+
4: $g = 0$
|
| 159 |
+
5: Get $\boldsymbol { x } _ { t } ^ { n e s }$ by Eq.(6) $\triangleright$ make a jump in the direction of previous accumulated gradients
|
| 160 |
+
6: for $i = 0$ to $m - 1$ do $\triangleright$ sum the gradients over the scale copies of the input image
|
| 161 |
+
7: Get the gradients by $\nabla _ { x } J ( S _ { i } ( x _ { t } ^ { n e s } ) , y ^ { t r u e } )$
|
| 162 |
+
8: Sum the gradients as $g = g + \nabla _ { x } J ( S _ { i } ( x _ { t } ^ { n e s } ) , y ^ { t r u e } )$
|
| 163 |
+
9: Get average gradients as $\begin{array} { r } { g = \frac { 1 } { m } \cdot g } \end{array}$
|
| 164 |
+
10: Update gt+1 by gt+1 = µ · gt + gkgk
|
| 165 |
+
11: Update $x _ { t + 1 } ^ { a d v }$ by Eq.(8)
|
| 166 |
+
12: return xadv $x ^ { a d v } = x _ { T } ^ { a d v }$
|
| 167 |
+
|
| 168 |
+
# 4.1 EXPERIMENTAL SETUP
|
| 169 |
+
|
| 170 |
+
Dataset. We randomly choose 1000 images belonging to the 1000 categories from ILSVRC 2012 validation set, which are almost correctly classified by all the testing models.
|
| 171 |
+
|
| 172 |
+
Models. For normally trained models, we consider Inception-v3 (Inc-v3) (Szegedy et al., 2016), Inception-v4 (Inc-v4), Inception-Resnet-v2 (IncRes-v2) (Szegedy et al., 2017) and Resnet-v2-101 (Res-101) (He et al., 2016). For adversarially trained models, we consider Inc- $\mathbf { \nabla \cdot v 3 _ { e n s 3 } }$ , Inc- $\mathbf { \nabla \cdot v } 3 _ { \mathrm { e n s 4 } }$ and IncRes- $\mathbf { \nabla \cdot v } 2 _ { \mathrm { e n s } }$ (Tramr et al., 2018).
|
| 173 |
+
|
| 174 |
+
Additionally, we include other advanced defense models: high-level representation guided denoiser (HGD) (Liao et al., 2018), random resizing and padding (R&P) (Xie et al., 2018), NIPS- $. \mathrm { r } 3 ^ { 1 }$ , feature distillation (FD) (Liu et al., 2019), purifying perturbations via image compression model (Comdefend) (Jia et al., 2019) and randomized smoothing (RS) (Cohen et al., 2019).
|
| 175 |
+
|
| 176 |
+
Baselines. We integrate our methods with DIM (Xie et al., 2019), TIM, and TI-DIM (Dong et al., 2019), to show the performance improvement of SI-NI-FGSM over these baselines. Denote our SI-NI-FGSM integrated with other attacks as SI-NI-DIM, SI-NI-TIM, and SI-NI-TIM-DIM, respectively.
|
| 177 |
+
|
| 178 |
+
Hyper-parameters. For the hyper-parameters, we follow the settings in (Dong et al., 2018) with the maximum perturbation as $\epsilon = 1 6$ , number of iteration $T = 1 0$ , and step size $\alpha = 1 . 6$ . For MI-FGSM, we adopt the default decay factor $\mu = 1 . 0$ . For DIM, the transformation probability is set to 0.5. For TIM, we adopt the Gaussian kernel and the size of the kernel is set to $7 \times 7$ . For our SI-NI-FGSM, the number of scale copies is set to $m = 5$ .
|
| 179 |
+
|
| 180 |
+
# 4.2 SCALE-INVARIANT PROPERTY
|
| 181 |
+
|
| 182 |
+
To validate the scale-invariant property of deep neural networks, we randomly choose 1,000 original images from ImageNet dataset and keep the scale size in the range of [0.1, 2.0] with a step size 0.1. Then we feed the scaled images into the testing models, including Inc-v3, Inc-v4, IncRes-2, and Res-101, to get the average loss over 1,000 images.
|
| 183 |
+
|
| 184 |
+
As shown in Figure 1, we can easily observe that the loss curves are smooth and stable when the scale size is in range [0.1, 1.3]. That is, the loss values are very similar for the original and scaled images. So we assume that the scale-invariant property of deep models is held within [0.1, 1.3], and we leverage the scale-invariant property to optimize the adversarial perturbations over the scale copies of the input images.
|
| 185 |
+
|
| 186 |
+

|
| 187 |
+
Figure 1: The average losses for Inc-v3, Inc-v4, IncRes-v2 and Res-101 at each scale size. The results are averaged over 1000 images.
|
| 188 |
+
|
| 189 |
+
# 4.3 ATTACKING A SINGLE MODEL
|
| 190 |
+
|
| 191 |
+
In this subsection, we integrate our SI-NI-FGSM with TIM, DIM and TI-DIM, respectively, and compare the black-box attack success rates of our extensions with the baselines under single model setting. As shown in Table 1, our extension methods consistently outperform the baseline attacks by $1 0 \% \sim 3 5 \%$ under the black-box setting, and achieve nearly $100 \%$ success rates under the white-box setting. It indicates that SI-NI-FGSM can serve as a powerful approach to improve the transferability of adversarial examples.
|
| 192 |
+
|
| 193 |
+
# 4.4 ATTACKING AN ENSEMBLE OF MODELS
|
| 194 |
+
|
| 195 |
+
Following the work of (Liu et al., 2016), we consider to show the performance of our methods by attacking multiple models simultaneously. Specifically, we attack an ensemble of normally trained models (including Inc-v3, Inc-v4, IncRes-v2 and Res-101) with equal ensemble weights using TIM, SI-NI-TIM, DIM, SI-NI-DIM, TI-DIM and SI-NI-TI-DIM, respectively.
|
| 196 |
+
|
| 197 |
+
As shown in Table 2, our methods improve the attack success rates across all experiments over the baselines. In general, our methods consistently outperform the baseline attacks by $1 0 \% \sim 3 0 \%$ under the black-box setting. Especially, SI-NI-TI-DIM, the extension by combining SI-NI-FGSM with TI-DIM, can fool the adversarially trained models with a high average success rate of $9 3 . 5 \%$ . It indicates that these advanced adversarially trained models provide little robustness guarantee under the black-box attack of SI-NI-TI-DIM.
|
| 198 |
+
|
| 199 |
+
# 4.5 ATTACKING OTHER ADVANCED DEFENSE MODELS
|
| 200 |
+
|
| 201 |
+
Besides normally trained models and adversarially trained models, we consider to quantify the effectiveness of our methods on other advanced defenses, including the top-3 defense solutions in the NIPS competition (high-level representation guided denoiser (HGD, rank-1) (Liao et al., 2018), random resizing and padding (R&P, rank-2) (Xie et al., 2018) and the rank-3 submission (NIPS-r3), and three recently proposed defense methods (feature distillation (FD) (Liu et al., 2019), purifying perturbations via image compression model (Comdefend) (Jia et al., 2019) and randomized smoothing (RS) (Cohen et al., 2019)).
|
| 202 |
+
|
| 203 |
+
We compare our SI-NI-TI-DIM with MI-FGSM (Dong et al., 2018), which is the top-1 attack solution in the NIPS 2017 competition, and TI-DIM (Dong et al., 2019), which is state-of-the-art attack. We first generate adversarial examples on the ensemble models, including Inc-v3, Inc-v4, IncResv2, and Res-101 by using MI-FGSM, TI-DIM, and SI-NI-TI-DIM, respectively. Then, we evaluate the adversarial examples by attacking these defenses.
|
| 204 |
+
|
| 205 |
+
As shown in Table 3, our method SI-NI-TI-DIM achieves an average attack success rate of $9 0 . 3 \%$ surpassing state-of-the-art attacks by a large margin of $1 4 . 7 \%$ . By solely depending on the trans
|
| 206 |
+
|
| 207 |
+
# (a) Comparison of TIM and the SI-NI-TIM extension.
|
| 208 |
+
|
| 209 |
+
Table 1: Attack success rates $( \% )$ of adversarial attacks against seven models under singlemodel setting. The adversarial examples are crafted on Inc-v3, Inc-v4, IncRes-v2, and Res-101 respectively. \* indicates the white-box attacks.
|
| 210 |
+
|
| 211 |
+
<table><tr><td>Model</td><td>Attack</td><td>Inc-v3</td><td>Inc-v4</td><td>IncRes-v2</td><td>Res-101</td><td>Inc-v3ens3</td><td>Inc-v3ens4</td><td>IncRes-v2ens</td></tr><tr><td rowspan="2">Inc-v3</td><td>TIM</td><td>100.0*</td><td>47.8</td><td>42.8</td><td>39.5</td><td>24.0</td><td>21.4</td><td>12.9</td></tr><tr><td>SI-NI-TIM (Ours)</td><td>100.0*</td><td>77.2</td><td>75.8</td><td>66.5</td><td>51.8</td><td>45.9</td><td>33.5</td></tr><tr><td rowspan="2">Inc-v4</td><td>TIM</td><td>58.5</td><td>99.6*</td><td>47.5</td><td>43.2</td><td>25.7</td><td>23.3</td><td>17.3</td></tr><tr><td>SI-NI-TIM (Ours)</td><td>83.5</td><td>100.0*</td><td>76.6</td><td>68.9</td><td>57.8</td><td>54.3</td><td>42.9</td></tr><tr><td rowspan="2">IncRes-v2</td><td>TIM</td><td>62.0</td><td>56.2</td><td>97.5*</td><td>51.3</td><td>32.8</td><td>27.9</td><td>21.9</td></tr><tr><td>SI-NI-TIM(Ours)</td><td>86.4</td><td>83.2</td><td>99.5*</td><td>77.2</td><td>66.1</td><td>60.2</td><td>57.1</td></tr><tr><td rowspan="2">Res-101</td><td>TIM</td><td>59.0</td><td>53.6</td><td>51.8</td><td>99.3*</td><td>36.8</td><td>32.2</td><td>23.5</td></tr><tr><td>SI-NI-TIM (Ours)</td><td>78.3</td><td>74.1</td><td>73.0</td><td>99.8*</td><td>58.9</td><td>53.9</td><td>43.1</td></tr></table>
|
| 212 |
+
|
| 213 |
+
(b) Comparison of DIM and the SI-NI-DIM extension.
|
| 214 |
+
|
| 215 |
+
<table><tr><td>Model</td><td>Attack</td><td>Inc-v3</td><td>Inc-v4</td><td>IncRes-v2</td><td>Res-101</td><td>Inc-v3ens3</td><td>Inc-v3ens4</td><td>IncRes-v2ens</td></tr><tr><td rowspan="2">Inc-v3</td><td>DIM</td><td>98.7*</td><td>67.7</td><td>62.9</td><td>54.0</td><td>20.5</td><td>18.4</td><td>9.7</td></tr><tr><td>SI-NI-DIM(Ours)</td><td>99.6*</td><td>84.7</td><td>81.7</td><td>75.4</td><td>36.9</td><td>34.6</td><td>20.2</td></tr><tr><td rowspan="2">Inc-v4</td><td>DIM</td><td>70.7</td><td>98.0*</td><td>63.2</td><td>55.9</td><td>21.9</td><td>22.3</td><td>11.9</td></tr><tr><td>SI-NI-DIM (Ours)</td><td>89.7</td><td>99.3*</td><td>84.5</td><td>78.5</td><td>47.6</td><td>45.0</td><td>28.9</td></tr><tr><td rowspan="2">IncRes-v2</td><td>DIM</td><td>69.1</td><td>63.9</td><td>93.6*</td><td>57.4</td><td>29.4</td><td>24.0</td><td>17.3</td></tr><tr><td>SI-NI-DIM (Ours)</td><td>89.7</td><td>86.4</td><td>99.1*</td><td>81.2</td><td>55.0</td><td>48.2</td><td>38.1</td></tr><tr><td rowspan="2">Res-101</td><td>DIM</td><td>75.9</td><td>70.0</td><td>71.0</td><td>98.3*</td><td>36.0</td><td>32.4</td><td>19.3</td></tr><tr><td>SI-NI-DIM(Ours)</td><td>88.7</td><td>84.2</td><td>84.4</td><td>99.3*</td><td>52.4</td><td>48.0</td><td>33.2</td></tr></table>
|
| 216 |
+
|
| 217 |
+
(c) Comparison of TI-DIM and the SI-NI-TI-DIM extension.
|
| 218 |
+
|
| 219 |
+
<table><tr><td>Model</td><td>Attack</td><td>Inc-v3</td><td>Inc-v4</td><td>IncRes-v2</td><td>Res-101</td><td>Inc-v3ens3</td><td>Inc-v3ens4</td><td>IncRes-v2ens</td></tr><tr><td rowspan="2">Inc-v3</td><td>TI-DIM</td><td>98.5*</td><td>66.1</td><td>63.0</td><td>56.1</td><td>38.6</td><td>34.9</td><td>22.5</td></tr><tr><td>SI-NI-TI-DIM(Ours)</td><td>99.6*</td><td>85.5</td><td>80.9</td><td>75.7</td><td>61.5</td><td>56.9</td><td>40.7</td></tr><tr><td rowspan="2">Inc-v4</td><td>TI-DIM</td><td>72.5</td><td>97.8*</td><td>63.4</td><td>54.5</td><td>38.1</td><td>35.2</td><td>25.3</td></tr><tr><td>SI-NI-TI-DIM(Ours)</td><td>88.1</td><td>99.3*</td><td>83.7</td><td>77.0</td><td>65.0</td><td>63.1</td><td>49.4</td></tr><tr><td rowspan="2">IncRes-v2</td><td>TI-DIM</td><td>73.2</td><td>67.5</td><td>92.4*</td><td>61.3</td><td>46.4</td><td>40.2</td><td>35.8</td></tr><tr><td>SI-NI-TI-DIM(Ours)</td><td>89.6</td><td>87.0</td><td>99.1*</td><td>83.9</td><td>74.0</td><td>67.9</td><td>63.7</td></tr><tr><td rowspan="2">Res-101</td><td>TI-DIM</td><td>74.9</td><td>69.8</td><td>70.5</td><td>98.7*</td><td>52.6</td><td>49.1</td><td>37.8</td></tr><tr><td>SI-NI-TI-DIM(Ours)</td><td>86.4</td><td>82.6</td><td>84.6</td><td>99.0*</td><td>72.6</td><td>66.8</td><td>56.4</td></tr></table>
|
| 220 |
+
|
| 221 |
+
Table 2: Attack success rates $( \% )$ of adversarial attacks against seven models under multimodel setting. \* indicates the white-box models being attacked.
|
| 222 |
+
|
| 223 |
+
<table><tr><td>Attack</td><td>Inc-v3*</td><td>Inc-v4*</td><td>IncRes-v2*</td><td>Res-101*</td><td>Inc-v3ens3</td><td>Inc-v3ens4</td><td>IncRes-v2ens</td></tr><tr><td>TIM</td><td>99.9</td><td>99.3</td><td>99.3</td><td>99.8</td><td>71.6</td><td>67.0</td><td>53.2</td></tr><tr><td>SI-NI-TIM(Ours)</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>93.2</td><td>90.1</td><td>84.5</td></tr><tr><td>DIM</td><td>99.7</td><td>99.2</td><td>98.9</td><td>98.9</td><td>66.4</td><td>60.9</td><td>41.6</td></tr><tr><td>SI-NI-DIM (Ours)</td><td>100.0</td><td>100.0</td><td>100.0</td><td>99.9</td><td>88.2</td><td>85.1</td><td>69.7</td></tr><tr><td>TI-DIM</td><td>99.6</td><td>98.8</td><td>98.8</td><td>98.9</td><td>85.2</td><td>80.2</td><td>73.3</td></tr><tr><td>SI-NI-TI-DIM(Ours)</td><td>99.9</td><td>99.9</td><td>99.9</td><td>99.9</td><td>96.0</td><td>94.3</td><td>90.3</td></tr></table>
|
| 224 |
+
|
| 225 |
+
ferability of adversarial examples and attacking on the normally trained models, SI-NI-TI-DIM can fool the adversarially trained models and other advanced defense mechanism, raising a new security issue for the development of more robust deep learning models. Some adversarial examples generated by SI-NI-TI-DIM are shown in Appendix B.
|
| 226 |
+
|
| 227 |
+
Table 3: Attack success rates $( \% )$ of adversarial attacks against the advanced defense methods.
|
| 228 |
+
|
| 229 |
+
<table><tr><td>Attack</td><td>HGD</td><td>R&P</td><td>NIPS-r3</td><td>FD</td><td>ComDefend</td><td>RS</td><td>Average</td></tr><tr><td>MI-FGSM</td><td>36.9</td><td>29.3</td><td>40.8</td><td>51.6</td><td>47.5</td><td>27.1</td><td>38.9</td></tr><tr><td>TI-DIM</td><td>84.8</td><td>75.3</td><td>80.7</td><td>83.5</td><td>79.1</td><td>50.3</td><td>75.6</td></tr><tr><td>SI-NI-TI-DIM (Ours)</td><td>96.1</td><td>91.3</td><td>94.4</td><td>95.4</td><td>93.3</td><td>71.4</td><td>90.3</td></tr></table>
|
| 230 |
+
|
| 231 |
+
# 4.6 FURTHER ANALYSIS
|
| 232 |
+
|
| 233 |
+
NI-FGSM vs. MI-FGSM. We perform additional analysis for the difference between NI-FGSM with MI-FGSM (Dong et al., 2018). The adversarial examples are crafted on Inc-v3 with various number of iterations ranging from 4 to 16, and then transfer to attack Inc-v4 and IncRes-v2. As shown in Figure 2, NI-FGSM yields higher attack success rates than MI-FGSM with the same number of iterations. In another view, NI-FGSM needs fewer number of iterations to gain the same attack success rate of MI-FGSM. The results not only indicate that NI-FGSM has a better transferability, but also demonstrate that with the property of looking ahead, NI-FGSM can accelerate the generation of adversarial examples.
|
| 234 |
+
|
| 235 |
+

|
| 236 |
+
Figure 2: Attack success rates $( \% )$ of NI-FGSM and MI-FGSM on various number of iterations. The adversarial examples are crafted on Inc-v3 model against (a) Inc-v3 model, (b) Inc-v4 model and (c) IncRes-v2 model.
|
| 237 |
+
|
| 238 |
+
Comparison with classic attacks. We consider to make addition comparison with classic attacks, including FGSM (Goodfellow et al., 2014), I-FGSM (Kurakin et al., 2016), PGD (Madry et al., 2018) and C&W (Carlini & Wagner, 2017). As shown in Table 4, our methods achieve $100 \%$ attack success rate which is the same as C&W under the white-box setting, and significantly outperform other methods under the black-box setting.
|
| 239 |
+
|
| 240 |
+
Table 4: Attack success rates $( \% )$ of adversarial attacks against the models. The adversarial examples are crafted on Inc-v3 using FGSM, I-FGSM, PGD, C&W, NI-FGSM, and SI-NI-FGSM. \* indicates the white-box model being attacked.
|
| 241 |
+
|
| 242 |
+
<table><tr><td>Attack</td><td>Inc-v3*</td><td>Inc-v4</td><td>IncRes-v2</td><td>Res-101</td><td>Inc-v3ens3</td><td>Inc-v3ens4</td><td>IncRes-v2ens</td><td>Average</td></tr><tr><td>FGSM</td><td>67.1</td><td>26.7</td><td>25.0</td><td>24.4</td><td>10.5</td><td>10.0</td><td>4.5</td><td>24.0</td></tr><tr><td>I-FGSM</td><td>99.9</td><td>20.7</td><td>18.5</td><td>15.3</td><td>3.6</td><td>5.8</td><td>2.9</td><td>23.8</td></tr><tr><td>PGD</td><td>99.5</td><td>17.3</td><td>15.1</td><td>13.1</td><td>6.1</td><td>5.6</td><td>3.1</td><td>20.9</td></tr><tr><td>C&W</td><td>100.0</td><td>18.4</td><td>16.2</td><td>14.3</td><td>3.8</td><td>4.7</td><td>2.7</td><td>22.9</td></tr><tr><td>NI-FGSM(Ours)</td><td>100.0</td><td>52.6</td><td>51.4</td><td>41.0</td><td>12.9</td><td>12.8</td><td>6.4</td><td>39.6</td></tr><tr><td>SI-NI-FGSM(Ours)</td><td>100.0</td><td>76.0</td><td>73.3</td><td>67.6</td><td>31.6</td><td>30.0</td><td>17.4</td><td>56.6</td></tr></table>
|
| 243 |
+
|
| 244 |
+
# 5 CONCLUSION AND FUTURE WORK
|
| 245 |
+
|
| 246 |
+
In this work, we propose two new attack methods, namely Nesterov Iterative Fast Gradient Sign Method (NI-FGSM) and Scale-Invariant attack Method (SIM), to improve the transferability of adversarial examples. NI-FGSM aims to adopt Nesterov accelerated gradient method into the gradientbased attack, and SIM aims to achieve model augmentation by leveraging the scale-invariant property of models. NI-FGSM and SIM can be naturally combined to build a robust attack, namely SINI-FGSM. Moreover, by integrating SI-NI-FGSM with the baseline attacks, we can further improve the transferability of adversarial examples. Extensive experiments demonstrate that our methods not only yield higher success rates on adversarially trained models but also break other strong defense mechanism.
|
| 247 |
+
|
| 248 |
+
Our work of NI-FGSM suggests that other momentum methods (e.g. Adam) may also be helpful to build a strong attack, which will be our future work, and the key is how to migrate the optimization method to the gradient-based iterative attack. Our work also shows that deep neural networks have the scale-invariant property, which we utilized to design the SIM to improve the attack transferability. However, it is not clear why the scale-invariant property holds. Possibly it is due to the batch normalization at each convolutional layer, that may mitigate the impact of the scale change. We will also explore the reason more thoroughly in our future work.
|
| 249 |
+
|
| 250 |
+
# ACKNOWLEDGMENTS
|
| 251 |
+
|
| 252 |
+
This work is supported by the Fundamental Research Funds for the Central Universities (2019kfyXKJC021) and Microsoft Research Asia.
|
| 253 |
+
|
| 254 |
+
# REFERENCES
|
| 255 |
+
|
| 256 |
+
Anurag Arnab, Ondrej Miksik, and Philip HS Torr. On the robustness of semantic segmentation models to adversarial attacks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 888–897, 2018.
|
| 257 |
+
|
| 258 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In 2017 IEEE Symposium on Security and Privacy (SP), pp. 39–57, 2017.
|
| 259 |
+
|
| 260 |
+
Jeremy Cohen, Elan Rosenfeld, and Zico Kolter. Certified adversarial robustness via randomized smoothing. In International Conference on Machine Learning, pp. 1310–1320, 2019.
|
| 261 |
+
|
| 262 |
+
Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 9185–9193, 2018.
|
| 263 |
+
|
| 264 |
+
Yinpeng Dong, Tianyu Pang, Hang Su, and Jun Zhu. Evading defenses to transferable adversarial examples by translation-invariant attacks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4312–4321, 2019.
|
| 265 |
+
|
| 266 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 267 |
+
|
| 268 |
+
Chuan Guo, Mayank Rana, Moustapha Cisse, and Laurens van der Maaten. Countering adversarial images using input transformations. In International Conference on Learning Representations, 2018.
|
| 269 |
+
|
| 270 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European conference on computer vision, pp. 630–645. Springer, 2016.
|
| 271 |
+
|
| 272 |
+
Xiaojun Jia, Xingxing Wei, Xiaochun Cao, and Hassan Foroosh. Comdefend: An efficient image compression model to defend adversarial examples. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6084–6092, 2019.
|
| 273 |
+
|
| 274 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 275 |
+
|
| 276 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
|
| 277 |
+
|
| 278 |
+
Alexey Kurakin, Ian J. Goodfellow, and Samy Bengio. Adversarial machine learning at scale. In International Conference on Learning Representations, 2017.
|
| 279 |
+
|
| 280 |
+
Fangzhou Liao, Ming Liang, Yinpeng Dong, Tianyu Pang, Xiaolin Hu, and Jun Zhu. Defense against adversarial attacks using high-level representation guided denoiser. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1778–1787, 2018.
|
| 281 |
+
|
| 282 |
+
Yanpei Liu, Xinyun Chen, Chang Liu, and Dawn Song. Delving into transferable adversarial examples and black-box attacks. arXiv preprint arXiv:1611.02770, 2016.
|
| 283 |
+
|
| 284 |
+
Zihao Liu, Qi Liu, Tao Liu, Nuo Xu, Xue Lin, Yanzhi Wang, and Wujie Wen. Feature distillation: Dnn-oriented jpeg compression against adversarial examples. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 860–868, 2019.
|
| 285 |
+
|
| 286 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations, 2018.
|
| 287 |
+
|
| 288 |
+
Yurii Nesterov. A method for unconstrained convex minimization problem with the rate of convergence o $( 1 / \mathrm { k } ^ { \cdot } 2 )$ . In Doklady AN USSR, volume 269, pp. 543–547, 1983.
|
| 289 |
+
|
| 290 |
+
Boris T Polyak. Some methods of speeding up the convergence of iteration methods. USSR Computational Mathematics and Mathematical Physics, 4(5):1–17, 1964.
|
| 291 |
+
|
| 292 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211–252, 2015.
|
| 293 |
+
|
| 294 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 295 |
+
|
| 296 |
+
Chuanbiao Song, Kun He, Liwei Wang, and John E. Hopcroft. Improving the generalization of adversarial training with domain adaptation. In International Conference on Learning Representations, 2019.
|
| 297 |
+
|
| 298 |
+
Chuanbiao Song, Kun He, Jiadong Lin, Liwei Wang, and John E. Hopcroft. Robust local features for improving the generalization of adversarial training. In International Conference on Learning Representations, 2020.
|
| 299 |
+
|
| 300 |
+
Ilya Sutskever, James Martens, George Dahl, and Geoffrey Hinton. On the importance of initialization and momentum in deep learning. In International conference on machine learning, pp. 1139–1147, 2013.
|
| 301 |
+
|
| 302 |
+
Christian Szegedy, Google Inc, Wojciech Zaremba, Ilya Sutskever, Google Inc, Joan Bruna, Dumitru Erhan, Google Inc, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations, Workshop Track, 2014.
|
| 303 |
+
|
| 304 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2818–2826, 2016.
|
| 305 |
+
|
| 306 |
+
Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander A Alemi. Inception-v4, inception-resnet and the impact of residual connections on learning. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
|
| 307 |
+
|
| 308 |
+
Florian Tramr, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. Ensemble adversarial training: Attacks and defenses. In International Conference on Learning Representations, 2018.
|
| 309 |
+
|
| 310 |
+
Xiaosen Wang, Kun He, and John E. Hopcroft. AT-GAN: A generative attack model for adversarial transferring on generative adversarial nets. CoRR, abs/1904.07793, 2019.
|
| 311 |
+
|
| 312 |
+
Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, and Alan Yuille. Mitigating adversarial effects through randomization. In International Conference on Learning Representations, 2018.
|
| 313 |
+
|
| 314 |
+
Cihang Xie, Zhishuai Zhang, Yuyin Zhou, Song Bai, Jianyu Wang, Zhou Ren, and Alan L Yuille. Improving transferability of adversarial examples with input diversity. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2730–2739, 2019.
|
| 315 |
+
|
| 316 |
+
Runtian Zhai, Tianle Cai, Di He, Chen Dan, Kun He, John E. Hopcroft, and Liwei Wang. Adversarially robust generalization just requires more unlabeled data. CoRR, abs/1906.00555, 2019.
|
| 317 |
+
|
| 318 |
+
# A DETAILS OF THE ALGORITHMS
|
| 319 |
+
|
| 320 |
+
The algorithm of SI-NI-TI-DIM attack is summarized in Algorithm 2. We can get the SI-NI-DIM attack algorithm by removing Step 10 of Algorithm 2, and get the SI-NI-TIM attack algorithm by removing $T ( \cdot ; p )$ in Step 7 of Algorithm 2.
|
| 321 |
+
|
| 322 |
+
# Algorithm 2 SI-NI-TI-DIM
|
| 323 |
+
|
| 324 |
+
Input: A clean example $x$ with ground-truth label $y ^ { t r u e }$ ; a classifier $f$ with loss function $J$ ; Input: Perturbation size $\epsilon$ ; maximum iterations $T$ ; number of scale copies $m$ and decay factor $\mu$ . Output: An adversarial example $x ^ { a d v }$
|
| 325 |
+
|
| 326 |
+
1: $\alpha = \epsilon / T$
|
| 327 |
+
2 : g0 = 0; xadv0 = x
|
| 328 |
+
3: for $t = 0$ to $T - 1$ do
|
| 329 |
+
4: $g = 0$
|
| 330 |
+
5: Get $\boldsymbol { x } _ { t } ^ { n e s }$ by Eq.(6) $\triangleright$ make a jump in the direction of previous accumulated gradients
|
| 331 |
+
6: for $i = 0$ to $m - 1$ do $\triangleright$ sum the gradients over the scale copies of the input image
|
| 332 |
+
7: Get the gradients by $\nabla _ { \boldsymbol { x } } J ( T ( S _ { i } ( x _ { t } ^ { n e s } ) ; p ) , y ^ { t r u e } ) \ \circ$ apply random resizing and padding
|
| 333 |
+
to the inputs with the probability $p$
|
| 334 |
+
8: Sum the gradients as $g = \bar { g } + \nabla _ { x } J ( T ( S _ { i } ( x _ { t } ^ { n e s } ) ; p ) , y ^ { t r u e } )$
|
| 335 |
+
9: Get average gradients as $\begin{array} { r } { g = \frac { 1 } { m } \cdot g } \end{array}$
|
| 336 |
+
10: Convolve the gradients by $g = W * g \ \triangleright$ convolve gradient with the pre-defined kernel W
|
| 337 |
+
11: Update gt+1 by gt+1 = µ · gt + gkgk
|
| 338 |
+
12: Update $x _ { t + 1 } ^ { a d v }$ by Eq.(8)
|
| 339 |
+
|
| 340 |
+
13: return $x ^ { a d v } = x _ { T } ^ { a d v }$
|
| 341 |
+
|
| 342 |
+
# B VISUALIZATION OF ADVERSARIAL EXAMPLES
|
| 343 |
+
|
| 344 |
+
We visualize 12 randomly selected benign images and their corresponding adversarial images in Figure 3. The adversarial images are crafted on the ensemble models, including Inc-v3, Inc-v4, IncRes-v2 and Res-101, using the proposed SI-NI-TI-DIM. We see that these generated adversarial perturbations are human imperceptible.
|
| 345 |
+
|
| 346 |
+

|
| 347 |
+
Figure 3: Visualization of randomly picked benign images and their corresponding adversarial images, crafted on the ensemble models using SI-NI-TI-DIM.
|
md/train/Sk2u1g-0-/Sk2u1g-0-.md
ADDED
|
@@ -0,0 +1,554 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CONTINUOUS ADAPTATION VIA META-LEARNING IN NONSTATIONARY AND COMPETITIVE ENVIRONMENTS
|
| 2 |
+
|
| 3 |
+
Maruan Al-Shedivat∗ CMU
|
| 4 |
+
|
| 5 |
+
Trapit Bansal UMass Amherst
|
| 6 |
+
|
| 7 |
+
Yura Burda OpenAI
|
| 8 |
+
|
| 9 |
+
Ilya Sutskever OpenAI
|
| 10 |
+
|
| 11 |
+
Igor Mordatch OpenAI
|
| 12 |
+
|
| 13 |
+
Pieter Abbeel UC Berkeley
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
The ability to continuously learn and adapt from limited experience in nonstationary environments is an important milestone on the path towards general intelligence. In this paper, we cast the problem of continuous adaptation into the learning-to-learn framework. We develop a simple gradient-based meta-learning algorithm suitable for adaptation in dynamically changing and adversarial scenarios. Additionally, we design a new multi-agent competitive environment, RoboSumo, and define iterated adaptation games for testing various aspects of continuous adaptation. We demonstrate that meta-learning enables significantly more efficient adaptation than reactive baselines in the few-shot regime. Our experiments with a population of agents that learn and compete suggest that meta-learners are the fittest.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Recent progress in reinforcement learning (RL) has achieved very impressive results ranging from playing games (Mnih et al., 2015; Silver et al., 2016), to applications in dialogue systems (Li et al., 2016), to robotics (Levine et al., 2016). Despite the progress, the learning algorithms for solving many of these tasks are designed to deal with stationary environments. On the other hand, real-world is often nonstationary either due to complexity (Sutton et al., 2007), changes in the dynamics or the objectives in the environment over the life-time of a system (Thrun, 1998), or presence of multiple learning actors (Lowe et al., 2017; Foerster et al., 2017a). Nonstationarity breaks the standard assumptions and requires agents to continuously adapt, both at training and execution time, in order to succeed.
|
| 22 |
+
|
| 23 |
+
Learning under nonstationary conditions is challenging. The classical approaches to dealing with nonstationarity are usually based on context detection (Da Silva et al., 2006) and tracking (Sutton et al., 2007), i.e., reacting to the already happened changes in the environment by continuously fine-tuning the policy. Unfortunately, modern deep RL algorithms, while able to achieve super-human performance on certain tasks, are known to be sample inefficient. Nevertheless, nonstationarity allows only for limited interaction before the properties of the environment change. Thus, it immediately puts learning into the few-shot regime and often renders simple fine-tuning methods impractical.
|
| 24 |
+
|
| 25 |
+
A nonstationary environment can be seen as a sequence of stationary tasks, and hence we propose to tackle it as a multi-task learning problem (Caruana, 1998). The learning-to-learn (or meta-learning) approaches (Schmidhuber, 1987; Thrun & Pratt, 1998) are particularly appealing in the few-shot regime, as they produce flexible learning rules that can generalize from only a handful of examples. Meta-learning has shown promising results in the supervised domain and have gained a lot of attention from the research community recently (e.g., Santoro et al., 2016; Ravi & Larochelle, 2016). In this paper, we develop a gradient-based meta-learning algorithm similar to (Finn et al., 2017b) and suitable for continuous adaptation of RL agents in nonstationary environments. More concretely, our agents meta-learn to anticipate the changes in the environment and update their policies accordingly.
|
| 26 |
+
|
| 27 |
+
While virtually any changes in an environment could induce nonstationarity (e.g., changes in the physics or characteristics of the agent), environments with multiple agents are particularly challenging due to complexity of the emergent behavior and are of practical interest with applications ranging from multiplayer games (Peng et al., 2017) to coordinating self-driving fleets Cao et al. (2013). Multi-agent environments are nonstationary from the perspective of any individual agent since all actors are learning and changing concurrently (Lowe et al., 2017). In this paper, we consider the problem of continuous adaptation to a learning opponent in a competitive multi-agent setting.
|
| 28 |
+
|
| 29 |
+
To this end, we design RoboSumo—a 3D environment with simulated physics that allows pairs of agents to compete against each other. To test continuous adaptation, we introduce iterated adaptation games—a new setting where a trained agent competes against the same opponent for multiple rounds of a repeated game, while both are allowed to update their policies and change their behaviors between the rounds. In such iterated games, from the agent’s perspective, the environment changes from round to round, and the agent ought to adapt in order to win the game. Additionally, the competitive component of the environment makes it not only nonstationary but also adversarial, which provides a natural training curriculum and encourages learning robust strategies (Bansal et al., 2018).
|
| 30 |
+
|
| 31 |
+
We evaluate our meta-learning agents along with a number of baselines on a (single-agent) locomotion task with handcrafted nonstationarity and on iterated adaptation games in RoboSumo. Our results demonstrate that meta-learned strategies clearly dominate other adaptation methods in the few-shot regime in both single- and multi-agent settings. Finally, we carry out a large-scale experiment where we train a diverse population of agents with different morphologies, policy architectures, and adaptation methods, and make them interact by competing against each other in iterated games. We evaluate the agents based on their TrueSkills (Herbrich et al., 2007) in these games, as well as evolve the population as whole for a few generations—the agents that lose disappear, while the winners get duplicated. Our results suggest that the agents with meta-learned adaptation strategies end up being the fittest. Videos that demonstrate adaptation behaviors are available at https://goo.gl/tboqaN.
|
| 32 |
+
|
| 33 |
+
# 2 RELATED WORK
|
| 34 |
+
|
| 35 |
+
The problem of continuous adaptation considered in this work is a variant of continual learning (Ring, 1994; 1997) and is related to lifelong (Thrun & Pratt, 1998; Silver et al., 2013) and neverending (Mitchell et al., 2015) learning. Life-long learning systems aim at solving multiple tasks sequentially by efficiently transferring and utilizing knowledge from already learned tasks to new tasks while minimizing the effect of catastrophic forgetting (McCloskey & Cohen, 1989). Neverending learning is concerned with mastering a fixed set of tasks in iterations, where the set keeps growing and the performance on all the tasks in the set keeps improving from iteration to iteration.
|
| 36 |
+
|
| 37 |
+
The scope of continuous adaptation is narrower and more precise. While life-long and never-ending learning settings are defined as general multi-task problems (Silver et al., 2013; Mitchell et al., 2015), continuous adaptation targets to solve a single but nonstationary task or environment. The nonstationarity in the former two problems exists and is dictated by the selected sequence of tasks. In the latter case, we assume that nonstationarity is caused by some underlying dynamics in the properties of a given task in the first place (e.g., changes in the behavior of other agents in a multiagent setting). Finally, in the life-long and never-ending scenarios the boundary between training and execution is blurred as such systems constantly operate in the training regime. Continuous adaptation, on the other hand, expects a (potentially trained) agent to adapt to the changes in the environment at execution time under the pressure of limited data or interaction experience between the changes1.
|
| 38 |
+
|
| 39 |
+
Nonstationarity of multi-agent environments is a well known issue that has been extensively studied in the context of learning in simple multi-player iterated games (such as rock-paper-scissors) where each episode is one-shot interaction (Singh et al., 2000; Bowling, 2005; Conitzer & Sandholm, 2007). In such games, discovering and converging to a Nash equilibrium strategy is a success for the learning agents. Modeling and exploiting opponents (Zhang & Lesser, 2010; Mealing & Shapiro, 2013) or even their learning processes (Foerster et al., 2017b) is advantageous as it improves convergence or helps to discover equilibria of certain properties (e.g., leads to cooperative behavior). In contrast, each episode in RoboSumo consists of multiple steps, happens in continuous time, and requires learning a good intra-episodic controller. Finding Nash equilibria in such a setting is hard. Thus, fast adaptation becomes one of the few viable strategies against changing opponents.
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Fig. 1: (a) A probabilistic model for MAML in a multi-task RL setting. The task, $T$ , the policies, $\pi$ , and the trajectories, $\tau$ , are all random variables with dependencies encoded in the edges of the given graph. (b) Our extended model suitable for continuous adaptation to a task changing dynamically due to non-stationarity of the environment. Policy and trajectories at a previous step are used to construct a new policy for the current step. (c) Computation graph for the meta-update from $\phi _ { i }$ to $\phi _ { i + 1 }$ . Boxes represent replicas of the policy graphs with the specified parameters. The model is optimized via truncated backpropagation through time starting from $\mathcal { L } _ { T _ { i + 1 } }$ .
|
| 43 |
+
|
| 44 |
+
Our proposed method for continuous adaptation follows the general meta-learning paradigm (Schmidhuber, 1987; Thrun & Pratt, 1998), i.e., it learns a high-level procedure that can be used to generate a good policy each time the environment changes. There is a wealth of work on meta-learning, including methods for learning update rules for neural models that were explored in the past (Bengio et al., 1990; 1992; Schmidhuber, 1992), and more recent approaches that focused on learning optimizers for deep networks (Hochreiter et al., 2001; Andrychowicz et al., 2016; Li & Malik, 2016; Ravi & Larochelle, 2016), generating model parameters (Ha et al., 2016; Edwards & Storkey, 2016; Al-Shedivat et al., 2017), learning task embeddings (Vinyals et al., 2016; Snell et al., 2017) including memory-based approaches (Santoro et al., 2016), learning to learn implicitly via RL (Wang et al., 2016; Duan et al., 2016), or simply learning a good initialization (Finn et al., 2017b).
|
| 45 |
+
|
| 46 |
+
# 3 METHOD
|
| 47 |
+
|
| 48 |
+
The problem of continuous adaptation in nonstationary environments immediately puts learning into the few-shot regime: the agent must learn from only limited amount of experience that it can collect before its environment changes. Therefore, we build our method upon the previous work on gradient-based model-agnostic meta-learning (MAML) that has been shown successful in the fewshot settings (Finn et al., 2017b). In this section, we re-derive MAML for multi-task reinforcement learning from a probabilistic perspective (cf. Grant et al., 2018), and then extend it to dynamically changing tasks.
|
| 49 |
+
|
| 50 |
+
3.1 A PROBABILISTIC VIEW OF MODEL-AGNOSTIC META-LEARNING (MAML)
|
| 51 |
+
|
| 52 |
+
Assume that we are given a distribution over tasks, $\mathcal { D } ( T )$ , where each task, $T$ , is a tuple:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
T : = \left( L _ { T } , P _ { T } \left( \mathbf { x } \right) , P _ { T } \left( \mathbf { x } _ { t + 1 } \mid \mathbf { x } _ { t } , \mathbf { a } _ { t } \right) , H \right)
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
$L _ { T }$ is a task-specific loss function that maps a trajectory, $\pmb { \tau } : = ( \mathbf { x } _ { 0 } , \mathbf { a } _ { 1 } , \mathbf { x } _ { 1 } , R _ { 1 } , \dots , \mathbf { a } _ { H } , \mathbf { x } _ { H } , R _ { H } ) \in$ $\tau$ , to a loss value, i.e., $L _ { T } : \mathcal { T } \mapsto \mathbb { R }$ ; $P _ { T } \left( \mathbf { x } \right)$ and $P _ { T } \left( \mathbf { x } _ { t + 1 } \mid \mathbf { x } _ { t } , \mathbf { a } _ { t } \right)$ define the Markovian dynamics of the environment in task $T$ ; $H$ denotes the horizon; observations, $\mathbf { x } _ { t }$ , and actions, $\mathbf { a } _ { t }$ , are elements (typically,trajectory, ectors) of the observation space, , is the negative cumulative rewar $\mathcal { X }$ $\mathcal { A }$ , respectively. The loss of a. $\tau$ $\begin{array} { r } { L _ { T } ( \tau ) : = - \dot { \sum } _ { t = 1 } ^ { H } R _ { t } } \end{array}$
|
| 59 |
+
|
| 60 |
+
The goal of meta-learning is to find a procedure which, given access to a limited experience on a task sampled from $\mathcal { D } ( T )$ , can produce a good policy for solving it. More formally, after querying $K$ trajectories from a task $T \sim \mathcal { D } ( T )$ under policy $\pi _ { \theta }$ , denoted $\overline { { \tau } } _ { \theta } ^ { 1 : K }$ , we would like to construct a new, task-specific policy, $\pi _ { \phi }$ , that would minimize the expected subsequent loss on the task $T$ . In particular, MAML constructs parameters of the task-specific policy, $\phi$ , using gradient of $L _ { T }$ w.r.t. $\theta$ :
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\phi : = \theta - \alpha \nabla _ { \theta } L _ { T } \left( \tau _ { \theta } ^ { 1 : K } \right) , \mathrm { w h e r e ~ } L _ { T } \left( \tau _ { \theta } ^ { 1 : K } \right) : = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } L _ { T } ( \tau _ { \theta } ^ { k } ) , \mathrm { a n d ~ } \tau _ { \theta } ^ { k } \sim P _ { T } ( \tau \mid \theta )
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
# Algorithm 1 Meta-learning at training time.
|
| 67 |
+
|
| 68 |
+
# Algorithm 2 Adaptation at execution time.
|
| 69 |
+
|
| 70 |
+
input Distribution over pairs of tasks, $\mathcal { P } ( T _ { i } , T _ { i + 1 } )$ , learning rate, $\beta$ .
|
| 71 |
+
1: Randomly initialize $\theta$ and $\alpha$ .
|
| 72 |
+
2: repeat
|
| 73 |
+
3: Sample a batch of task pairs, $\{ ( T _ { i } , T _ { i + 1 } ) \} _ { i = 1 } ^ { n }$ . 4: for all task pairs $( T _ { i } , T _ { i + 1 } )$ in the batch do 5: Sample traj. $\tau _ { \theta } ^ { 1 : K }$ from $T _ { i }$ using $\pi \theta$ .
|
| 74 |
+
6: Compute $\bar { \phi } = \overset { \cdot } { \phi } ( \tau _ { \theta } ^ { 1 : K } , \theta , \alpha )$ as given in (7). 7: Sample traj. $\tau _ { \phi }$ from $T _ { i + 1 }$ using $\pi _ { \phi }$ .
|
| 75 |
+
8: end for
|
| 76 |
+
9: Compute $\nabla _ { \theta } \mathcal { L } _ { T _ { i } , T _ { i + 1 } }$ and $\nabla _ { \alpha } \mathcal { L } _ { T _ { i } , T _ { i + 1 } }$ using τ 1:K a nd $\tau _ { \phi }$ as given in (8).
|
| 77 |
+
10: Update $\theta \gets \theta + \beta \nabla _ { \theta } \mathcal { L } _ { T } ( \theta , \alpha )$ .
|
| 78 |
+
11: Update $\alpha \gets \alpha + \beta \nabla _ { \alpha } \mathcal { L } _ { T } ( \theta , \alpha )$ .
|
| 79 |
+
|
| 80 |
+
input A stream of tasks, $T _ { 1 } , T _ { 2 } , T _ { 3 } , \ldots$
|
| 81 |
+
|
| 82 |
+
1: Initialize $\phi = \theta$ .
|
| 83 |
+
2: while there are new incoming tasks do
|
| 84 |
+
3: Get a new task, $T _ { i }$ , from the stream.
|
| 85 |
+
4: Solve $T _ { i }$ using $\pi _ { \phi }$ policy.
|
| 86 |
+
5: While solving Ti, collect trajectories, τ 1:Ki,φ .
|
| 87 |
+
6: Update $\phi \gets \phi ( \tau _ { i , \phi } ^ { 1 : K } , \theta ^ { * } , \alpha ^ { * } )$ using
|
| 88 |
+
importance-corrected meta-update as in (9).
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
12: until Convergence output Optimal $\theta ^ { * }$ and $\alpha ^ { * }$ .
|
| 92 |
+
7: end while
|
| 93 |
+
|
| 94 |
+
We call (2) the adaptation update with a step $\alpha$ . The adaptation update is parametrized by $\theta$ , which we optimize by minimizing the expected loss over the distribution of tasks, $\mathcal { D } ( T )$ —the meta-loss:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\operatorname* { m i n } _ { \theta } \mathbb { E } _ { T \sim \mathcal { D } ( T ) } \left[ \mathcal { L } _ { T } ( \theta ) \right] , \mathrm { w h e r e ~ } \mathcal { L } _ { T } ( \theta ) : = \mathbb { E } _ { \tau _ { \theta } ^ { 1 : K } \sim P _ { T } ( \tau | \theta ) } \left[ \mathbb { E } _ { \tau _ { \phi } \sim P _ { T } ( \tau | \phi ) } \left[ L _ { T } ( \tau _ { \phi } ) ~ \middle \vert ~ \tau _ { \theta } ^ { 1 : K } , \theta \right] \right]
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $\tau _ { \theta }$ and $\tau _ { \phi }$ are trajectories obtained under $\pi _ { \theta }$ and $\pi _ { \phi }$ , respectively.
|
| 101 |
+
|
| 102 |
+
In general, we can think of the task, trajectories, and policies, as random variables (Fig. 1a), where $\phi$ is generated from some conditional distribution $P _ { T } \left( \phi \mid \theta , \tau _ { 1 : k } \right)$ . The meta-update (2) is equivalent to assuming the delta distribution, $\begin{array} { r } { P _ { T } \left( \phi \mid \theta , \pmb { \tau } _ { 1 : k } \right) : = \delta \left( \theta - \alpha \nabla _ { \theta } \frac { 1 } { K } \sum _ { k = 1 } ^ { K } L _ { T } ( \pmb { \tau } _ { k } ) \right) ^ { 2 } } \end{array}$ . To optimize (3), we can use the policy gradient method (Williams, 1992), where the gradient of $\acute { \mathcal { L } } _ { T }$ is as follows:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\nabla _ { \theta } \mathcal { L } _ { T } ( \theta ) = \mathbb { E } _ { \tau _ { \theta } ^ { 1 : K } \sim P _ { T } ( \tau | \theta ) } \left[ L _ { T } ( \tau _ { \phi } ) \left[ \nabla _ { \theta } \log \pi _ { \phi } ( \tau _ { \phi } ) + \nabla _ { \theta } \sum _ { k = 1 } ^ { K } \log \pi _ { \theta } ( \tau _ { \theta } ^ { k } ) \right] \right]
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
The expected loss on a task, $\mathcal { L } _ { T }$ , can be optimized with trust-region policy (TRPO) (Schulman et al., 2015a) or proximal policy (PPO) (Schulman et al., 2017) optimization methods. For details and derivations please refer to Appendix A.
|
| 109 |
+
|
| 110 |
+
# 3.2 CONTINUOUS ADAPTATION VIA META-LEARNING
|
| 111 |
+
|
| 112 |
+
In the classical multi-task setting, we make no assumptions about the distribution of tasks, $\mathcal { D } ( T )$ . When the environment is nonstationary, we can see it as a sequence of stationary tasks on a certain timescale where the tasks correspond to different dynamics of the environment. Then, $\mathcal { D } ( T )$ is defined by the environment changes, and the tasks become sequentially dependent. Hence, we would like to exploit this dependence between consecutive tasks and meta-learn a rule that keeps updating the policy in a way that minimizes the total expected loss encountered during the interaction with the changing environment. For instance, in the multi-agent setting, when playing against an opponent that changes its strategy incrementally (e.g., due to learning), our agent should ideally meta-learn to anticipate the changes and update its policy accordingly.
|
| 113 |
+
|
| 114 |
+
In the probabilistic language, our nonstationary environment is equivalent to a distribution of tasks represented by a Markov chain (Fig. 1b). The goal is to minimize the expected loss over the chain of tasks of some length $L$ :
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\operatorname* { m i n } _ { \theta } \mathbb { E } _ { \mathcal { P } ( T _ { 0 } ) , \mathcal { P } ( T _ { i + 1 } | T _ { i } ) } \left[ \sum _ { i = 1 } ^ { L } \mathcal { L } _ { T _ { i } , T _ { i + 1 } } ( \theta ) \right]
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
Here, $\mathcal { P } ( T _ { 0 } )$ and $\mathcal { P } ( T _ { i + 1 } \mid T _ { i } )$ denote the initial and the transition probabilities in the Markov chain of tasks. Note that (i) we deal with Markovian dynamics on two levels of hierarchy, where the upper level is the dynamics of the tasks and the lower level is the MDPs that represent particular tasks, and (ii) the objectives, $\mathcal { L } _ { T _ { i } , T _ { i + 1 } }$ , will depend on the way the meta-learning process is defined. Since we are interested in adaptation updates that are optimal with respect to the Markovian transitions between the tasks, we define the meta-loss on a pair of consecutive tasks as follows:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\begin{array} { r } { \mathcal { L } _ { T _ { i } , T _ { i + 1 } } \big ( \theta \big ) : = \mathbb { E } _ { \tau _ { i , \theta } ^ { 1 ; K } \sim P _ { T _ { i } } ( \tau | \theta ) } \left[ \mathbb { E } _ { \tau _ { i + 1 , \phi } \sim P _ { T _ { i + 1 } } ( \tau | \phi ) } \left[ L _ { T _ { i + 1 } } \big ( \tau _ { i + 1 , \phi } \big ) \mid \tau _ { i , \theta } ^ { 1 ; K } , \theta \right] \right] } \end{array}
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
The principal difference between the loss in (3) and (6) is that trajectories $\tau _ { i , \theta } ^ { 1 : K }$ come from the current task, $T _ { i }$ , and are used to construct a policy, $\pi _ { \phi }$ , that is good for the upcoming task, $T _ { i + 1 }$ Note that even though the policy parameters, $\phi _ { i }$ , are sequentially dependent (Fig. 1b), in (6) we always start from the initial parameters, $\theta ^ { 3 }$ . Hence, optimizing $\mathcal { L } _ { T _ { i } , T _ { i + 1 } } ( \theta )$ is equivalent to truncated backpropagation through time with a unit lag in the chain of tasks.
|
| 127 |
+
|
| 128 |
+
To construct parameters of the policy for task $T _ { i + 1 }$ , we start from $\theta$ and do multiple4 meta-gradient steps with adaptive step sizes as follows (assuming the number of steps is $M$ ):
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\begin{array} { r l } & { \phi _ { i } ^ { 0 } : = \theta , \quad \tau _ { \theta } ^ { 1 : K } \sim P _ { T _ { i } } ( \tau \mid \theta ) , } \\ & { \phi _ { i } ^ { m } : = \phi _ { i } ^ { m - 1 } - \alpha _ { m } \nabla _ { \phi _ { i } ^ { m - 1 } } L _ { T _ { i } } \left( \tau _ { i , \phi _ { i } ^ { m - 1 } } ^ { 1 : K } \right) , \quad m = 1 , \hdots , M - 1 , } \\ & { \phi _ { i + 1 } : = \phi _ { i } ^ { M - 1 } - \alpha _ { M } \nabla _ { \phi _ { i } ^ { M - 1 } } L _ { T _ { i } } \left( \tau _ { i , \phi _ { i } ^ { M - 1 } } ^ { 1 : K } \right) } \end{array}
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
where {αm}Mm=1 is a set of meta-gradient step sizes that are optimized jointly with $\theta$ . The computation graph for the meta-update is given in Fig. 1c. The expression for the policy gradient is the same as in (4) but with the expectation is now taken w.r.t. to both $T _ { i }$ and $T _ { i + 1 }$ :
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\begin{array} { l } { { \nabla _ { \theta , \alpha } \mathcal { L } _ { T _ { i } , T _ { i + 1 } } ( \theta , \alpha ) = } } \\ { { \mathbb { E } _ { \tau _ { i + 1 , \phi } \sim P _ { T _ { i } } ( \tau | \theta ) } \left[ L _ { T _ { i + 1 } } ( \tau _ { i + 1 , \phi } ) \left[ \nabla _ { \theta , \alpha } \log \pi _ { \phi } ( \tau _ { i + 1 , \phi } ) + \nabla _ { \theta } { \sum _ { k = 1 } ^ { K } } \log \pi _ { \theta } ( \tau _ { i , \theta } ^ { k } ) \right] \right] } } \\ { { \tau _ { i + 1 , \phi } { \sim } P _ { T _ { i + 1 } } ( \tau | \phi ) \left[ \begin{array} { l } { { \displaystyle } } \end{array} \right] } } \end{array}
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
More details and the analog of the policy gradient theorem for our setting are given in Appendix A.
|
| 141 |
+
|
| 142 |
+
Note that computing adaptation updates requires interacting with the environment under $\pi _ { \theta }$ while computing the meta-loss, $\mathcal { L } _ { T _ { i } , T _ { i + 1 } }$ , requires using $\pi _ { \phi }$ , and hence, interacting with each task in the sequence twice. This is often impossible at execution time, and hence we use slightly different algorithms at training and execution times.
|
| 143 |
+
|
| 144 |
+
Meta-learning at training time. Once we have access to a distribution over pairs of consecutive tasks5, $\mathcal { P } ( T _ { i - 1 } , T _ { i } )$ , we can meta-learn the adaptation updates by optimizing $\theta$ and $\alpha$ jointly with a gradient method, as given in Algorithm 1. We use $\pi _ { \theta }$ to collect trajectories from $T _ { i }$ and $\pi _ { \phi }$ when interacting with $T _ { i + 1 }$ . Intuitively, the algorithm is searching for $\theta$ and $\alpha$ such that the adaptation update (7) computed on the trajectories from $T _ { i }$ brings us to a policy, $\pi _ { \phi }$ , that is good for solving $T _ { i + 1 }$ . The main assumption here is that the trajectories from $T _ { i }$ contain some information about $T _ { i + 1 }$ Note that we treat adaptation steps as part of the computation graph (Fig. 1c) and optimize $\theta$ and $\alpha$ via backpropagation through the entire graph, which requires computing second order derivatives.
|
| 145 |
+
|
| 146 |
+
Adaptation at execution time. Note that to compute unbiased adaptation gradients at training time, we have to collect experience in $T _ { i }$ using $\pi _ { \theta }$ . At test time, due to environment nonstationarity, we usually do not have the luxury to access to the same task multiple times. Thus, we keep acting according to $\pi _ { \phi }$ and re-use past experience to compute updates of $\phi$ for each new incoming task (see Algorithm 2). To adjust for the fact that the past experience was collected under a policy different from $\pi _ { \theta }$ , we use importance weight correction. In case of single step meta-update, we have:
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
\phi _ { i } : = \theta - \alpha \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \left( \frac { \pi _ { \theta } ( \tau ^ { k } ) } { \pi _ { \phi _ { i - 1 } } ( \tau ^ { k } ) } \right) \nabla _ { \theta } L _ { T _ { i - 1 } } ( \tau ^ { k } ) , \quad \tau ^ { 1 : K } \sim P _ { T _ { i - 1 } } ( \tau \mid \phi _ { i - 1 } ) ,
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
3This is due to stability considerations. We find empirically that optimization over sequential updates from $\phi _ { i }$ to $\phi _ { i + 1 }$ is unstable, often tends to diverge, while starting from the same initialization leads to better behavior.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Fig. 2: (a) The three types of agents used in experiments. The robots differ in the anatomy: the number of legs, their positions, and constraints on the thigh and knee joints. (b) The nonstationary locomotion environment. The torques applied to red-colored legs are scaled by a dynamically changing factor. (c) RoboSumo environment.
|
| 156 |
+
|
| 157 |
+
where $\pi _ { \phi _ { i - 1 } }$ and $\pi _ { \phi _ { i } }$ are used to rollout from $T _ { i - 1 }$ and $T _ { i }$ , respectively. Extending importance weight correction to multi-step updates is straightforward and requires simply adding importance weights to each of the intermediate steps in (7).
|
| 158 |
+
|
| 159 |
+
# 4 ENVIRONMENTS
|
| 160 |
+
|
| 161 |
+
We have designed a set of environments for testing different aspects of continuous adaptation methods in two scenarios: (i) simple environments that change from episode to episode according to some underlying dynamics, and (ii) a competitive multi-agent environment, RoboSumo, that allows different agents to play sequences of games against each other and keep adapting to incremental changes in each other’s policies. All our environments are based on MuJoCo physics simulator (Todorov et al., 2012), and all agents are simple multi-leg robots, as shown in Fig. 2a.
|
| 162 |
+
|
| 163 |
+
# 4.1 DYNAMIC
|
| 164 |
+
|
| 165 |
+
First, we consider the problem of robotic locomotion in a changing environment. We use a six-leg agent (Fig. 2b) that observes the absolute position and velocity of its body, the angles and velocities of its legs, and it acts by applying torques to its joints. The agent is rewarded proportionally to its moving speed in a fixed direction. To induce nonstationarity, we select a pair of legs of the agent and scale down the torques applied to the corresponding joints by a factor that linearly changes from 1 to 0 over the course of 7 episodes. In other words, during the first episode all legs are fully functional, while during the last episode the agent has two legs fully paralyzed (even though the policy can generate torques, they are multiplied by 0 before being passed to the environment). The goal of the agent is to learn to adapt from episode to episode by changing its gait so that it is able to move with a maximal speed in a given direction despite the changes in the environment (cf. Cully et al., 2015). Also, there are 15 ways to select a pair of legs of a six-leg creature which gives us 15 different nonstationary environments. This allows us to use a subset of these environments for training and a separate held out set for testing. The training and testing procedures are described in the next section.
|
| 166 |
+
|
| 167 |
+
# 4.2 COMPETITIVE
|
| 168 |
+
|
| 169 |
+
Our multi-agent environment, RoboSumo, allows agents to compete in the 1-vs-1 regime following the standard sumo rules6. We introduce three types of agents, Ant, Bug, and Spider, with different anatomies (Fig. 2a). During the game, each agent observes positions of itself and the opponent, its own joint angles, the corresponding velocities, and the forces exerted on its own body (i.e., equivalent of tactile senses). The action spaces are continuous.
|
| 170 |
+
|
| 171 |
+
Iterated adaptation games. To test adaptation, we define the iterated adaptation game (Fig. 3)—a game between a pair of agents that consists of $K$ rounds each of which consists of one or more fixed length episodes (500 time steps each). The outcome of each round is either win, loss, or draw. The agent that wins the majority of rounds (with at least $5 \%$ margin) is declared the winner of the game. There are two distinguishing aspects of our setup: First, the agents are trained either via pure self-play or versus opponents from a fixed training collection. At test time, they face a new opponent from a testing collection. Second, the agents are allowed to learn (or adapt) at test time. In particular, an agent should exploit the fact that it plays against the same opponent multiple consecutive rounds and try to adjust its behavior accordingly. Since the opponent may also be adapting, the setup allows to test different continuous adaptation strategies, one versus the other.
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Fig. 3: An agent competes with an opponent in an iterated adaptation games that consist of multi-episode rounds. The agent wins a round if it wins the majority of episodes (wins and losses illustrated with color). Both the agent and its opponent may update their policies from round to round (denoted by the version number).
|
| 175 |
+
|
| 176 |
+
Reward shaping. In RoboSumo, rewards are naturally sparse: the winner gets $+ 2 0 0 0$ , the loser is penalized for -2000, and in case of a draw both opponents receive -1000 points. To encourage fast learning at the early stages of training, we shape the rewards given to agents in the following way: the agent (i) gets reward for staying closer to the center of the ring, for moving towards the opponent, and for exerting forces on the opponent’s body, and (ii) gets penalty inversely proportional to the opponent’s distance to the center of the ring. At test time, the agents continue having access to the shaped reward as well and may use it to update their policies. Throughout our experiments, we use discounted rewards with the discount factor, $\gamma = 0 . 9 9 5$ . More details are in Appendix D.2.
|
| 177 |
+
|
| 178 |
+
Calibration. To study adaptation, we need a well-calibrated environment in which none of the agents has an initial advantage. To ensure the balance, we increased the mass of the weaker agents (Ant and Spider) such that the win rates in games between one agent type versus the other type in the non-adaptation regime became almost equal (for details on calibration see Appendix D.3).
|
| 179 |
+
|
| 180 |
+
# 5 EXPERIMENTS
|
| 181 |
+
|
| 182 |
+
Our goal is to test different adaptation strategies in the proposed nonstationary RL settings. However, it is known that the test-time behavior of an agent may highly depend on a variety of factors besides the chosen adaptation method, including training curriculum, training algorithm, policy class, etc. Hence, we first describe the precise setup that we use in our experiments to eliminate irrelevant factors and focus on the effects of adaptation. Most of the low-level details are deferred to appendices. Video highlights of our experiments are available at https://goo.gl/tboqaN.
|
| 183 |
+
|
| 184 |
+
# 5.1 THE SETUP
|
| 185 |
+
|
| 186 |
+
Policies. We consider 3 types of policy networks: (i) a 2-layer MLP, (ii) embedding (i.e., 1 fully-connected layer replicated across the time dimension) followed by a 1-layer LSTM, and (iii) $\mathrm { \ k L ^ { 2 } }$ (Duan et al., 2016) of the same architecture as (ii) which additionally takes previous reward and done signals as inputs at each step, keeps the recurrent state throughout the entire interaction with a given environment (or an opponent), and resets the state once the latter changes. For advantage functions, we use networks of the same structure as for the corresponding policies and have no parameter sharing between the two. Our meta-learning agents use the same policy and advantage function structures as the baselines and learn a 3-step meta-update with adaptive step sizes as given in (7). Illustrations and details on the architectures are given in Appendix B.
|
| 187 |
+
|
| 188 |
+
Meta-learning. We compute meta-updates via gradients of the negative discounted rewards received during a number of previous interactions with the environment. At training time, meta-learners interact with the environment twice, first using the initial policy, $\pi _ { \theta }$ , and then the meta-updated policy, $\pi _ { \phi }$ . At test time, the agents are limited to interacting with the environment only once, and hence always act according to $\pi _ { \phi }$ and compute meta-updates using importance-weight correction (see Sec. 3.2 and Algorithm 2). Additionally, to reduce the variance of the meta-updates at test time, the agents store the experience collected during the interaction with the test environment (and the corresponding importance weights) into the experience buffer and keep re-using that experience to update $\pi _ { \phi }$ as in (7). The size of the experience buffer is fixed to 3 episodes for nonstationary locomotion and 75 episodes for RoboSumo. More details are given in Appendix C.1.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Fig. 4: Episodic rewards for 7 consecutive episodes in 3 held out nonstationary locomotion environments. To evaluate adaptation strategies, we ran each of them in each environment for 7 episodes followed by a full reset of the environment, policy, and meta-updates (repeated 50 times). Shaded regions are $9 5 \%$ confidence intervals. Best viewed in color.
|
| 192 |
+
|
| 193 |
+
Adaptation baselines. We consider the following three baseline strategies:
|
| 194 |
+
|
| 195 |
+
(i) naive (or no adaptation),
|
| 196 |
+
(ii) implicit adaptation via $\mathtt { R L } ^ { 2 }$ , and
|
| 197 |
+
(iii) adaptation via tracking (Sutton et al., 2007) that keeps doing PPO updates at execution time.
|
| 198 |
+
|
| 199 |
+
Training in nonstationary locomotion. We train all methods on the same collection of nonstationary locomotion environments constructed by choosing all possible pairs of legs whose joint torques are scaled except 3 pairs that are held out for testing (i.e., 12 training and 3 testing environments for the six-leg creature). The agents are trained on the environments concurrently, i.e., to compute a policy update, we rollout from all environments in parallel and then compute, aggregate, and average the gradients (for details, see Appendix C.2). LSTM policies retain their state over the course of 7 episodes in each environment. Meta-learning agents compute meta-updates for each nonstationary environment separately.
|
| 200 |
+
|
| 201 |
+
Training in RoboSumo. To ensure consistency of the training curriculum for all agents, we first pre-train a number of policies of each type for every agent type via pure self-play with the PPO algorithm (Schulman et al., 2017; Bansal et al., 2018). We snapshot and save versions of the pretrained policies at each iteration. This lets us train other agents to play against versions of the pre-trained opponents at various stages of mastery. Next, we train the baselines and the meta-learning agents against the pool of pre-trained opponents7 concurrently. At each iteration $k$ we (a) randomly select an opponent from the training pool, (b) sample a version of the opponent’s policy to be in $[ 1 , k ]$ (this ensures that even when the opponent is strong, sometimes an undertrained version is selected which allows the agent learn to win at early stages), and (c) rollout against that opponent. All baseline policies are trained with PPO; meta-learners also used PPO as the outer loop for optimizing $\theta$ and $\alpha$ parameters. We retain the states of the LSTM policies over the course of interaction with the same version of the same opponent and reset it each time the opponent version is updated. Similarly to the locomotion setup, meta-learners compute meta-updates for each opponent in the training pool separately. A more detailed description of the distributed training is given in Appendix C.2.
|
| 202 |
+
|
| 203 |
+
Experimental design. We design our experiments to answer the following questions:
|
| 204 |
+
|
| 205 |
+
• When the interaction with the environment before it changes is strictly limited to one or very few episodes, what is the behavior of different adaptation methods in nonstationary locomotion and competitive multi-agent environments?
|
| 206 |
+
|
| 207 |
+
• What is the sample complexity of different methods, i.e., how many episodes is required for a method to successfully adapt to the changes? We test this by controlling the amount of experience the agent is allowed to get form the same environment before it changes.
|
| 208 |
+
|
| 209 |
+

|
| 210 |
+
Fig. 5: Win rates for different adaptation strategies in iterated games versus 3 different pre-trained opponents. At test time, both agents and opponents started from versions 700. Opponents’ versions were increasing with each consecutive round as if they were learning via self-play, while agents were allowed to adapt only from the limited experience with a given opponent. Each round consisted of 3 episodes. Each iterated game was repeated 100 times; shaded regions denote bootstrapped $9 5 \%$ confidence intervals; no smoothing. Best viewed in color.
|
| 211 |
+
|
| 212 |
+
Additionally, we ask the following questions specific to the competitive multi-agent setting:
|
| 213 |
+
|
| 214 |
+
• Given a diverse population of agents that have been trained under the same curriculum, how do different adaptation methods rank in a competition versus each other? When the population of agents is evolved for several generations—such that the agents interact with each other via iterated adaptation games, and those that lose disappear while the winners get duplicated—what happens with the proportions of different agents in the population?
|
| 215 |
+
|
| 216 |
+
# 5.2 ADAPTATION IN THE FEW-SHOT REGIME AND SAMPLE COMPLEXITY
|
| 217 |
+
|
| 218 |
+
Few-shot adaptation in nonstationary locomotion environments. Having trained baselines and meta-learning policies as described in Sec. 5.1, we selected 3 testing environments that corresponded to disabling 3 different pairs of legs of the six-leg agent: back, middle, and front legs. The results are presented on Fig. 4. Three observations: First, during the very first episode, the meta-learned initial policy, $\pi _ { \theta ^ { \star } }$ , turns out to be suboptimal for the task (it underperforms compared to other policies). However, after 1-2 episodes (and environment changes), it starts performing on par with other policies. Second, by the 6th and 7th episodes, meta-updated policies perform much better than the rest. Note that we use 3 gradient meta-updates for the adaptation of the meta-learners; the meta-updates are computed based on experience collected during the previous 2 episodes. Finally, tracking is not able to improve upon the baseline without adaptation and sometimes leads to even worse results.
|
| 219 |
+
|
| 220 |
+
Adaptation in RoboSumo under the few-shot constraint. To evaluate different adaptation methods in the competitive multi-agent setting consistently, we consider a variation of the iterated adaptation game, where changes in the opponent’s policies at test time are pre-determined but unknown to the agents. In particular, we pre-train 3 opponents (1 of each type, Fig. 2a) with LSTM policies with PPO via self-play (the same way as we pre-train the training pool of opponents, see Sec. 5.1) and snapshot their policies at each iteration. Next, we run iterated games between our trained agents that use different adaptation algorithms versus policy snapshots of the pre-trained opponents. Crucially, the policy version of the opponent keeps increasing from round to round as if it was training via self-play8. The agents have to keep adapting to increasingly more competent versions of the opponent (see Fig. 3). This setup allows us to test different adaptation strategies consistently against the same learning opponents.
|
| 221 |
+
|
| 222 |
+

|
| 223 |
+
Fig. 6: The effect of increased number of episodes per round in the iterated games versus a learning opponent.
|
| 224 |
+
|
| 225 |
+
The results are given on Fig. 5. We note that meta-learned adaptation strategies, in most cases, are able to adapt and improve their win-rates within about 100 episodes of interaction with constantly improving opponents. On the other hand, performance of the baselines often deteriorates during the rounds of iterated games. Note that the pre-trained opponents were observing 90 episodes of self-play per iteration, while the agents have access to only 3 episodes per round.
|
| 226 |
+
|
| 227 |
+
Sample complexity of adaptation in RoboSumo. Meta-learning helps to find an update suitable for fast or few-shot adaptation. However, how do different adaptation methods behave when more experience is available? To answer this question, we employ the same setup as previously and vary the number of episodes per round in the iterated game from 3 to 90. Each iterated game is repeated 20 times, and we measure the win-rates during the last 25 rounds of the game.
|
| 228 |
+
|
| 229 |
+
The results are presented on Fig. 6. When the number of episodes per round goes above 50, adaptation via tracking technically turns into “learning at test time,” and it is able to learn to compete against the self-trained opponents that it has never seen at training time. The meta-learned adaptation strategy performed near constantly the same in both few-shot and standard regimes. This suggests that the meta-learned strategy acquires a particular bias at training time that allows it to perform better from limited experience but also limits its capacity of utilizing more data. Note that, by design, the meta-updates are fixed to only 3 gradient steps from $\theta ^ { \star }$ with step-sizes $\alpha ^ { \star }$ (learned at training), while tracking keeps updating the policy with PPO throughout the iterated game. Allowing for meta-updates that become more flexible with the availability of data can help to overcome this limitation. We leave this to future work.
|
| 230 |
+
|
| 231 |
+
# 5.3 EVALUATION ON THE POPULATION-LEVEL
|
| 232 |
+
|
| 233 |
+
Combining different adaptation strategies with different policies and agents of different morphologies puts us in a situation where we have a diverse population of agents which we would like to rank according to the level of their mastery in adaptation (or find the “fittest”). To do so, we employ TrueSkill (Herbrich et al., 2007)—a metric similar to the ELO rating, but more popular in 1-vs-1 competitive video-games.
|
| 234 |
+
|
| 235 |
+
In this experiment, we consider a population of 105 trained agents: 3 agent types, 7 different policy and adaptation combinations, and 5 different stages of training (from 500 to 2000 training iterations). First, we assume that the initial distribution of any agent’s skill is $\mathcal { N } ( 2 5 , 2 5 / 3 )$ and the default distance that guarantees about $76 \%$ of winning, $\beta = 4 . 1 6 6 7$ . Next, we randomly generate 1000 matches between pairs of opponents and let them adapt while competing with each other in 100-round iterated adaptation games (states of the agents are reset before each game). After each game, we record the outcome and updated our belief about the skill of the corresponding agents using the TrueSkill algorithm9. The distributions of the skill for the agents of each type after 1000 iterated adaptation games between randomly selected players from the pool are visualized in Fig. 7.
|
| 236 |
+
|
| 237 |
+

|
| 238 |
+
Fig. 7: TrueSkill for the top-performing MLP- and LSTM-based agents. TrueSkill was computed based on outcomes (win, loss, or draw) in 1000 iterated adaptation games (100 consecutive rounds per game, 3 episodes per round) between randomly selected pairs of opponents from a population of 105 pre-trained agents.
|
| 239 |
+
|
| 240 |
+
There are a few observations we can make: First, recurrent policies were dominant. Second, adaptation via $\mathtt { R L } ^ { 2 }$ tended to perform equally or a little worse than plain LSTM with or without tracking in this setup. Finally, agents that meta-learned adaptation rules at training time, consistently demonstrated higher skill scores in each of the categories corresponding to different policies and agent types.
|
| 241 |
+
|
| 242 |
+
Finally, we enlarge the population from 105 to 1050 agents by duplicating each of them 10 times and evolve it (in the “natural selection” sense) for several generations as follows. Initially, we start with a balanced population of different creatures. Next, we randomly match 1000 pairs of agents, make them play iterated adaptation games, remove the agents that lost from the population and duplicate the winners. The same process is repeated 10 times. The result is presented in Fig 8. We see that many agents quickly disappear form initially uniform population and the meta-learners end up dominating.
|
| 243 |
+
|
| 244 |
+

|
| 245 |
+
Fig. 8: Evolution of a population of 1050 agents for 10 generations. Best viewed in color.
|
| 246 |
+
|
| 247 |
+
# 6 CONCLUSION AND FUTURE DIRECTIONS
|
| 248 |
+
|
| 249 |
+
In this work, we proposed a simple gradient-based meta-learning approach suitable for continuous adaptation in nonstationary environments. The key idea of the method is to regard nonstationarity as a sequence of stationary tasks and train agents to exploit the dependencies between consecutive tasks such that they can handle similar nonstationarities at execution time. We applied our method to nonstationary locomotion and within a competitive multi-agent setting. For the latter, we designed the RoboSumo environment and defined iterated adaptation games that allowed us to test various aspects of adaptation strategies. In both cases, meta-learned adaptation rules were more efficient than the baselines in the few-shot regime. Additionally, agents that meta-learned to adapt demonstrated the highest level of skill when competing in iterated games against each other.
|
| 250 |
+
|
| 251 |
+
The problem of continuous adaptation in nonstationary and competitive environments is far from being solved, and this work is the first attempt to use meta-learning in such setup. Indeed, our meta-learning algorithm has a few limiting assumptions and design choices that we have made mainly due to computational considerations. First, our meta-learning rule is to one-step-ahead update of the policy and is computationally similar to backpropagation through time with a unit time lag. This could potentially be extended to fully recurrent meta-updates that take into account the full history of interaction with the changing environment. Additionally, our meta-updates were based on the gradients of a surrogate loss function. While such updates explicitly optimized the loss, they required computing second order derivatives at training time, slowing down the training process by an order of magnitude compared to baselines. Utilizing information provided by the loss but avoiding explicit backpropagation through the gradients would be more appealing and scalable. Finally, our approach is unlikely to work with sparse rewards as the meta-updates use policy gradients and heavily rely on the reward signal. Introducing auxiliary dense rewards designed to enable meta-learning is a potential way to overcome this issue that we would like to explore in the future work.
|
| 252 |
+
|
| 253 |
+
# ACKNOWLEDGEMENTS
|
| 254 |
+
|
| 255 |
+
We would like to thank Harri Edwards, Jakob Foerster, Aditya Grover, Aravind Rajeswaran, Vikash Kumar, Yuhuai Wu and many others at OpenAI for helpful comments and fruitful discussions.
|
| 256 |
+
|
| 257 |
+
# REFERENCES
|
| 258 |
+
|
| 259 |
+
Maruan Al-Shedivat, Avinava Dubey, and Eric P Xing. Contextual explanation networks. arXiv preprint arXiv:1705.10301, 2017.
|
| 260 |
+
|
| 261 |
+
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, pp. 3981–3989, 2016.
|
| 262 |
+
|
| 263 |
+
Trapit Bansal, Jakub Pachocki, Szymon Sidor, Ilya Sutskever, and Igor Mordatch. Emergent complexity via multi-agent competition. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ Sy0GnUxCb.
|
| 264 |
+
|
| 265 |
+
Samy Bengio, Yoshua Bengio, Jocelyn Cloutier, and Jan Gecsei. On the optimization of a synaptic learning rule. In Preprints Conf. Optimality in Artificial and Biological Neural Networks, pp. 6–8. Univ. of Texas, 1992.
|
| 266 |
+
|
| 267 |
+
Yoshua Bengio, Samy Bengio, and Jocelyn Cloutier. Learning a synaptic learning rule. Université de Montréal, Département d’informatique et de recherche opérationnelle, 1990.
|
| 268 |
+
|
| 269 |
+
Michael Bowling. Convergence and no-regret in multiagent learning. In Advances in neural information processing systems, pp. 209–216, 2005.
|
| 270 |
+
|
| 271 |
+
Yongcan Cao, Wenwu Yu, Wei Ren, and Guanrong Chen. An overview of recent progress in the study of distributed multi-agent coordination. IEEE Transactions on Industrial informatics, 9(1): 427–438, 2013.
|
| 272 |
+
|
| 273 |
+
Rich Caruana. Multitask learning. In Learning to learn, pp. 95–133. Springer, 1998.
|
| 274 |
+
|
| 275 |
+
Vincent Conitzer and Tuomas Sandholm. Awesome: A general multiagent learning algorithm that converges in self-play and learns a best response against stationary opponents. Machine Learning, 67(1-2):23–43, 2007.
|
| 276 |
+
|
| 277 |
+
Antoine Cully, Jeff Clune, Danesh Tarapore, and Jean-Baptiste Mouret. Robots that can adapt like animals. Nature, 521(7553):503–507, 2015.
|
| 278 |
+
|
| 279 |
+
Bruno C Da Silva, Eduardo W Basso, Ana LC Bazzan, and Paulo M Engel. Dealing with nonstationary environments using context detection. In Proceedings of the 23rd international conference on Machine learning, pp. 217–224. ACM, 2006.
|
| 280 |
+
|
| 281 |
+
Yan Duan, John Schulman, Xi Chen, Peter L Bartlett, Ilya Sutskever, and Pieter Abbeel. $\mathbf { R } ^ { 1 ^ { 2 } }$ : Fast reinforcement learning via slow reinforcement learning. arXiv preprint arXiv:1611.02779, 2016.
|
| 282 |
+
|
| 283 |
+
Harrison Edwards and Amos Storkey. Towards a neural statistician. arXiv preprint arXiv:1606.02185, 2016.
|
| 284 |
+
|
| 285 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Lifelong few-shot learning. In Lifelong Learning: A Reinforcement Learning Approach ICML workshop, 2017a.
|
| 286 |
+
|
| 287 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. arXiv preprint arXiv:1703.03400, 2017b.
|
| 288 |
+
|
| 289 |
+
Jakob Foerster, Gregory Farquhar, Triantafyllos Afouras, Nantas Nardelli, and Shimon Whiteson. Counterfactual multi-agent policy gradients. arXiv preprint arXiv:1705.08926, 2017a.
|
| 290 |
+
|
| 291 |
+
Jakob N Foerster, Richard Y Chen, Maruan Al-Shedivat, Shimon Whiteson, Pieter Abbeel, and Igor Mordatch. Learning with opponent-learning awareness. arXiv preprint arXiv:1709.04326, 2017b.
|
| 292 |
+
|
| 293 |
+
Erin Grant, Chelsea Finn, Sergey Levine, Trevor Darrell, and Thomas Griffiths. Recasting gradientbased meta-learning as hierarchical bayes. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ BJ_UL-k0b.
|
| 294 |
+
|
| 295 |
+
David Ha, Andrew Dai, and Quoc V Le. Hypernetworks. arXiv preprint arXiv:1609.09106, 2016.
|
| 296 |
+
|
| 297 |
+
Ralf Herbrich, Tom Minka, and Thore Graepel. TrueskillTM: a bayesian skill rating system. In Advances in neural information processing systems, pp. 569–576, 2007.
|
| 298 |
+
|
| 299 |
+
Sepp Hochreiter, A Steven Younger, and Peter R Conwell. Learning to learn using gradient descent. In International Conference on Artificial Neural Networks, pp. 87–94. Springer, 2001.
|
| 300 |
+
|
| 301 |
+
Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. Journal of Machine Learning Research, 17(39):1–40, 2016.
|
| 302 |
+
|
| 303 |
+
Jiwei Li, Will Monroe, Alan Ritter, Michel Galley, Jianfeng Gao, and Dan Jurafsky. Deep reinforcement learning for dialogue generation. arXiv preprint arXiv:1606.01541, 2016.
|
| 304 |
+
|
| 305 |
+
Ke Li and Jitendra Malik. Learning to optimize. arXiv preprint arXiv:1606.01885, 2016.
|
| 306 |
+
|
| 307 |
+
Ryan Lowe, Yi Wu, Aviv Tamar, Jean Harb, Pieter Abbeel, and Igor Mordatch. Multi-agent actorcritic for mixed cooperative-competitive environments. arXiv preprint arXiv:1706.02275, 2017.
|
| 308 |
+
|
| 309 |
+
Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. Psychology of learning and motivation, 24:109–165, 1989.
|
| 310 |
+
|
| 311 |
+
Richard Mealing and Jonathan L Shapiro. Opponent modelling by sequence prediction and lookahead in two-player games. In International Conference on Artificial Intelligence and Soft Computing, pp. 385–396. Springer, 2013.
|
| 312 |
+
|
| 313 |
+
Tom M Mitchell, William W Cohen, Estevam R Hruschka Jr, Partha Pratim Talukdar, Justin Betteridge, Andrew Carlson, Bhavana Dalvi Mishra, Matthew Gardner, Bryan Kisiel, Jayant Krishnamurthy, et al. Never ending learning. In AAAI, pp. 2302–2310, 2015.
|
| 314 |
+
|
| 315 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015.
|
| 316 |
+
|
| 317 |
+
Peng Peng, Quan Yuan, Ying Wen, Yaodong Yang, Zhenkun Tang, Haitao Long, and Jun Wang. Multiagent bidirectionally-coordinated nets for learning to play starcraft combat games. arXiv preprint arXiv:1703.10069, 2017.
|
| 318 |
+
|
| 319 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. 2016.
|
| 320 |
+
|
| 321 |
+
Mark B Ring. Continual learning in reinforcement environments. PhD thesis, University of Texas at Austin Austin, Texas 78712, 1994.
|
| 322 |
+
|
| 323 |
+
Mark B Ring. CHILD: A first step towards continual learning. Machine Learning, 28(1):77–104, 1997.
|
| 324 |
+
|
| 325 |
+
Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Metalearning with memory-augmented neural networks. In International conference on machine learning, pp. 1842–1850, 2016.
|
| 326 |
+
|
| 327 |
+
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.
|
| 328 |
+
|
| 329 |
+
Jürgen Schmidhuber. Learning to control fast-weight memories: An alternative to dynamic recurrent networks. Learning, 4(1), 1992.
|
| 330 |
+
|
| 331 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pp. 1889–1897, 2015a.
|
| 332 |
+
|
| 333 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. High-dimensional continuous control using generalized advantage estimation. arXiv preprint arXiv:1506.02438, 2015b.
|
| 334 |
+
|
| 335 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 336 |
+
|
| 337 |
+
Daniel L Silver, Qiang Yang, and Lianghao Li. Lifelong machine learning systems: Beyond learning algorithms. In AAAI Spring Symposium: Lifelong Machine Learning, volume 13, pp. 05, 2013.
|
| 338 |
+
|
| 339 |
+
David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016.
|
| 340 |
+
|
| 341 |
+
Satinder Singh, Michael Kearns, and Yishay Mansour. Nash convergence of gradient dynamics in general-sum games. In Proceedings of the Sixteenth conference on Uncertainty in artificial intelligence, pp. 541–548. Morgan Kaufmann Publishers Inc., 2000.
|
| 342 |
+
|
| 343 |
+
Jake Snell, Kevin Swersky, and Richard S Zemel. Prototypical networks for few-shot learning. arXiv preprint arXiv:1703.05175, 2017.
|
| 344 |
+
|
| 345 |
+
Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, pp. 1057–1063, 2000.
|
| 346 |
+
|
| 347 |
+
Richard S Sutton, Anna Koop, and David Silver. On the role of tracking in stationary environments. In Proceedings of the 24th international conference on Machine learning, pp. 871–878. ACM, 2007.
|
| 348 |
+
|
| 349 |
+
Sebastian Thrun. Lifelong learning algorithms. Learning to learn, 8:181–209, 1998.
|
| 350 |
+
|
| 351 |
+
Sebastian Thrun and Lorien Pratt. Learning to learn. Springer, 1998.
|
| 352 |
+
|
| 353 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on, pp. 5026– 5033. IEEE, 2012.
|
| 354 |
+
|
| 355 |
+
Oriol Vinyals, Charles Blundell, Tim Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in Neural Information Processing Systems, pp. 3630–3638, 2016.
|
| 356 |
+
|
| 357 |
+
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.
|
| 358 |
+
|
| 359 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
|
| 360 |
+
|
| 361 |
+
Chongjie Zhang and Victor R Lesser. Multi-agent learning with policy prediction. In AAAI, 2010.
|
| 362 |
+
|
| 363 |
+
# A DERIVATIONS AND THE POLICY GRADIENT THEOREM
|
| 364 |
+
|
| 365 |
+
In this section, we derive the policy gradient update for MAML as give in (4) as well as formulate and equivalent of the policy gradient theorem (Sutton et al., 2000) in the learning-to-learn setting.
|
| 366 |
+
|
| 367 |
+
Our derivation is not bound to a particular form of the adaptation update. In general, we are interested in meta-learning a procedure, $f _ { \theta }$ , parametrized by $\theta$ , which, given access to a limited experience on a task, can produce a good policy for solving it. Note that $f _ { \theta }$ is responsible for both collecting the initial experience and constructing the final policy for the given task. For example, in case of MAML (Finn et al., 2017b), $f _ { \theta }$ is represented by the initial policy, $\pi _ { \theta }$ , and the adaptation update rule (4) that produces $\pi _ { \phi }$ with $\phi : = \dot { \theta ^ { - } } \alpha \nabla _ { \theta } L _ { T } \dot { ( } \tau _ { \theta } ^ { 1 : K } )$ .
|
| 368 |
+
|
| 369 |
+
More formally, after querying $K$ trajectories, $\tau _ { \theta } ^ { 1 : K }$ , we want to produce $\pi _ { \phi }$ that minimizes the expected loss w.r.t. the distribution over tasks:
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
\begin{array} { r } { \mathcal { L } ( \theta ) : = \mathbb { E } _ { T \sim \mathcal { D } ( T ) } \left[ \mathbb { E } _ { \tau _ { \theta } ^ { 1 : K } \sim p _ { T } ( \tau \mid \theta ) } \left[ \mathbb { E } _ { \tau _ { \phi } \sim p _ { T } ( \tau \mid \phi ) } \left[ L _ { T } ( \tau _ { \phi } ) \mid \tau _ { \theta } ^ { 1 : K } \right] \right] \right] } \end{array}
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
Note that the inner-most expectation is conditional on the experience, $\tau _ { \theta } ^ { 1 : K }$ , which our meta-learning procedure, $f _ { \theta }$ , collects to produce a task-specific policy, $\pi _ { \phi }$ . Assuming that the loss $L _ { T } ( \tau _ { \theta } ^ { 1 : K } )$ is linear in trajectories, and using linearity of expectations, we can drop the superscript $1 : K$ and denote the trajectory sampled under $\phi _ { \theta }$ for task $T _ { i }$ simply as $\tau _ { \theta , i }$ . At training time, we are given a finite sample of tasks from the distribution $\mathcal { D } ( T )$ and can search for $\hat { \theta }$ close to optimal by optimizing over the empirical distribution:
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\hat { \theta } : = \underset { \theta } { \operatorname { a r g m i n } } \hat { \mathcal { L } } ( \theta ) , \mathrm { w h e r e } \hat { \mathcal { L } } ( \theta ) : = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathbb { E } _ { \tau _ { \theta , i } \sim p _ { T _ { i } } ( \tau | \theta ) } \left[ \mathbb { E } _ { \tau _ { \phi , i } \sim p _ { T _ { i } } ( \tau | \phi ) } \left[ L _ { T _ { i } } ( \tau _ { \phi , i } ) \ | \ \tau _ { \theta , i } \right] \right] .
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
We re-write the objective function for task $T _ { i }$ in (11) more explicitly by expanding the expectations:
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\begin{array} { l } { { \displaystyle { \mathcal { L } } _ { T _ { i } } ( \theta ) : = { \mathbb { E } } _ { \tau _ { \theta , i } \sim p _ { T _ { i } } ( \tau | \theta ) } \left[ { \mathbb { E } } _ { \tau _ { \phi , i } \sim p _ { T _ { i } } ( \tau | \phi ) } \left[ L _ { T _ { i } } ( \tau _ { \phi , i } ) ~ | ~ \tau _ { \theta , i } \right] \right] = } } \\ { { \displaystyle \int { L _ { T _ { i } } ( \tau _ { \phi , i } ) } _ { T _ { i } } \left( \tau _ { \phi , i } ~ | ~ \phi \right) ~ P _ { T _ { i } } \left( \phi ~ | ~ \theta , \tau _ { \theta , i } \right) ~ P _ { T _ { i } } \left( \tau _ { \theta , i } ~ | ~ \theta \right) ~ d \tau _ { \phi , i } ~ d \phi ~ d \tau _ { \theta , i } } } \end{array}
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
Trajectories, $\tau _ { \phi , i }$ and $\tau _ { \theta , i }$ , and parameters $\phi$ of the policy $\pi _ { \phi }$ can be thought as random variables that we marginalize out to construct the objective that depends on $\theta$ only. The adaptation update rule (4) assumes the following $P _ { T _ { i } } \left( \phi \mid \theta , \tau _ { \theta , i } \right)$ :
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
P _ { T _ { i } } \left( \phi \mid \theta , \tau _ { \theta , i } \right) : = \delta \left( \theta - \alpha \nabla _ { \theta } \frac { 1 } { K } \sum _ { k = 1 } ^ { K } L _ { T _ { i } } ( \pmb { \tau _ { \theta , i } ^ { k } } ) \right)
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
Note that by specifying $P _ { T _ { i } } \left( \phi \mid \theta , \tau _ { \theta , i } \right)$ differently, we may arrive at different meta-learning algorithms. After plugging (13) into (12) and integrating out $\phi$ , we get the following expected loss for task $T _ { i }$ as a function of $\theta$ :
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\begin{array} { l } { { \displaystyle { \mathcal { L } } _ { T _ { i } } ( \theta ) = { \mathbb { E } } _ { \tau _ { \theta , i } \sim p _ { T _ { i } } ( \tau | \theta ) } \left[ { \mathbb { E } } _ { \tau _ { \phi , i } \sim p _ { T _ { i } } ( \tau | \phi ) } \left[ L _ { T _ { i } } ( \tau _ { \phi , i } ) \ | \ \tau _ { \theta , i } \right] \right] = } } \\ { { \displaystyle ~ \int L _ { T _ { i } } ( \tau _ { \phi , i } ) ~ P _ { T _ { i } } \left( \tau _ { \phi , i } \ | \ \theta - \alpha \nabla _ { \theta } \frac { 1 } { K } \sum _ { k = 1 } ^ { K } L _ { T _ { i } } ( \tau _ { \theta , i } ^ { k } ) \right) ~ P _ { T _ { i } } \left( \tau _ { \theta , i } \ | \ \theta \right) ~ d \tau _ { \phi , i } ~ d \tau _ { \theta , i } } } \end{array}
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
The gradient of (14) will take the following form:
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\begin{array} { l } { { \nabla _ { \theta } \mathcal { L } _ { T _ { i } } ( \theta ) = \displaystyle \int \left[ L _ { T _ { i } } ( \tau _ { \phi , i } ) \nabla _ { \theta } \log P _ { T _ { i } } ( \tau _ { \phi , i } \mid \phi ) \right] P _ { T _ { i } } ( \tau _ { \phi , i } \mid \phi ) P _ { T _ { i } } ( \tau _ { \theta , i } \mid \theta ) d \tau d \tau _ { \theta , i } + } } \\ { { \displaystyle \int \left[ L _ { T _ { i } } ( \tau ) \nabla _ { \theta } \log P _ { T _ { i } } ( \tau _ { \theta , i } \mid \theta ) \right] P _ { T _ { i } } ( \tau \mid \phi ) P _ { T _ { i } } ( \tau _ { \theta , i } \mid \theta ) d \tau d \tau _ { \theta , i } } } \end{array}
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
where $\phi = \phi ( \theta , \tau _ { \theta , i } ^ { 1 : K } )$ as given in (14). Note that the expression consists of two terms: the first gradient w.r.t. the original policy, term is the standard policy gradient w.r.t. the updated policy, $\pi _ { \phi }$ , that is used to collect $\tau _ { \theta , i } ^ { 1 : K }$ $\pi _ { \phi }$ . If we were to omit marginalization , while the second one is the policy
|
| 406 |
+
|
| 407 |
+
of th $\tau _ { \theta , i } ^ { 1 : K }$ (as it was done in the original paper (Finn et al., 2017b)), the terms would disappear. Finally,ient can be re-written in a more succinct form:
|
| 408 |
+
|
| 409 |
+
$$
|
| 410 |
+
\nabla _ { \theta } \mathcal { L } _ { T _ { i } } ( \theta ) = \mathbb { E } _ { \tau _ { \theta , i } ^ { 1 ; K } \sim P _ { T _ { i } } ( \tau | \theta ) } \left[ L _ { T _ { i } } ( \tau ) \left[ \nabla _ { \theta } \log \pi _ { \phi } ( \tau ) + \nabla _ { \theta } \sum _ { k = 1 } ^ { K } \log \pi _ { \theta } ( \tau _ { k } ) \right] \right]
|
| 411 |
+
$$
|
| 412 |
+
|
| 413 |
+
The update given in (16) is an unbiased estimate of the gradient as long as the loss $\boldsymbol { L _ { T _ { i } } }$ is simply the sum of discounted rewards (i.e., it extends the classical REINFORCE algorithm (Williams, 1992) to meta-learning). Similarly, we can define $L _ { T _ { i } }$ that uses a value or advantage function and extend the policy gradient theorem Sutton et al. (2000) to make it suitable for meta-learning.
|
| 414 |
+
|
| 415 |
+
Theorem 1 (Meta policy gradient theorem). For any MDP, gradient of the value function w.r.t. $\theta$ takes the following form:
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
\begin{array} { l } { \displaystyle \nabla _ { \theta } V _ { T } ^ { \theta } ( \mathbf { x } _ { 0 } ) = } \\ { \displaystyle \mathbb { E } _ { \tau _ { 1 : K } \sim p _ { T } ( \tau | \theta ) } \left[ \sum _ { \mathbf { x } } d _ { T } ^ { \phi } ( \mathbf { x } ) \sum _ { a } \frac { \partial \pi _ { \phi } ( a \mid \mathbf { x } ) } { \partial \theta } Q _ { T } ^ { \phi } ( a , \mathbf { x } ) \right] + } \\ { \displaystyle \mathbb { E } _ { \tau _ { 1 : K } \sim p _ { T } ( \tau | \theta ) } \left[ \left( \frac { \partial } { \partial \theta } \sum _ { k = 1 } ^ { K } \log \pi _ { \theta } ( \tau _ { k } ) \right) \sum _ { a } \pi _ { \phi } ( a \mid \mathbf { x } _ { 0 } ) Q _ { T } ^ { \phi } ( a , \mathbf { x } _ { 0 } ) \right] , } \end{array}
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
where $d _ { T } ^ { \phi } ( { \bf x } )$ is the stationary distribution under policy $\pi _ { \phi }$ .
|
| 422 |
+
|
| 423 |
+
Proof. We define task-specific value functions under the generated policy, $\pi _ { \phi }$ , as follows:
|
| 424 |
+
|
| 425 |
+
$$
|
| 426 |
+
\begin{array} { r l r } { { V _ { T } ^ { \phi } ( \mathbf { x } _ { 0 } ) = \mathbb { E } _ { \tau \sim p _ { T } ( \tau \mid \phi ) } [ \sum _ { t = k } ^ { H } \gamma ^ { t } R _ { T } ( \mathbf { x } _ { t } ) \mid \mathbf { x } _ { 0 } ] , } } \\ & { } & { Q _ { T } ^ { \phi } ( \mathbf { x } _ { 0 } , a _ { 0 } ) = \mathbb { E } _ { \tau \sim p _ { T } ( \tau \mid \phi ) } [ \sum _ { t = k } ^ { H } \gamma ^ { t } R _ { T } ( \mathbf { x } _ { t } ) \mid \mathbf { x } _ { 0 } , a _ { 0 } ] , } \end{array}
|
| 427 |
+
$$
|
| 428 |
+
|
| 429 |
+
where the expectations are taken w.r.t. the dynamics of the environment of the given task, $T$ , and the policy, $\pi _ { \phi }$ . Next, we need to marginalize out $\tau _ { 1 : K }$ :
|
| 430 |
+
|
| 431 |
+
$$
|
| 432 |
+
V _ { T } ^ { \theta } ( \mathbf { x } _ { 0 } ) = \mathbb { E } _ { \tau _ { 1 : K } \sim p _ { T } ( \tau | \theta ) } \left[ \mathbb { E } _ { \tau \sim p _ { T } ( \tau | \phi ) } \left[ \sum _ { { t = k } } ^ { H } \gamma ^ { t } R _ { T } ( \mathbf { x } _ { t } ) \mid \mathbf { x } _ { 0 } \right] \right] ,
|
| 433 |
+
$$
|
| 434 |
+
|
| 435 |
+
and after the gradient w.r.t. $\theta$ , we arrive at:
|
| 436 |
+
|
| 437 |
+
$$
|
| 438 |
+
\begin{array} { l } { { \nabla _ { \theta } V _ { T } ^ { \theta } ( { \bf x } _ { 0 } ) = } } \\ { { \mathbb { E } _ { \tau _ { 1 : K } \sim p _ { T } ( \tau | \theta ) } \left[ \displaystyle \sum _ { a } \frac { \partial \pi _ { \phi } ( a \mid { \bf x } _ { 0 } ) } { \partial \theta } Q _ { T } ^ { \phi } ( a , { \bf x } _ { 0 } ) + \pi _ { \phi } ( a \mid { \bf x } _ { 0 } ) \frac { \partial Q _ { T } ^ { \phi } ( a , { \bf x } _ { 0 } ) } { \partial \theta } \right] + } } \\ { { \mathbb { E } _ { \tau _ { 1 : K } \sim p _ { T } ( \tau | \theta ) } \left[ \displaystyle \left( \sum _ { k = 1 } ^ { K } \frac { \partial } { \partial \theta } \log \pi _ { \theta } ( \tau _ { k } ) \right) \displaystyle \sum _ { a } \pi _ { \phi } ( a \mid { \bf x } _ { 0 } ) Q _ { T } ^ { \phi } ( a , { \bf x } _ { 0 } ) \right] , } } \end{array}
|
| 439 |
+
$$
|
| 440 |
+
|
| 441 |
+
where the first term is similar to the expression used in the original policy gradient theorem (Sutton et al., 2000) while the second one comes from differentiating trajectories $\tau _ { 1 : K }$ that depend on $\theta$ Following Sutton et al. (2000), we unroll the derivative of the Q-function in the first term and arrive at the following final expression for the policy gradient:
|
| 442 |
+
|
| 443 |
+
$$
|
| 444 |
+
\begin{array} { r l } & { \nabla _ { \theta } V _ { T } ^ { \theta } ( \mathbf { x } _ { 0 } ) = } \\ & { \quad \quad \mathbb { E } _ { \tau _ { 1 : K } \sim p _ { T } ( \tau | \theta ) } \left[ \displaystyle \sum _ { \mathbf { x } } d _ { T } ^ { \phi } ( \mathbf { x } ) \sum _ { a } \frac { \partial \pi _ { \phi } ( a \mid \mathbf { x } ) } { \partial \theta } Q _ { T } ^ { \phi } ( a , \mathbf { x } ) \right] + } \\ & { \quad \quad \mathbb { E } _ { \tau _ { 1 : K } \sim p _ { T } ( \tau | \theta ) } \left[ \displaystyle \left( \frac { \partial } { \partial \theta } \sum _ { k = 1 } ^ { K } \log \pi _ { \theta } ( \tau _ { k } ) \right) \sum _ { a } \pi _ { \phi } ( a \mid \mathbf { x } _ { 0 } ) Q _ { T } ^ { \phi } ( a , \mathbf { x } _ { 0 } ) \right] } \end{array}
|
| 445 |
+
$$
|
| 446 |
+
|
| 447 |
+
Remark 1. The same theorem is applicable to the continuous setting with the only changes in the distributions used to compute expectations in (17) and (18). In particular, the outer expectation in (17) should be taken w.r.t. $p _ { T _ { i } } ( \tau \mid \theta )$ while the inner expectation w.r.t. $p _ { T _ { i + 1 } } ( \tau | \ r \phi )$ .
|
| 448 |
+
|
| 449 |
+
All our derivations so far assumed single step gradient-based adaptation update. Experimentally, we found that the multi-step version of the update often leads to a more stable training and better test time performance. In particular, we construct $\phi$ via intermediate $M$ gradient steps:
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\begin{array} { r l } & { \phi ^ { 0 } : = \theta , \quad \tau _ { \theta } ^ { 1 : K } \sim P _ { T } ( \tau \mid \theta ) , } \\ & { \phi ^ { m } : = \phi ^ { m - 1 } - \alpha _ { m } \nabla _ { \phi ^ { m - 1 } } L _ { T } \left( \tau _ { \phi ^ { m - 1 } } ^ { 1 : K } \right) , \quad m = 1 , \hdots , M - 1 , } \\ & { \phi : = \phi ^ { M - 1 } - \alpha _ { M } \nabla _ { \phi ^ { M - 1 } } L _ { T } \left( \tau _ { \phi ^ { M - 1 } } ^ { 1 : K } \right) } \end{array}
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
with the environment and sampling intermediate trajectories, where are intermediate policy parameters. Note that each intermediate step, $\tau _ { \phi ^ { m } } ^ { 1 : K }$ . To compute the policy gradient, , requires interacting we need to marginalize out all the intermediate random variables, $\pi _ { \phi ^ { m } }$ and $\tau _ { \phi ^ { m } } ^ { 1 : K }$ , $m = 1 , \ldots , M$ The objective function (12) takes the following form:
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
\begin{array} { l } { { \displaystyle { \mathcal { L } } _ { T } ( \theta ) = } } \\ { { \displaystyle \int L _ { T } ( \tau ) P _ { T } \left( \tau \mid \phi \right) P _ { T } \left( \phi \mid \phi ^ { M - 1 } , \tau _ { \phi ^ { M - 1 } } ^ { 1 : K } \right) d \tau d \phi \times } } \\ { { \displaystyle \prod _ { m = 1 } ^ { M - 2 } P _ { T } \left( \tau _ { \phi ^ { m + 1 } } ^ { 1 : K } \mid \phi ^ { m + 1 } \right) P _ { T } \left( \phi ^ { m + 1 } \mid \phi ^ { m } , \tau _ { \phi ^ { m } } ^ { 1 : K } \right) d \tau _ { \phi ^ { m + 1 } } ^ { 1 : K } d \phi ^ { m + 1 } \times } } \\ { { \displaystyle P _ { T } \left( \tau ^ { 1 : K } \mid \theta \right) d \tau ^ { 1 : K } } } \end{array}
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
Since $P _ { T } \left( \phi ^ { m + 1 } \mid \phi ^ { m } , \tau _ { \phi ^ { m } } ^ { 1 : K } \right)$ at each intermediate steps are delta functions, the final expression for the multi-step MAML objective has the same form as (14), with integration taken w.r.t. all intermediate trajectories. Similarly, an unbiased estimate of the gradient of the objective gets $M$ additional terms:
|
| 462 |
+
|
| 463 |
+
$$
|
| 464 |
+
\nabla _ { \theta } \mathcal { L } _ { T } = \mathbb { E } _ { \{ \tau _ { \phi ^ { m } } ^ { 1 ; K } \} _ { m = 0 } ^ { M - 1 } , \tau } \left[ L _ { T } ( \tau ) \left[ \nabla _ { \theta } \log \pi _ { \phi } ( \tau ) + \sum _ { m = 0 } ^ { M - 1 } \nabla _ { \theta } \sum _ { k = 1 } ^ { K } \log \pi _ { \phi ^ { m } } ( \tau _ { \phi ^ { m } } ^ { k } ) \right] \right] ,
|
| 465 |
+
$$
|
| 466 |
+
|
| 467 |
+
where the expectation is taken w.r.t. trajectories (including all intermediate ones). Again, note that at training time we do not constrain the number of interactions with each particular environment and do rollout using each intermediate policy to compute updates. At testing time, we interact with the environment only once and rely on the importance weight correction as described in Sec. 3.2.
|
| 468 |
+
|
| 469 |
+

|
| 470 |
+
Fig. 9: Policy and value function architectures.
|
| 471 |
+
|
| 472 |
+
# B ADDITIONAL DETAILS ON THE ARCHITECTURES
|
| 473 |
+
|
| 474 |
+
The neural architectures used for our policies and value functions are illustrated in Fig. 9. Our MLP architectures were memory-less and reactive. The LSTM architectures had used a fully connected embedding layer (with 64 hidden units) followed by a recurrent layer (also with 64 units). The state in LSTM-based architectures was kept throughout each episode and reset to zeros at the beginning of each new episode. The $\mathrm { { R L ^ { 2 } } }$ architecture additionally took reward and done signals from the previous time step and kept the state throughout the whole interactions with a given environment (or opponent). The recurrent architectures were unrolled for $T = 1 0$ time steps and optimized with PPO via backprop through time.
|
| 475 |
+
|
| 476 |
+
# C ADDITIONAL DETAILS ON META-LEARNING AND OPTIMIZATION
|
| 477 |
+
|
| 478 |
+
# C.1 META-UPDATES FOR CONTINUOUS ADAPTATION
|
| 479 |
+
|
| 480 |
+
Our meta-learned adaptation methods were used with MLP and LSTM policies (Fig. 9). The metaupdates were based on 3 gradient steps with adaptive step sizes $\alpha$ were initialized with 0.001. There are a few additional details to note:
|
| 481 |
+
|
| 482 |
+
1. $\theta$ and $\phi$ parameters were a concatenation of the policy and the value function parameters. 2. At the initial stages of optimization, meta-gradient steps often tended to “explode”, hence we clipped them by values norms to be between -0.1 and 0.1. 3. We used different surrogate loss functions for the meta-updates and for the outer optimization. For meta-updates, we used the vanilla policy gradients computed on the negative discounted rewards, while for the outer optimization loop we used the PPO objective.
|
| 483 |
+
|
| 484 |
+
# C.2 ON PPO AND ITS DISTRIBUTED IMPLEMENTATION
|
| 485 |
+
|
| 486 |
+
As mentioned in the main text and similar to (Bansal et al., 2018), large batch sizes were used to ensure enough exploration throughout policy optimization and were critical for learning in the competitive setting of RoboSumo. In our experiments, the epoch size of the PPO was set 32,000 episodes and the batch size was set to 8,000. The PPO clipping hyperparameter was set to $\epsilon = 0 . 2$ and the KL penalty was set to 0. In all our experiments, the learning rate (for meta-learning, the learning rate for $\theta$ and $\alpha$ ) was set to 0.0003. The generalized advantage function estimator (GAE) (Schulman et al., 2015b) was optimized jointly with the policy (we used $\gamma = 0 . 9 9 5$ and $\lambda = 0 . 9 5$ ).
|
| 487 |
+
|
| 488 |
+
To train our agents in reasonable time, we used a distributed implementation of the PPO algorithm. To do so, we versioned the agent’s parameters (i.e., kept parameters after each update and assigned it a version number) and used a versioned queue for rollouts. Multiple worker machines were generating rollouts in parallel for the most recent available version of the agent parameters and were pushing them into the versioned rollout queue. The optimizer machine collected rollouts from the queue and made a PPO optimization steps (see (Schulman et al., 2017) for details) as soon as enough rollouts were available.
|
| 489 |
+
|
| 490 |
+
We trained agents on multiple environments simultaneously. In nonstationary locomotion, each environment corresponded to a different pair of legs of the creature becoming dysfunctional. In RoboSumo, each environment corresponded to a different opponent in the training pool. Simultaneous training was achieved via assigning these environments to rollout workers uniformly at random, so that the rollouts in each mini-batch were guaranteed to come from all training environments.
|
| 491 |
+
|
| 492 |
+
# D ADDITIONAL DETAILS ON THE ENVIRONMENTS
|
| 493 |
+
|
| 494 |
+
# D.1 OBSERVATION AND ACTION SPACES
|
| 495 |
+
|
| 496 |
+
Both observation and action spaces in RoboSumo continuous. The observations of each agent consist of the position of its own body (7 dimensions that include 3 absolute coordinates in the global cartesian frame and 4 quaternions), position of the opponent’s body (7 dimensions), its own joint angles and velocities (2 angles and 2 velocities per leg), and forces exerted on each part of its own body (6 dimensions for torso and 18 for each leg) and forces exerted on the opponent’s torso (6 dimensions). All forces were squared and clipped at 100. Additionally, we normalized observations using a running mean and clipped their values between -5 and 5. The action spaces had 2 dimensions per joint. Table 1 summarizes the observation and action spaces for each agent type.
|
| 497 |
+
|
| 498 |
+
Table 1: Dimensionality of the observation and action spaces of the agents in RoboSumo.
|
| 499 |
+
|
| 500 |
+
<table><tr><td rowspan="2">Agent</td><td colspan="5">Observation space</td><td rowspan="2">Action space</td></tr><tr><td>Coordinates</td><td>Self Velocities</td><td>Forces</td><td>Opponent Coordinates</td><td>Forces</td></tr><tr><td>Ant</td><td>15</td><td>14</td><td>78</td><td>7</td><td>6</td><td>8</td></tr><tr><td>Bug</td><td>19</td><td>18</td><td>114</td><td>7</td><td>6</td><td>12</td></tr><tr><td>Spider</td><td>23</td><td>22</td><td>150</td><td>7</td><td>6</td><td>16</td></tr></table>
|
| 501 |
+
|
| 502 |
+
Note that the agents observe neither any of the opponents velocities, nor positions of the opponent’s limbs. This allows us to keep the observation spaces consistent regardless of the type of the opponent. However, even though the agents are blind to the opponent’s limbs, they can sense them via the forces applied to the agents’ bodies when in contact with the opponent.
|
| 503 |
+
|
| 504 |
+
# D.2 SHAPED REWARDS
|
| 505 |
+
|
| 506 |
+
In RoboSumo, the winner gets 2000 reward, the loser is penalized for -2000, and in case of draw both agents get -1000. In addition to the sparse win/lose rewards, we used the following dense rewards to encourage fast learning at the early training stages:
|
| 507 |
+
|
| 508 |
+
• Quickly push the opponent outside. The agent got penalty at each time step proportional to $\exp \{ - d _ { \mathrm { o p p } } \}$ where $d _ { \mathrm { o p p } }$ was the distance of the opponent from the center of the ring. Moving towards the opponent. Reward at each time step proportional to magnitude of the velocity component towards the opponent.
|
| 509 |
+
• Hit the opponent. Reward proportional to the square of the total forces exerted on the opponent’s torso.
|
| 510 |
+
• Control penalty. The $l _ { 2 }$ penalty on the actions to prevent jittery/unnatural movements.
|
| 511 |
+
|
| 512 |
+
# D.3 RO B OSU M O CALIBRATION
|
| 513 |
+
|
| 514 |
+
To calibrate the RoboSumo environment we used the following procedure. First, we trained each agent via pure self-play with LSTM policy using PPO for the same number of iterations, tested them one against the other (without adaptation), and recorded the win rates (Table 2). To ensure the balance, we kept increasing the mass of the weaker agents and repeated the calibration procedure until the win rates equilibrated.
|
| 515 |
+
|
| 516 |
+
Table 2: Win rates for the first agent in the 1-vs-1 RoboSumo without adaptation before and after calibration.
|
| 517 |
+
|
| 518 |
+
<table><tr><td>Masses (Ant,Bug,Spider) Ant vs.Bug</td><td></td><td>gAnt vs. SpiderBug vs. Spider</td><td></td></tr><tr><td>Initial (10,10,10)</td><td>25.2 ±3.9%</td><td>83.6 ± 3.1%</td><td>90.2 ± 2.7%</td></tr><tr><td>Calibrated (13,10,39)</td><td>50.6 ± 5.6%</td><td>51.6 ± 3.4%</td><td>51.7 ± 2.8%</td></tr></table>
|
| 519 |
+
|
| 520 |
+
# E ADDITIONAL DETAILS ON EXPERIMENTS
|
| 521 |
+
|
| 522 |
+
# E.1 AVERAGE WIN RATES
|
| 523 |
+
|
| 524 |
+
Table 3 gives average win rates for the last 25 rounds of iterated adaptation games played by different agents with different adaptation methods (win rates for each episode are visualized in Figure 5).
|
| 525 |
+
|
| 526 |
+
Table 3: Average win-rates $9 5 \%$ CI) in the last 25 rounds of the 100-round iterated adaptation games between different agents and different opponents. The base policy and value function were LSTMs with 64 hidden units.
|
| 527 |
+
|
| 528 |
+
<table><tr><td rowspan="2">Agent</td><td rowspan="2">Opponent</td><td colspan="3">Adaptation Strategy</td></tr><tr><td>RL²</td><td>LSTM + PPO-tracking</td><td>LSTM+ meta-updates</td></tr><tr><td rowspan="3">Ant</td><td>Ant</td><td>24.9 (5.4)%</td><td>30.0 (6.7)%</td><td>44.0 (7.7)%</td></tr><tr><td>Bug</td><td>21.0 (6.3)%</td><td>15.6 (7.1)%</td><td>34.6 (8.1)%</td></tr><tr><td>Spider</td><td>24.8 (10.5)%</td><td>27.6 (8.4)%</td><td>35.1 (7.7)%</td></tr><tr><td rowspan="3">Bug</td><td>Ant</td><td>33.5 (6.9)%</td><td>26.6 (7.4)%</td><td>39.5 (7.1)%</td></tr><tr><td>Bug</td><td>28.6 (7.4)%</td><td>21.2 (4.2)%</td><td>43.7 (8.0)%</td></tr><tr><td>Spider</td><td>45.8 (8.1)%</td><td>42.6 (12.9)%</td><td>52.0 (13.9)%</td></tr><tr><td rowspan="3">Spider</td><td>Ant</td><td>40.3 (9.7)%</td><td>48.0 (9.8)%</td><td>45.3 (10.9)%</td></tr><tr><td>Bug</td><td>38.4 (7.2)%</td><td>43.9 (7.1)%</td><td>48.4 (9.2)%</td></tr><tr><td>Spider</td><td>33.9 (7.2)%</td><td>42.2 (3.9)%</td><td>46.7 (3.8)%</td></tr></table>
|
| 529 |
+
|
| 530 |
+
E.2 TRUESKILL RANK OF THE TOP AGENTS
|
| 531 |
+
Table $4 \&$ Fig. 10: Top-5 agents with MLP and LSTM policies from the population ranked by TrueSkill. The heatmap shows a priori win-rates in iterated games based on TrueSkill for the top agents against each other.
|
| 532 |
+
|
| 533 |
+
<table><tr><td>Rank</td><td>Agent</td><td>TrueSkill rank*</td></tr><tr><td>1</td><td>Bug + LSTM-meta</td><td>31.7</td></tr><tr><td>2</td><td>Ant+LSTM-meta</td><td>30.8</td></tr><tr><td>3</td><td>Bug +LSTM-track</td><td>29.1</td></tr><tr><td>4</td><td>Ant + RL²</td><td>28.6</td></tr><tr><td>5</td><td>Ant +LSTM</td><td>28.4</td></tr><tr><td>6</td><td>Bug + MLP-meta</td><td>23.4</td></tr><tr><td>7</td><td>Ant + MLP-meta</td><td>21.6</td></tr><tr><td>8</td><td>Spider +MLP-meta</td><td>20.5</td></tr><tr><td>9</td><td>Spider + MLP</td><td>19.0</td></tr><tr><td>10</td><td>Bug + MLP-track</td><td>18.9</td></tr></table>
|
| 534 |
+
|
| 535 |
+
\* The rank is a conservative estimate of the skill, $r = \mu - 3 \sigma$ , to ensure that the actual skill of the agent is higher with $9 9 \%$ confidence.
|
| 536 |
+
|
| 537 |
+

|
| 538 |
+
|
| 539 |
+
Since TrueSkill represents the belief about the skill of an agent as a normal distribution (i.e., with two parameters, $\mu$ and $\sigma$ ), we can use it to infer a priori probability of an agent, $a$ , winning against
|
| 540 |
+
|
| 541 |
+
its opponent, $o$ , as follows (Herbrich et al., 2007):
|
| 542 |
+
|
| 543 |
+
$$
|
| 544 |
+
P ( a { \mathrm { ~ w i n s ~ } } o ) = \Phi \left( { \frac { \mu _ { a } - \mu _ { o } } { \sqrt { 2 \beta ^ { 2 } + \sigma _ { a } ^ { 2 } + \sigma _ { o } ^ { 2 } } } } \right) , { \mathrm { ~ w h e r e ~ } } \Phi ( x ) : = { \frac { 1 } { 2 } } \left[ 1 + \operatorname { e r f } \left( { \frac { x } { \sqrt { 2 } } } \right) \right]
|
| 545 |
+
$$
|
| 546 |
+
|
| 547 |
+
The ranking of the top-5 agents with MLP and LSTM policies according to their TrueSkill is given in Tab. 1 and the a priori win rates in Fig. 10. Note that within the LSTM and MLP categories, the best meta-learners are 10 to $2 5 \%$ more likely to win the best agents that use other adaptation strategies.
|
| 548 |
+
|
| 549 |
+
# E.3 INTOLERANCE TO LARGE DISTRIBUTIONAL SHIFTS
|
| 550 |
+
|
| 551 |
+
Continuous adaptation via meta-learning assumes consistency in the changes of the environment or the opponent. What happens if the changes are drastic? Unfortunately, the training process of our meta-learning procedure turns out to be sensitive to such shifts and can diverge when the distributional shifts from iteration to iteration are large. Fig. 11 shows the training curves for a meta-learning agent with MLP policy trained against versions of an MLP opponent pre-trained via self-play. At each iteration, we kept updating the opponent policy by 1 to 10 steps. The meta-learned policy was able to achieve non-negative rewards by the end of training only when the opponent was changing up to 4 steps per iteration.
|
| 552 |
+
|
| 553 |
+

|
| 554 |
+
Fig. 11: Reward curves for a meta-learning agent trained against a learning opponent. Both agents were Ants with MLP policies. At each iteration, the opponent was updating its policy for a given number of steps using self-play, while the meta-learning agent attempted to learn to adapt to the distributional shifts. For each setting, the training process was repeated 15 times; shaded regions denote $90 \%$ confidence intervals.
|
md/train/Skeh1krtvH/Skeh1krtvH.md
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# WAVEFLOW: A COMPACT FLOW-BASED MODEL FOR RAW AUDIO
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In this work, we present WaveFlow, a small-footprint generative flow for raw audio, which is trained with maximum likelihood without density distillation and auxiliary losses as used in Parallel WaveNet. It provides a unified view of flowbased models for raw audio, including autoregressive flow (e.g., WaveNet) and bipartite flow (e.g., WaveGlow) as special cases. We systematically study these likelihood-based generative models for raw waveforms in terms of test likelihood and speech fidelity. We demonstrate that WaveFlow can synthesize high-fidelity speech and obtain comparable likelihood as WaveNet, while only requiring a few sequential steps to generate very long waveforms. In particular, our small-footprint WaveFlow has 5.91M parameters and can generate $2 2 . 0 5 \mathrm { k H z }$ high-fidelity speech $4 2 . 6 \times$ faster than real-time on a GPU without engineered inference kernels.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep generative models have obtained noticeable successes for modeling raw audio in high-fidelity speech synthesis and music generation (e.g., van den Oord et al., 2016; Dieleman et al., 2018). Autoregressive models are among the best performing generative models for raw audio waveforms, providing the highest likelihood scores and generating high quality samples (e.g., van den Oord et al., 2016; Kalchbrenner et al., 2018). One of the most successful examples is WaveNet (van den Oord et al., 2016), an autoregressive model for waveform synthesis. It operates at the high temporal resolution of raw audio (e.g., 24kHz) and sequentially generates waveform samples at inference. As a result, WaveNet is prohibitively slow for speech synthesis and one has to develop highly engineered kernels for real-time inference (Arık et al., 2017a; Pharris, 2018). 2
|
| 12 |
+
|
| 13 |
+
Flow-based models (Dinh et al., 2014; Rezende and Mohamed, 2015) are a family of generative models, in which a simple initial density is transformed into a complex one by applying a series of invertible transformations. One group of models are based on autoregressive transformation, including autoregressive flow (AF) and inverse autoregressive flow (IAF) as the “dual” of each other (Kingma et al., 2016; Papamakarios et al., 2017; Huang et al., 2018). AF is analogous to autoregressive models, which performs parallel density evaluation and sequential synthesis. In contrast, IAF performs parallel synthesis but sequential density evaluation, making likelihood-based training very slow. Parallel WaveNet (van den Oord et al., 2018) distills an IAF from a pretrained autoregressive WaveNet, which gets the best of both worlds. However, it requires the density distillation with Monte Carlo approximation and a set of auxiliary losses for good performance, which complicates the training pipeline and increases the cost of development. Instead, ClariNet (Ping et al., 2019) simplifies the density distillation by computing a regularized KL divergence in closed-form.
|
| 14 |
+
|
| 15 |
+
Another group of flow-based models are based on bipartite transformation (Dinh et al., 2017; Kingma and Dhariwal, 2018), which provide parallel density evaluation and parallel synthesis. Most recently, WaveGlow (Prenger et al., 2019) and FloWaveNet (Kim et al., 2019) successfully applies Glow (Kingma and Dhariwal, 2018) and RealNVP (Dinh et al., 2017) for waveform synthesis, respectively. However, the bipartite transformations are less expressive than the autoregressive transformations (see Section 2.3 for detailed discussion). In general, these bipartite flows require deeper layers, larger hidden size, and huge number of parameters to reach comparable capacities as autoregressive models. For example, WaveGlow and FloWaveNet have 87.88M and 182.64M parameters with 96 layers and 256 residual channels, respectively. In contrast, a 30-layer WaveNet has only 4.57M parameters with 128 residual channels.
|
| 16 |
+
|
| 17 |
+
In this work, we present WaveFlow, a compact flow-based model for raw audio. Specifically, we make the following contributions:
|
| 18 |
+
|
| 19 |
+
1. WaveFlow is trained with maximum likelihood without density distillation and auxiliary losses used in Parallel WaveNet (van den Oord et al., 2018) and ClariNet (Ping et al., 2019), which simplifies the training pipeline and reduces the cost of development.
|
| 20 |
+
2. WaveFlow squeezes the 1-D raw waveforms into a 2-D matrix and produces the whole audio within a fixed sequential steps. It also provides a unified view of flow-based models for raw audio and allows us to explicitly trade inference efficiency for model capacity. We implement WaveFlow with a dilated 2-D convolutional architecture (Yu and Koltun, 2015), and it includes both Gaussian WaveNet (Ping et al., 2019) and WaveGlow (Prenger et al.,
|
| 21 |
+
2019) as special cases.
|
| 22 |
+
3. We systematically study the likelihood-based generative models for raw audios in terms of test likelihood and speech quality. We demonstrate that WaveFlow can obtain comparable likelihood and synthesize high-fidelity speech as WaveNet (van den Oord et al., 2016), while only requiring a few sequential steps to generate very long waveforms.
|
| 23 |
+
4. Our small-footprint WaveFlow has only 5.91M parameters and synthesizes $2 2 . 0 5 \mathrm { k H z }$ highfidelity speech (MOS: 4.32) more than $4 0 \times$ faster than real-time on a Nvidia V100 GPU. In contrast, WaveGlow (Prenger et al., 2019) requires 87.8M parameters for generating high-fidelity speech. The small memory footprint is preferred in production TTS systems, especially for on-device deployment.
|
| 24 |
+
|
| 25 |
+
We organize the rest of the paper as follows. Section 2 reviews the flow-based models with autoregressive and bipartite transformations. We present WaveFlow in Section 3 and discuss related work in Section 4. We report experimental results in Section 5 and conclude the paper in Section 6.
|
| 26 |
+
|
| 27 |
+
# 2 FLOW-BASED GENERATIVE MODELS
|
| 28 |
+
|
| 29 |
+
Flow-based models (Dinh et al., 2014; 2017; Rezende and Mohamed, 2015) transform a simple density of latent variables $p ( z )$ (e.g., isotropic Gaussian) into a complex data distribution $p ( { \pmb x } )$ by applying a bijection $\begin{array} { r } { \mathbf { \boldsymbol { x } } = f ( \boldsymbol { z } ) } \end{array}$ , where $_ { \textbf { \em x } }$ and $_ z$ are both $n$ -dimensional. The probability density of $_ { \textbf { \em x } }$ can be obtained through the change of variables formula:
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
p ( \pmb { x } ) = p ( z ) \left| \operatorname* { d e t } \left( \frac { \partial f ^ { - 1 } ( \pmb { x } ) } { \partial \pmb { x } } \right) \right| ,
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
where $z = f ^ { - 1 } ( { \pmb x } )$ is the inverse transformation, and det $\big ( \frac { \partial { f ^ { - 1 } ( { \pmb x } ) } } { \partial { \pmb x } } \big )$ is the determinant of its Jacobian. In general, it takes $O ( n ^ { 3 } )$ to compute the determinant, which is not scalable to high-dimensional data. There are two notable groups of flow-based models with triangular Jacobians and tractable determinants. They are based on autoregressive and bipartite transformations, respectively.
|
| 36 |
+
|
| 37 |
+
# 2.1 AUTOREGRESSIVE TRANSFORMATION
|
| 38 |
+
|
| 39 |
+
The autoregressive flow (AF) and inverse autoregressive flow (IAF) (Kingma et al., 2016; Papamakarios et al., 2017) use autoregressive transformations. Specifically, AF defines the inverse transformation ${ \pmb z } = f ^ { - 1 } ( { \pmb x } ; \vartheta )$ as:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
z _ { t } = x _ { t } \cdot \sigma _ { t } ( x _ { < t } ; \pmb { \vartheta } ) + \mu _ { t } ( x _ { < t } ; \pmb { \vartheta } ) ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where the shifting variables $\mu _ { t } ( \boldsymbol { x } _ { < t } ; \boldsymbol { \vartheta } )$ and scaling variables $\sigma _ { t } ( x _ { < t } ; \vartheta )$ are modeled by an autoregressive architecture parameterized by $\vartheta$ (e.g., WaveNet). Note that, the $t$ -th variable $z _ { t }$ only depends on , thus the Jacobian is a triangular matrix as illustrated in Figure 1(a) and its determinant is the product of the diagonal entries: $\begin{array} { r } { \operatorname* { d e t } \left( \frac { \partial f ^ { - 1 } ( \pmb { x } ) } { \partial \pmb { x } } \right) = \prod _ { t } \sigma _ { t } ( \pmb { x } _ { < t } ; \pmb { \vartheta } ) } \end{array}$ . The density $p ( { \pmb x } )$ can be easily evaluated by change of variables formula, because $z = f ^ { - 1 } ( { \pmb x } )$ can be computed in parallel from Eq. (2) (i.e., the required $O ( n )$ operations can be done in $O ( 1 )$ time on modern GPU hardware). However, AF has to do sequential synthesis, because the forward transformation $\begin{array} { r } { { \bf x } = f ( z ) } \end{array}$ is autoregressive: xt = zt−µt(x<t;ϑ)σ (x ;ϑ) . In contrast, IAF uses an autoregressive transformation for $z = f ^ { - 1 } ( { \pmb x } )$ :
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 1: The Jacobian ∂f−1(x)∂x of (a) an autoregressive transformation, and (b) a bipartite transformation. The blank cells are 0s and represent the independent relations between $z _ { i }$ and $x _ { j }$ . The light-blue cells are scaling variables and represent the linear dependencies between $z _ { i }$ and $x _ { i }$ . The dark-blue cells represent complex non-linear dependencies defined by neural networks.
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
z _ { t } = \frac { x _ { t } - \mu _ { t } ( z _ { < t } ; \vartheta ) } { \sigma _ { t } ( z _ { < t } ; \vartheta ) } ,
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
making density evaluation impractically slow for training, but it can do parallel synthesis by $x _ { t } =$ $z _ { t } \cdot \sigma _ { t } ( z _ { < t } ; \vartheta ) + \mu _ { t } ( z _ { < t } ; \vartheta )$ . Parallel WaveNet (van den Oord et al., 2018) and ClariNet (Ping et al., 2019) are based on IAF, which lacks efficient density evaluation and relies on distillation from a pretrained autoregressive WaveNet.
|
| 55 |
+
|
| 56 |
+
# 2.2 BIPARTITE TRANSFORMATION
|
| 57 |
+
|
| 58 |
+
RealNVP (Dinh et al., 2017) and Glow (Kingma and Dhariwal, 2018) use bipartite transformation by partitioning the data $_ { \textbf { \em x } }$ into two groups $\scriptstyle { \mathbf { \mathcal { x } } } _ { a }$ and $\scriptstyle { \mathbf { { \mathit { x } } } } _ { b }$ , where the indices sets $a \cup b = \{ 1 , \cdots , n \}$ and $a \cap b = \phi$ . Then, the inverse transformation $z = f ^ { - 1 } ( x , \theta )$ is defined as:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
z _ { a } = x _ { a } , \quad z _ { b } = x _ { b } \cdot \sigma _ { b } ( x _ { a } ; \pmb \theta ) + \mu _ { b } ( x _ { a } ; \pmb \theta ) .
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where the shifting variables $\mu _ { b } ( x _ { a } ; \pmb \theta )$ and scaling variables $\sigma _ { b } ( x _ { a } ; \theta )$ are modeled by a feed-forward neural network. The Jacobian ∂f−1(x)∂x is a special triangular matrix as illustrated in Figure 1 (b). By definition, the forward transformation $\pmb { x } = f ( \pmb { z } , \pmb { \theta } )$ is,
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
x _ { a } = z _ { a } , \quad x _ { b } = \frac { z _ { b } - \mu _ { b } ( x _ { a } ; \pmb \theta ) } { \sigma _ { b } ( x _ { a } ; \pmb \theta ) } ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
and can also be done in parallel. As a result, the bipartite transformation provides both parallel density evaluation and parallel synthesis. In previous work, WaveGlow (Prenger et al., 2019) and FloWaveNet (Kim et al., 2019) both squeeze the adjacent audio samples on the channel dimension, and apply the bipartite transformation on the partitioned channel dimension.
|
| 71 |
+
|
| 72 |
+
# 2.3 CONNECTIONS
|
| 73 |
+
|
| 74 |
+
It is worthwhile to mention that the autoregressive transformation is more expressive than bipartite transformation in general. As illustrated in Figure 1(a) and (b), the autoregressive transformation introduces $\frac { n \times ( n - 1 ) } { 2 }$ complex non-linear dependencies (dark-blue cells) and $n$ linear dependencies between data $_ { \textbf { \em x } }$ and latents $_ z$ . In contrast, bipartite transformation introduces only $\frac { n ^ { 2 } } { 4 }$ non-linear dependencies and $\frac { n } { 2 }$ linear dependencies. Indeed, one can reduce an autoregressive transformation ${ \pmb z } = f ^ { - 1 } ( { \pmb x } ; \vartheta )$ to a bipartite transformation ${ z = f ^ { - 1 } ( x ; \theta ) }$ by: (i) picking an autoregressive order $^ o$ such that all of the indices in set $a$ rank early than the indices in $b$ , and (ii) setting the shifting and scaling variables as,
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\mu _ { t } ( \boldsymbol { x } _ { < t } ; \vartheta ) = \left\{ \begin{array} { l l } { 0 } & { \mathrm { f o r ~ } t \in a } \\ { \mu _ { t } ( \boldsymbol { x } _ { a } ; \theta ) } & { \mathrm { f o r ~ } t \in b } \end{array} \right. , \quad \sigma _ { t } ( \boldsymbol { x } _ { < t } ; \vartheta ) = \left\{ \begin{array} { l l } { 1 } & { \mathrm { f o r ~ } t \in a } \\ { \sigma _ { t } ( \boldsymbol { x } _ { a } ; \theta ) } & { \mathrm { f o r ~ } t \in b } \end{array} \right. .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Given the less expressive building block, the bipartite transformation-based flows generally require many more layers and larger hidden size to match the capacity of a compact autoregressive models (e.g., as measured by test likelihood) (Kingma and Dhariwal, 2018; Prenger et al., 2019).
|
| 81 |
+
|
| 82 |
+
# 3 WAVEFLOW
|
| 83 |
+
|
| 84 |
+
In this section, we present WaveFlow and its implementation with dilated 2-D convolutions.
|
| 85 |
+
|
| 86 |
+
# 3.1 DEFINITION
|
| 87 |
+
|
| 88 |
+
We denote the high dimensional 1-D waveform as $\pmb { x } = \{ x _ { 1 } , \cdots , x _ { n } \}$ . We first squeeze $_ { \textbf { \em x } }$ into a $h$ -row 2-D matrix $\mathbf { \bar { \boldsymbol { X } } } \in \mathbb { R } ^ { h \times w }$ by column-major order, where $\begin{array} { r } { w = { \frac { n } { h } } } \end{array}$ and adjacent samples are in the same column. We assume $\boldsymbol { Z } \in \mathbb { R } ^ { h \times w }$ are sampled from an isotropic Gaussian, and define the inverse transformation $Z = f ^ { - 1 } ( X ; \Theta )$ as,
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
Z _ { i , j } = \sigma _ { i , j } ( X _ { < i , \bullet } ; \Theta ) \cdot X _ { i , j } + \mu _ { i , j } ( X _ { < i , \bullet } ; \Theta ) ,
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $X _ { < i , \bullet }$ represents all elements above $i$ -th row (see Figure 2 for an illustration). Note that, i) the receptive fields over the squeezed inputs $X$ for computing $Z _ { i , j }$ in WaveFlow is strictly larger than that of WaveGlow when $h > 2$ . ii) WaveNet is equivalent to an autoregressive flow with column-major order on the squeezed inputs $X$ . iii) Both WaveFlow and WaveGlow look at future waveform samples in original $_ { \textbf { \em x } }$ for computing $Z _ { i , j }$ , whereas WaveNet can not. iv) The autoregressive flow with row-major order has larger receptive fields than WaveFlow and WaveGlow.
|
| 95 |
+
|
| 96 |
+
The shifting variables $\mu _ { i , j } ( X _ { < i , \bullet } ; \Theta )$ and scaling variables $\sigma _ { i , j } ( X _ { < i , \bullet } ; \Theta )$ in Eq. (6) are modeled by a 2-D convolutional neural network detailed in Section 3.2. By definition, the variable $Z _ { i , j }$ only depends on the current $X _ { i , j }$ and previous $X _ { < i , \bullet }$ in raw-major order, thus the Jacobian is a triangular matrix and its determinant is:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\operatorname* { d e t } \left( \frac { \partial f ^ { - 1 } ( X ) } { \partial X } \right) = \prod _ { i = 1 } ^ { h } \prod _ { j = 1 } ^ { w } \sigma _ { i , j } ( X _ { < i , \bullet } ; \Theta ) .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
As a result, the log-likelihood can be calculated in parallel by change of variable formula in Eq. (1),
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\log p ( \boldsymbol { X } ) = - \sum _ { i = 1 } ^ { h } \sum _ { j = 1 } ^ { w } \left( Z _ { i , j } ^ { 2 } + \frac { 1 } { 2 } \log ( 2 \pi ) \right) + \sum _ { i = 1 } ^ { h } \sum _ { j = 1 } ^ { w } \log \sigma _ { i , j } ( X _ { < i , \bullet } ; \Theta ) ,
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
and one can do maximum likelihood training efficiently. At synthesis, one may first sample $Z$ from the isotropic Gaussian and apply the forward transformation $X = f ( Z ; \Theta )$ :
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
X _ { i , j } = \frac { Z _ { i , j } - \mu _ { i , j } ( X _ { < i , \bullet } ; \Theta ) } { \sigma _ { i , j } ( X _ { < i , \bullet } ; \Theta ) } ,
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
which is only autoregressive on height dimension. Thus, it requires $h$ sequential steps to generate the whole waveform $X$ . In practice, a small $h$ (e.g., 8 or 16) works well, thus we can generate very long waveforms within a few sequential steps.
|
| 115 |
+
|
| 116 |
+
# 3.2 IMPLEMENTATION WITH DILATED 2-D CONVOLUTIONS
|
| 117 |
+
|
| 118 |
+
In this work, we implement WaveFlow with a dilated 2-D convolutional architecture. Specifically, we use a stack of 2-D convolution layers (e.g., 8 layers in all experiments) to model the shifting variables $\mu _ { i , j } ( X _ { < i , \bullet } ; \Theta )$ and scaling variables $\sigma _ { i , j } ( X _ { < i , \bullet } ; \Theta )$ in Eq. (6). We use the similar architecture as
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 2: The receptive fields over the squeezed inputs $X$ for computing $Z _ { i , j }$ in (a) WaveFlow, (b) WaveGlow, (c) autoregressive flow with column-major order (e.g., WaveNet), and (d) autoregressive flow with row-major order.
|
| 122 |
+
|
| 123 |
+
Table 1: The test log-likelihoods (LLs) of WaveFlow with different dilation cycles on the height dimension. Both models are stacked with 8 flows and each flow has 8 convolutional layers.
|
| 124 |
+
|
| 125 |
+
<table><tr><td>Model</td><td>res.channels</td><td>dilations d</td><td>receptive field r</td><td>test LLs</td></tr><tr><td>WaveFlow (h = 32)</td><td>128</td><td>1,1,1,1,1,1,1,1</td><td>17</td><td>4.960</td></tr><tr><td>WaveFlow (h = 32)</td><td>128</td><td>1,2,4,1,2,4,1,2</td><td>35</td><td>5.055</td></tr></table>
|
| 126 |
+
|
| 127 |
+
Table 2: The heights and corresponding dilations used in our experiments. Note that, the receptive fields are only slightly larger than height $h$ .
|
| 128 |
+
|
| 129 |
+
<table><tr><td>Height h</td><td>filter size k</td><td>dilations d</td><td>receptive field r</td></tr><tr><td>8</td><td>3</td><td>1,1,1,1,1,1,1,1</td><td>17</td></tr><tr><td>16</td><td>3</td><td>1,1,1,1,1,1,1,1</td><td>17</td></tr><tr><td>32</td><td>3</td><td>1,2,4,1,2,4,1,2</td><td>35</td></tr><tr><td>64</td><td>3</td><td>1,2,4,8,16,1,2,4</td><td>77</td></tr></table>
|
| 130 |
+
|
| 131 |
+
WaveNet (van den Oord et al., 2016) by replacing the dilated 1-D convolution to 2-D convolution (Yu and Koltun, 2015), while still keeping the gated-tanh nonlinearities, residual connections and skip connections.
|
| 132 |
+
|
| 133 |
+
We set the filter sizes as 3 for both height and width dimensions. We use non-causal convolutions on width dimension and set the dilation cycle as $[ 1 , 2 , 4 , \cdots , 2 ^ { 7 } ]$ . The convolutions on height dimension are causal with an autoregressive constraint, and their dilation cycle needs to be designed carefully. In practice, we find the following rules of thumb are important to obtain good results:
|
| 134 |
+
|
| 135 |
+
• As motivated by the dilation cycle of WaveNet (van den Oord et al., 2016), the dilations of 8 layers should be set as $\pmb { d } = [ 1 , 2 , \cdots , 2 ^ { s } , 1 , 2 , \cdots , 2 ^ { s } , \cdots ] ,$ , where $s \leq 7$ . 3 • The receptive field $r$ over the height dimension should be larger than the squeezed height $h$ Otherwise, it explicitly introduces unnecessary conditional independence and leads to lower likelihood (see Table 1 for an example). Note that, the receptive field of a stack of dilated convolutional layers is: $r = ( k { - } 1 ) { \times } \textstyle \sum _ { i } d _ { i } { + } 1$ , where $k$ is the filter size and $d _ { i }$ is the dilation at $i$ -th layer. Thus, the sum of dilations should satisfy: $\textstyle \sum _ { i } d _ { i } \geq { \frac { h - 1 } { k - 1 } }$ . However, when $h$ is larger than or equal to $2 ^ { 8 } = 5 1 2$ , we simply set the dilation cycle as $[ 1 , 2 , 4 , \cdots , 2 ^ { 7 } ]$ . When the receptive field $r$ has already been larger than $h$ , we find that convolutions with smaller dilation and fewer holes provide larger likelihood.
|
| 136 |
+
|
| 137 |
+
We summarize the heights and preferred dilations in our experiments in Table 2. Note that, WaveFlow becomes fully autoregressive when we squeeze $_ { \textbf { \em x } }$ by its length (i.e. $h = n$ ) and set its filter size as 1 over the width dimension, which is equivalent to a Gaussian WaveNet learned by MLE (Ping et al., 2019). If we squeeze $_ { \textbf { \em x } }$ by $h = 2$ and set the filter size as 1 on the height dimension, WaveFlow becomes a bipartite flow and is equivalent to WaveGlow with squeezed channels 2.
|
| 138 |
+
|
| 139 |
+
# 3.3 CONDITIONAL GENERATION
|
| 140 |
+
|
| 141 |
+
In neural speech synthesis, a neural vocoder (e.g., WaveNet) synthesizes the time-domain waveforms. It can be conditioned on linguistic features (van den Oord et al., 2016; Arık et al., 2017a), the mel-spectrograms from a text-to-spectrogram model (Ping et al., 2018; Shen et al., 2018), or the learned hidden representation within a text-to-wave architecture (Ping et al., 2019). In this work, we test WaveFlow by conditioning it on ground truth mel-spectrograms as in previous work (Prenger et al., 2019; Kim et al., 2019). The mel-spectrogram is upsampled to the same resolution as waveform samples by transposed 2-D convolutions (Ping et al., 2019). To aligned with the squeezed waveform, they are squeezed to the shape $c \times h \times w$ , where $c$ is the feature dimension (e.g, bands of the spectrogram). After a $1 \times 1$ convolution mapping the features to residual channels, they are added as the bias term at each layer (van den Oord et al., 2016).
|
| 142 |
+
|
| 143 |
+
Table 3: The test LLs of WaveFlow with different permutation strategies. All models consist of 8 flows and each flow has 8 convolutional layers with filter sizes 3.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Model</td><td>res.channels</td><td>permutation strategy</td><td>test LLs</td></tr><tr><td>WaveFlow (h = 16)</td><td>64</td><td>none</td><td>4.551</td></tr><tr><td>WaveFlow (h=1 16)</td><td>64</td><td>(i) 8 reverse</td><td>4.954</td></tr><tr><td>WaveFlow (h = 16)</td><td>64</td><td>(ii) 4 reverse +4 split & reverse</td><td>4.971</td></tr></table>
|
| 146 |
+
|
| 147 |
+
# 3.4 STACKING MULTIPLE FLOWS WITH PERMUTATIONS OVER HEIGHT DIMENSION
|
| 148 |
+
|
| 149 |
+
Flow-based models require a series of transformations until the distribution $p ( X )$ reaches a desired level of complexity (e.g., Rezende and Mohamed, 2015). We let $X = Z ^ { ( n ) }$ and repeatedly apply the transformation $Z ^ { ( i - 1 ) } = f ^ { - 1 } ( Z ^ { ( i ) } ; \Theta ^ { ( i ) } )$ defined in Eq. (6) from $Z ^ { ( n ) } \to \dots Z ^ { ( \bar { i } ) } \to \dots \bar { Z } ^ { ( \bar { 0 } ) }$ . We assume $Z ^ { ( 0 ) }$ is from the isotropic Gaussian distribution. The likelihood $p ( X )$ can be evaluated by iteratively applying the chain rule:
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
p ( X ) = p ( Z ^ { ( 0 ) } ) \prod _ { i = 1 } ^ { n } \left. \operatorname* { d e t } \left( \frac { \partial f ^ { - 1 } ( Z ^ { ( i ) } ; \Theta ^ { ( i ) } ) } { \partial Z ^ { ( i ) } } \right) \right. .
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
We find that permuting each $Z ^ { ( i ) }$ over the height dimension after each transformation can significantly improve the likelihood scores. In particular, we test two permutation strategies for WaveFlow models stacked with 8 flows (i.e., $X = Z ^ { ( 8 ) }$ ) in Table 3: (i) we reverse each $Z ^ { ( i ) }$ over the height dimension after each transformation, and (ii) we reverse $Z ^ { ( 7 ) } , Z ^ { ( 6 ) } , Z ^ { ( 5 ) } , Z ^ { ( 4 ) }$ over the height dimension as before, but split $Z ^ { ( 3 ) } , Z ^ { ( 2 ) } , Z ^ { ( 1 ) } , Z ^ { ( 0 ) }$ in the middle of the height dimension then reverse each part respectively. 4 Note that, one also needs to permute the conditioner on the height dimension accordingly, which is aligned with $Z ^ { ( i ) }$ . From Table 3, both (i) and (ii) significantly outperform the model without permutations mainly because of bidirectional modeling. Strategy (ii) outperforms (i) because of its diverse autoregressive orders.
|
| 156 |
+
|
| 157 |
+
# 4 RELATED WORK
|
| 158 |
+
|
| 159 |
+
Deep neural networks for speech synthesis (a.k.a. text-to-speech) have received a lot of attention. Over the past few years, several neural text-to-speech (TTS) systems have been introduced, including WaveNet (van den Oord et al., 2016), Deep Voice (Arık et al., 2017a), Deep Voice 2 (Arık et al., 2017b), Deep Voice 3 (Ping et al., 2018), Tacotron (Wang et al., 2017), Tacotron 2 (Shen et al., 2018), Char2Wav (Sotelo et al., 2017), VoiceLoop (Taigman et al., 2018), WaveRNN (Kalchbrenner et al., 2018), ClariNet (Ping et al., 2019), Transformer TTS (Li et al., 2019), ParaNet (Peng et al., 2019) and FastSpeech (Ren et al., 2019).
|
| 160 |
+
|
| 161 |
+
Neural vocoders, such as WaveNet, play the most important role in recent advances of speech synthesis. In previous work, the state-of-the-art neural vocoders are autoregressive models (van den Oord et al., 2016; Mehri et al., 2017; Kalchbrenner et al., 2018). Several engineering endeavors have been advocated for speeding up their sequential generation process (Arık et al., 2017a; Kalchbrenner et al., 2018). In particular, Subscale WaveRNN (Kalchbrenner et al., 2018) folds a long waveform sequence ${ \pmb x } _ { 1 : n }$ into a batch of shorter sequences and can produces up to 16 samples per step, thus it requires at least $\frac { n } { 1 6 }$ steps to generate the whole audio. Note that, this is different from the proposed WaveFlow, which can generate ${ \pmb x } _ { 1 : n }$ within a fixed number of steps (e.g., 16). Most recently, flowbased models have been successfully applied for parallel waveform synthesis with comparable fidelity as autoregressive models (van den Oord et al., 2018; Ping et al., 2019; Prenger et al., 2019; Kim et al., 2019; Yamamoto et al., 2019; Serrà et al., 2019). Among these models, WaveGlow (Prenger et al., 2019) and FloWaveNet (Kim et al., 2019) have a simple training pipeline as they solely use the maximum likelihood objective. However, both of them are less expressive than autoregressive models as indicated by their lower likelihood scores.
|
| 162 |
+
|
| 163 |
+
Flow-based models can either represent the approximate posteriors for variational inference (Rezende and Mohamed, 2015; Kingma et al., 2016; Berg et al., 2018), or can be trained directly on data using the change of variables formula (Dinh et al., 2014; 2017; Kingma and Dhariwal, 2018; Grathwohl et al., 2018). In previous work, Glow (Kingma and Dhariwal, 2018) extends RealNVP (Dinh et al., 2017) with invertible $1 \times 1$ convolution, and can generate high quality images. Later on, Hoogeboom et al. (2019) generalizes the $1 \times 1$ convolution to invertible $d \times d$ convolutions which operate both channel and spatial axes.
|
| 164 |
+
|
| 165 |
+
# 5 EXPERIMENT
|
| 166 |
+
|
| 167 |
+
In this section, we compare likelihood-based generative models for raw audio in term of test likelihood, speech quality and synthesis speed.
|
| 168 |
+
|
| 169 |
+
Data: We use the LJ speech dataset (Ito, 2017) containing about 24 hours of audio with a sampling rate of $2 2 . 0 5 \mathrm { k H z }$ recorded on a MacBook Pro in a home enviroment. It consists of 13, 100 audio clips of a single female speaker reading passages from 7 non-fiction books.
|
| 170 |
+
|
| 171 |
+
Models: We evaluate several likelihood-based generative models, including Gaussian WaveNet, WaveGlow, WaveFlow and autoregressive flow (AF). As in Section 3.2, we implement autoregressive flow from WaveFlow by squeezing the waveforms by its length and setting the filter size as 1 for width dimension. Both WaveNet and AF have 30 layers with dilation cycle $[ 1 , 2 , \cdots , 5 1 2 ]$ and filter size 3. For WaveGlow and WaveFlow, we investigate different setups, including the number of flows, size of residual channels, and squeezed height $h$ .
|
| 172 |
+
|
| 173 |
+
Conditioner: We use the 80-band mel-spectrogram of the original audio as the conditioner for WaveNet, WaveGlow, and WaveFlow. We use FFT size 1024, hop size 256, and window size 1024. For WaveNet and WaveFlow, we upsample the mel conditioner 256 times by applying two layers of transposed 2-D convolution (in time and frequency) interleaved with leaky ReLU $( \alpha = 0 . 4 )$ ). The upsampling strides in time are 16 and the 2-D convolution filter sizes are [32, 3] for both layers. For WaveGlow, we directly use the open source implementation. 5
|
| 174 |
+
|
| 175 |
+
Training: We train all models on 8 Nvidia 1080Ti GPUs using randomly chosen short clips of 16, 000 samples from each utterance. For WaveFlow and WaveNet, we use the Adam optimizer (Kingma and Ba, 2015) with a batch size of 8 and a constant learning rate of $2 \times 1 0 ^ { - 4 }$ . For WaveGlow, we use the Adam optimizer with a batch size of 16 and a learning rate of $1 \times 1 0 ^ { - 4 }$ . We applied weight normalization (Salimans and Kingma, 2016) whenever possible.
|
| 176 |
+
|
| 177 |
+
# 5.1 LIKELIHOOD
|
| 178 |
+
|
| 179 |
+
The test log-likelihoods (LLs) of all models are evaluate at 1M training steps. Note that, i) all of the LLs decrease slowly after 1M steps and ii) it took one month to train the largest WaveGlow (residual channels $= 5 1 2$ ) for 1M steps. Thus, we chose 1M as the cut-off to compare these models. We summarize the results in Table 4 with models from row (a) to (t). We draw the following observations:
|
| 180 |
+
|
| 181 |
+
• Stacking a large number of flows improves LLs for WaveFlow, autoregressive flow, and WaveGlow. For example, (m) WaveFlow with 8 flows provide larger LL than (l) WaveFlow with 6 flows. The $( b )$ autoregressive flow obtains the highest likelihood and even outperforms (a) WaveNet with the same amount of parameters. Indeed, AF provides bidirectional modeling by stacking 3 flows interleaved with reverse operations. WaveFlow has much larger likelihood than WaveGlow with comparable number of parameters. In particular, a small-footprint $( k )$ WaveFlow has only 5.91M parameters but can provide comparable likelihood (5.023 vs. 5.026) as the largest (g) WaveGlow with 268.29M parameters.
|
| 182 |
+
|
| 183 |
+
Table 4: The test log-likelihoods (LLs) of all models conditioned on mel-spectrograms. For $a \times b = c$ in the flows $\times$ layers column, $a$ is number of flows, $b$ is number of layers in each flow, and $c$ is the total number of layers. In WaveFlow, $h$ is the squeezed height. Models with bolded test LLs are mentioned in the text.
|
| 184 |
+
|
| 185 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>flows×layers</td><td rowspan=1 colspan=1>res.channels</td><td rowspan=1 colspan=1># param</td><td rowspan=1 colspan=1>test LLs</td></tr><tr><td rowspan=1 colspan=1>(a)</td><td rowspan=1 colspan=1>WaveNet</td><td rowspan=1 colspan=1>1×30=30</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>4.57 M</td><td rowspan=1 colspan=1>5.059</td></tr><tr><td rowspan=2 colspan=1>(b)C</td><td rowspan=2 colspan=1>Autoregressive flowWaveGlow</td><td rowspan=1 colspan=1>3×10=30</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>4.54M</td><td rowspan=1 colspan=1>5.161</td></tr><tr><td rowspan=1 colspan=1>12×8=96</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>17.59 M</td><td rowspan=1 colspan=1>4.804</td></tr><tr><td rowspan=5 colspan=1>de</td><td rowspan=2 colspan=1>WaveGlowWaveGlow</td><td rowspan=1 colspan=1>12×8=96</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>34.83M</td><td rowspan=1 colspan=1>4.927</td></tr><tr><td rowspan=1 colspan=1>6×8=48</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>47.22M</td><td rowspan=1 colspan=1>4.922</td></tr><tr><td rowspan=2 colspan=1>WaveGlowWaveGlow</td><td rowspan=1 colspan=1>12×8=96</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>87.88 M</td><td rowspan=1 colspan=1>5.018</td></tr><tr><td rowspan=1 colspan=1>12×8=96</td><td rowspan=1 colspan=1>512</td><td rowspan=1 colspan=1>268.29 M</td><td rowspan=1 colspan=1>5.026</td></tr><tr><td rowspan=1 colspan=1>WaveFlow (h = 8)</td><td rowspan=1 colspan=1>8×8=64</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>5.91 M</td><td rowspan=1 colspan=1>4.935</td></tr><tr><td rowspan=1 colspan=1>(i)</td><td rowspan=1 colspan=1>WaveFlow (h = 16)</td><td rowspan=1 colspan=1>8×8=64</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>5.91M</td><td rowspan=1 colspan=1>4.954</td></tr><tr><td rowspan=11 colspan=1>09r(s(t)</td><td rowspan=1 colspan=1>WaveFlow (h = 32)</td><td rowspan=1 colspan=1>8×8=64</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>5.91 M</td><td rowspan=1 colspan=1>5.002</td></tr><tr><td rowspan=1 colspan=1>WaveFlow (h = 64)</td><td rowspan=1 colspan=1>8×8=64</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>5.91 M</td><td rowspan=1 colspan=1>5.023</td></tr><tr><td rowspan=1 colspan=1>WaveFlow (h = 8)</td><td rowspan=1 colspan=1>6×8=48</td><td rowspan=1 colspan=1>96</td><td rowspan=1 colspan=1>9.58 M</td><td rowspan=1 colspan=1>4.946</td></tr><tr><td rowspan=1 colspan=1>WaveFlow (h = 8)</td><td rowspan=1 colspan=1>8×8=64</td><td rowspan=1 colspan=1>96</td><td rowspan=1 colspan=1>12.78 M</td><td rowspan=1 colspan=1>4.977</td></tr><tr><td rowspan=1 colspan=1>WaveFlow (h = 16)</td><td rowspan=1 colspan=1>8×8=64</td><td rowspan=1 colspan=1>96</td><td rowspan=1 colspan=1>12.78M</td><td rowspan=1 colspan=1>5.007</td></tr><tr><td rowspan=1 colspan=1>WaveFlow (h = 16)</td><td rowspan=1 colspan=1>6×8=48</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>16.69 M</td><td rowspan=1 colspan=1>4.990</td></tr><tr><td rowspan=1 colspan=1>WaveFlow (h = 8)</td><td rowspan=1 colspan=1>8×8=64</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>22.25M</td><td rowspan=1 colspan=1>5.009</td></tr><tr><td rowspan=1 colspan=1>WaveFlow (h = 16)</td><td rowspan=1 colspan=1>8×8=64</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>22.25 M</td><td rowspan=2 colspan=1>5.0285.055</td></tr><tr><td rowspan=1 colspan=1>WaveFlow (h = 32)</td><td rowspan=1 colspan=1>8×8=64</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>22.25 M</td></tr><tr><td rowspan=1 colspan=1>WaveFlow (h = 16)</td><td rowspan=1 colspan=1>6×8=48</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>64.64M</td><td rowspan=2 colspan=1>5.0645.101</td></tr><tr><td rowspan=1 colspan=1>WaveFlow (h = 16)</td><td rowspan=1 colspan=1>8×8=64</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>86.18 M</td></tr></table>
|
| 186 |
+
|
| 187 |
+
• As we increase $h$ , the likelihood of WaveFlow steadily increases (can be seen from $( h ) – ( k ) )$ , and its inference is getting slower with more sequential steps. In the limit, it is equivalent to an autoregressive flow. It illustrates the trade-off between model capacity and inference efficiency.
|
| 188 |
+
|
| 189 |
+
• $( r )$ WaveFlow with 128 residual channels can obtain comparable likelihood (5.055 vs 5.059) as $( a )$ WaveNet with 128 residual channels. A larger (t) WaveFlow with 256 residual channels can obtain even larger likelihood than WaveNet (5.101 vs 5.059).
|
| 190 |
+
|
| 191 |
+
# 5.2 SPEECH FIDELITY AND SYNTHESIS SPEED
|
| 192 |
+
|
| 193 |
+
We train WaveNet for 1M steps. We train WaveGlow and WaveFlow for 2M steps with small residual channels (64, 96 and 128). We train larger models (res. channels 256 and 512) for 1M steps due to the practical time constraint. At synthesis, we sampled $Z$ from an isotropic Gaussian with standard deviation 1.0 and 0.6 (default) for WaveFlow and WaveGlow, respectively. For WaveFlow and WaveGlow, we run synthesis under NVIDIA Apex with 16-bit floating point (FP16) arithmetic, which does not introduce any degradation of audio fidelity and brings about $2 \times$ speedup. We use the crowdMOS tookit (Ribeiro et al., 2011) for naturalness evaluation, where test utterances from these models were presented to workers on Mechanical Turk. We also test the synthesis speed on a Nvidia V100 GPU without using any customized inference kernels. We only implement convolution queues (Paine et al., 2016) in Python to cache the intermediate hidden states within WaveFlow for autoregressive inference over the height dimension, which brings about $4 \times$ speedup. We use the permutation strategy (ii) described in Section 3.4 for WaveFlow.
|
| 194 |
+
|
| 195 |
+
We report the 5-scale Mean Opinion Score (MOS), synthesis speed and model footprint in Table 5. We draw the following observations:
|
| 196 |
+
|
| 197 |
+
• The small WaveFlow (res. channels 64) has 5.91M parameters and can synthesize 22.05 kHz high-fidelity speech (MOS: 4.32) $4 2 . 6 0 \times$ faster than real-time. In contrast, the speech quality of small WaveGlow (res. channels 64) is significantly worse (MOS: 2.17). Indeed, WaveGlow (res. channels 256) requires $8 7 . 8 8 \mathrm { M }$ parameters for generating high-fidelity speech. • The large WaveFlow (res. channels 256) outperforms the same size WaveGlow in terms of speech fidelity (MOS: 4.43 vs. 4.34). It also matches the state-of-the-art WaveNet while generating speech $8 . 4 2 \times$ faster than real-time, because it only requires 128 sequential steps (number of flows $\times$ height $h$ ) to synthesize very long waveforms.
|
| 198 |
+
|
| 199 |
+
Table 5: The synthesis speed over real-time and the 5-scale Mean Opinion Score (MOS) ratings with $9 5 \%$ confidence intervals. We use 30-layer WaveNet, 96-layer WaveGlow, and 64-layer WaveFlow. Models with bolded numbers are mentioned in the text.
|
| 200 |
+
|
| 201 |
+
<table><tr><td rowspan=1 colspan=2>Model</td><td rowspan=1 colspan=1>flows×layers</td><td rowspan=1 colspan=1>res.channels</td><td rowspan=1 colspan=1># param</td><td rowspan=1 colspan=1>syn.speed</td><td rowspan=1 colspan=1>MOS</td></tr><tr><td rowspan=2 colspan=2>WaveNetWaveGlow</td><td rowspan=1 colspan=1>1×30=30</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>4.57 M</td><td rowspan=1 colspan=1>0.002×</td><td rowspan=1 colspan=1>4.43 ± 0.14</td></tr><tr><td rowspan=1 colspan=1>12×8=96</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>17.59 M</td><td rowspan=1 colspan=1>93.53×</td><td rowspan=1 colspan=1>2.17 ± 0.13</td></tr><tr><td rowspan=1 colspan=2>WaveGlow</td><td rowspan=1 colspan=1>12×8=96</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>34.83 M</td><td rowspan=1 colspan=1>69.88×</td><td rowspan=1 colspan=1>2.97 ± 0.15</td></tr><tr><td rowspan=1 colspan=2>WaveGlow</td><td rowspan=1 colspan=1>12×8=96</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>87.88 M</td><td rowspan=1 colspan=1>34.69×</td><td rowspan=5 colspan=1>4.34 ± 0.114.32 ± 0.124.26 ± 0.124.32 ± 0.084.34 ± 0.13</td></tr><tr><td rowspan=1 colspan=1>WaveGlow</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>12×8=96</td><td rowspan=1 colspan=1>512</td><td rowspan=1 colspan=1>268.29 M</td><td rowspan=1 colspan=1>8.08×</td></tr><tr><td rowspan=1 colspan=2>WaveFlow (h = 8)</td><td rowspan=1 colspan=1>8×8=64</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>5.91 M</td><td rowspan=1 colspan=1>47.61×</td></tr><tr><td rowspan=2 colspan=2>WaveFlow (h = 16)WaveFlow (h = 16)</td><td rowspan=1 colspan=1>8×8=64</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>5.91 M</td><td rowspan=1 colspan=1>42.60×</td></tr><tr><td rowspan=1 colspan=2>WaveFlow (h = 16)</td><td rowspan=1 colspan=1>8×8=64</td><td rowspan=1 colspan=1>96</td><td rowspan=1 colspan=1>12.78 M</td><td rowspan=1 colspan=1>26.23×</td></tr><tr><td rowspan=1 colspan=2>WaveFlow (h = 16)</td><td rowspan=1 colspan=1>8×8=64</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>22.25M</td><td rowspan=1 colspan=1>21.32×</td><td rowspan=2 colspan=1>4.38 ± 0.094.43 ± 0.10</td></tr><tr><td rowspan=1 colspan=2>WaveFlow (h = 16)</td><td rowspan=1 colspan=1>8×8=64</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>86.18 M</td><td rowspan=1 colspan=1>8.42×</td></tr><tr><td rowspan=1 colspan=2>Ground-truth</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>4.56± 0.09</td></tr></table>
|
| 202 |
+
|
| 203 |
+

|
| 204 |
+
Figure 3: The test log-likelihoods (LLs) vs. MOS scores for all likelihood-based models in Table 5.
|
| 205 |
+
|
| 206 |
+
• We find a positive correlation between the test likelihoods and MOS scores for these likelihoodbased generative models (see Figure 3 for an illustration). One can see that larger LLs correspond to higher MOS scores even when we compare all models in Figure 3 (a). The correlations become more evident, as we consider WaveFlow and WaveGlow in Figure 3 (b).
|
| 207 |
+
|
| 208 |
+
# 6 CONCLUSION
|
| 209 |
+
|
| 210 |
+
We propose WaveFlow, a compact flow-based model for raw audio, which can be directly trained with maximum likelihood estimation. It provides a unified view of flow-based models for time-domain waveforms, and includes WaveNet and WaveGlow as special cases. WaveFlow requires a small number of sequential steps to generate high-fidelity speech and obtains likelihood comparable to WaveNet. In the end, our small-footprint WaveFlow can generate $2 2 . 0 5 \mathrm { k H z }$ high-fidelity speech more than $4 0 \times$ faster than real-time on a GPU without engineered inference kernels.
|
| 211 |
+
|
| 212 |
+
# REFERENCES
|
| 213 |
+
|
| 214 |
+
S. O. Arık, M. Chrzanowski, A. Coates, G. Diamos, A. Gibiansky, Y. Kang, X. Li, J. Miller, J. Raiman, S. Sengupta, and M. Shoeybi. Deep Voice: Real-time neural text-to-speech. In ICML, 2017a.
|
| 215 |
+
S. O. Arık, G. Diamos, A. Gibiansky, J. Miller, K. Peng, W. Ping, J. Raiman, and Y. Zhou. Deep Voice 2: Multi-speaker neural text-to-speech. In NIPS, 2017b.
|
| 216 |
+
R. v. d. Berg, L. Hasenclever, J. M. Tomczak, and M. Welling. Sylvester normalizing flows for variational inference. arXiv preprint arXiv:1803.05649, 2018.
|
| 217 |
+
S. Dieleman, A. van den Oord, and K. Simonyan. The challenge of realistic music generation: modelling raw audio at scale. In NeurIPS, 2018.
|
| 218 |
+
L. Dinh, D. Krueger, and Y. Bengio. NICE: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
|
| 219 |
+
L. Dinh, J. Sohl-Dickstein, and S. Bengio. Density estimation using Real NVP. In ICLR, 2017.
|
| 220 |
+
W. Grathwohl, R. T. Chen, J. Betterncourt, I. Sutskever, and D. Duvenaud. Ffjord: Free-form continuous dynamics for scalable reversible generative models. arXiv preprint arXiv:1810.01367, 2018.
|
| 221 |
+
E. Hoogeboom, R. v. d. Berg, and M. Welling. Emerging convolutions for generative normalizing flows. arXiv preprint arXiv:1901.11137, 2019.
|
| 222 |
+
C.-W. Huang, D. Krueger, A. Lacoste, and A. Courville. Neural autoregressive flows. arXiv preprint arXiv:1804.00779, 2018.
|
| 223 |
+
K. Ito. The LJ speech dataset. 2017.
|
| 224 |
+
N. Kalchbrenner, E. Elsen, K. Simonyan, S. Noury, N. Casagrande, E. Lockhart, F. Stimberg, A. v. d. Oord, S. Dieleman, and K. Kavukcuoglu. Efficient neural audio synthesis. In ICML, 2018.
|
| 225 |
+
S. Kim, S.-g. Lee, J. Song, and S. Yoon. FloWaveNet: A generative flow for raw audio. In ICML, 2019.
|
| 226 |
+
D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 227 |
+
D. P. Kingma and P. Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pages 10215–10224, 2018.
|
| 228 |
+
D. P. Kingma, T. Salimans, R. Jozefowicz, X. Chen, I. Sutskever, and M. Welling. Improving variational inference with inverse autoregressive flow. In NIPS, 2016.
|
| 229 |
+
N. Li, S. Liu, Y. Liu, S. Zhao, M. Liu, and M. Zhou. Neural speech synthesis with transformer network. AAAI, 2019.
|
| 230 |
+
S. Mehri, K. Kumar, I. Gulrajani, R. Kumar, S. Jain, J. Sotelo, A. Courville, and Y. Bengio. SampleRNN: An unconditional end-to-end neural audio generation model. In ICLR, 2017.
|
| 231 |
+
T. L. Paine, P. Khorrami, S. Chang, Y. Zhang, P. Ramachandran, M. A. Hasegawa-Johnson, and T. S. Huang. Fast wavenet generation algorithm. arXiv preprint arXiv:1611.09482, 2016.
|
| 232 |
+
G. Papamakarios, T. Pavlakou, and I. Murray. Masked autoregressive flow for density estimation. In Advances in Neural Information Processing Systems, pages 2338–2347, 2017.
|
| 233 |
+
K. Peng, W. Ping, Z. Song, and K. Zhao. Parallel neural text-to-speech. arXiv preprint arXiv:1905.08459, 2019.
|
| 234 |
+
B. Pharris. NV-WaveNet: Better speech synthesis using gpu-enabled WaveNet inference. In NVIDIA Developer Blog, 2018.
|
| 235 |
+
W. Ping, K. Peng, A. Gibiansky, S. O. Arik, A. Kannan, S. Narang, J. Raiman, and J. Miller. Deep Voice 3: Scaling text-to-speech with convolutional sequence learning. In ICLR, 2018.
|
| 236 |
+
W. Ping, K. Peng, and J. Chen. ClariNet: Parallel wave generation in end-to-end text-to-speech. In ICLR, 2019.
|
| 237 |
+
R. Prenger, R. Valle, and B. Catanzaro. WaveGlow: A flow-based generative network for speech synthesis. In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2019.
|
| 238 |
+
Y. Ren, Y. Ruan, X. Tan, T. Qin, S. Zhao, Z. Zhao, and T.-Y. Liu. Fastspeech: Fast, robust and controllable text to speech. arXiv preprint arXiv:1905.09263, 2019.
|
| 239 |
+
D. J. Rezende and S. Mohamed. Variational inference with normalizing flows. In ICML, 2015.
|
| 240 |
+
F. Ribeiro, D. Florêncio, C. Zhang, and M. Seltzer. CrowdMOS: An approach for crowdsourcing mean opinion score studies. In ICASSP, 2011.
|
| 241 |
+
T. Salimans and D. P. Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In Advances in Neural Information Processing Systems, pages 901–909, 2016.
|
| 242 |
+
J. Serrà, S. Pascual, and C. Segura. Blow: a single-scale hyperconditioned flow for non-parallel raw-audio voice conversion. arXiv preprint arXiv:1906.00794, 2019.
|
| 243 |
+
J. Shen, R. Pang, R. J. Weiss, M. Schuster, N. Jaitly, Z. Yang, Z. Chen, Y. Zhang, Y. Wang, R. SkerryRyan, et al. Natural TTS synthesis by conditioning WaveNet on mel spectrogram predictions. In ICASSP, 2018.
|
| 244 |
+
J. Sotelo, S. Mehri, K. Kumar, J. F. Santos, K. Kastner, A. Courville, and Y. Bengio. Char2wav: End-to-end speech synthesis. ICLR workshop, 2017.
|
| 245 |
+
Y. Taigman, L. Wolf, A. Polyak, and E. Nachmani. VoiceLoop: Voice fitting and synthesis via a phonological loop. In ICLR, 2018.
|
| 246 |
+
A. van den Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals, A. Graves, N. Kalchbrenner, A. Senior, and K. Kavukcuoglu. WaveNet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016.
|
| 247 |
+
A. van den Oord, Y. Li, I. Babuschkin, K. Simonyan, O. Vinyals, K. Kavukcuoglu, G. v. d. Driessche, E. Lockhart, L. C. Cobo, F. Stimberg, et al. Parallel WaveNet: Fast high-fidelity speech synthesis. In ICML, 2018.
|
| 248 |
+
Y. Wang, R. Skerry-Ryan, D. Stanton, Y. Wu, R. J. Weiss, N. Jaitly, Z. Yang, Y. Xiao, Z. Chen, S. Bengio, Q. Le, Y. Agiomyrgiannakis, R. Clark, and R. A. Saurous. Tacotron: Towards end-to-end speech synthesis. In Interspeech, 2017.
|
| 249 |
+
R. Yamamoto, E. Song, and J.-M. Kim. Probability density distillation with generative adversarial networks for high-quality parallel waveform generation. arXiv preprint arXiv:1904.04472, 2019.
|
| 250 |
+
F. Yu and V. Koltun. Multi-scale context aggregation by dilated convolutions. arXiv preprint arXiv:1511.07122, 2015.
|
md/train/Sks9_ajex/Sks9_ajex.md
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PAYING MORE ATTENTION TO ATTENTION: IMPROVING THE PERFORMANCE OF CONVOLUTIONAL NEURAL NETWORKS VIA ATTENTION TRANSFER
|
| 2 |
+
|
| 3 |
+
Sergey Zagoruyko, Nikos Komodakis
|
| 4 |
+
Universite Paris-Est, ´ Ecole des Ponts ParisTech ´
|
| 5 |
+
Paris, France
|
| 6 |
+
{sergey.zagoruyko,nikos.komodakis}@enpc.fr
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Attention plays a critical role in human visual experience. Furthermore, it has recently been demonstrated that attention can also play an important role in the context of applying artificial neural networks to a variety of tasks from fields such as computer vision and NLP. In this work we show that, by properly defining attention for convolutional neural networks, we can actually use this type of information in order to significantly improve the performance of a student CNN network by forcing it to mimic the attention maps of a powerful teacher network. To that end, we propose several novel methods of transferring attention, showing consistent improvement across a variety of datasets and convolutional neural network architectures. Code and models for our experiments are available at https://github.com/szagoruyko/attention-transfer.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
As humans, we need to pay attention in order to be able to adequately perceive our surroundings. Attention is therefore a key aspect of our visual experience, and closely relates to perception - we need to keep attention to build a visual representation, possessing detail and coherence.
|
| 15 |
+
|
| 16 |
+
As artificial neural networks became more popular in fields such as computer vision and natural language processing in the recent years, artificial attention mechanisms started to be developed as well. Artificial attention lets a system “attend” to an object to examine it with greater detail. It has also become a research tool for understanding mechanisms behind neural networks, similar to attention used in psychology.
|
| 17 |
+
|
| 18 |
+
One of the popular hypothesis there is that there are non-attentional and attentional perception processes. Non-attentional processes help to observe a scene in general and gather high-level information, which, when associated with other thinking processes, helps us to control the attention processes and navigate to a certain part of the scene. This implies that different observers with different knowledge, different goals, and therefore different attentional strategies can literally see the same scene differently. This brings us to the main topic of this paper: how attention differs within artificial vision systems, and can we use attention information in order to improve the performance of convolutional neural networks ? More specifically, can a teacher network improve the performance of another student network by providing to it information about where it looks, i.e., about where it concentrates its attention into ?
|
| 19 |
+
|
| 20 |
+
To study these questions, one first needs to properly specify how attention is defined w.r.t. a given convolutional neural network. To that end, here we consider attention as a set of spatial maps that essentially try to encode on which spatial areas of the input the network focuses most for taking its output decision (e.g., for classifying an image), where, furthermore, these maps can be defined w.r.t. various layers of the network so that they are able to capture both low-, mid-, and high-level representation information. More specifically, in this work we define two types of spatial attention maps: activation-based and gradient-based. We explore how both of these attention maps change over various datasets and architectures, and show that these actually contain valuable information that can be used for significantly improving the performance of convolutional neural network architectures (of various types and trained for various different tasks). To that end, we propose several novel ways of transferring attention from a powerful teacher network to a smaller student network with the goal of improving the performance of the latter (Fig. 1).
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 1: (a) An input image and a corresponding spatial attention map of a convolutional network that shows where the network focuses in order to classify the given image. Surely, this type of map must contain valuable information about the network. The question that we pose in this paper is the following: can we use knowledge of this type to improve the training of CNN models ? (b) Schematic representation of attention transfer: a student CNN is trained so as, not only to make good predictions, but to also have similar spatial attention maps to those of an already trained teacher CNN.
|
| 24 |
+
|
| 25 |
+
To summarize, the contributions of this work are as follows:
|
| 26 |
+
|
| 27 |
+
• We propose attention as a mechanism of transferring knowledge from one network to another
|
| 28 |
+
• We propose the use of both activation-based and gradient-based spatial attention maps
|
| 29 |
+
• We show experimentally that our approach provides significant improvements across a variety of datasets and deep network architectures, including both residual and non-residual networks
|
| 30 |
+
• We show that activation-based attention transfer gives better improvements than fullactivation transfer, and can be combined with knowledge distillation
|
| 31 |
+
|
| 32 |
+
The rest of the paper is structured as follows: we first describe related work in section 2, we explain our approach for activation-based and gradient-based attention transfer in section 3, and then present experimental results for both methods in section 4. We conclude the paper in section 5.
|
| 33 |
+
|
| 34 |
+
# 2 RELATED WORK
|
| 35 |
+
|
| 36 |
+
Early work on attention based tracking Larochelle & Hinton (2010), Denil et al. (2012) was motivated by human attention mechanism theories Rensink (2000) and was done via Restricted Bolzmann Machines. It was recently adapted for neural machine translation with recurrent neural networks, e.g. Bahdanau et al. (2014) as well as in several other NLP-related tasks. It was also exploited in computer-vision-related tasks such as image captioning Xu et al. (2015), visual question answering Yang et al. (2015), as well as in weakly-supervised object localization Oquab et al. (2015) and classification Mnih et al. (2014), to mention a few characteristic examples. In all these tasks attention proved to be useful.
|
| 37 |
+
|
| 38 |
+
Visualizing attention maps in deep convolutional neural networks is an open problem. The simplest gradient-based way of doing that is by computing a Jacobian of network output w.r.t. input (this leads to attention visualization that are not necessarily class-discriminative), as for example in Simonyan et al. (2014). Another approach was proposed by Zeiler & Fergus (2014) that consists of attaching a network called “deconvnet” that shares weights with the original network and is used to project certain features onto the image plane. A number of methods was proposed to improve gradientbased attention as well, for example guided backpropagation Springenberg et al. (2015), adding a change in ReLU layers during calculation of gradient w.r.t. previous layer output. Attention maps obtained with guided backpropagation are non-class-discriminative too. Among existing methods for visualizing attention, we should also mention class activation maps Zhou et al. (2016), which are based on removing top average-pooling layer and converting the linear classification layer into a convolutional layer, producing attention maps per each class. A method combining both guided backpropagation and CAM is Grad-CAM by Selvaraju et al. (2016), adding image-level details to class-discriminative attention maps.
|
| 39 |
+
|
| 40 |
+
Knowledge distillation with neural networks was pioneered by Hinton et al. (2015); Bucila et al. (2006), which is a transfer learning method that aims to improve the training of a student network by relying on knowledge borrowed from a powerful teacher network. Although in certain special cases shallow networks had been shown to be able to approximate deeper ones without loss in accuracy Lei & Caruana (2014), later work related to knowledge distillation was mostly based on the assumption that deeper networks always learn better representations. For example, FitNets Romero et al. (2014) tried to learn a thin deep network using a shallow one with more parameters. The introduction of highway Srivastava et al. (2015) and later residual networks He et al. (2015) allowed training very deep architectures with higher accuracy, and generality of these networks was experimentally showed over a large variety of datasets. Although the main motivation for residual networks was increasing depth, it was later shown by Zagoruyko & Komodakis (2016) that, after a certain depth, the improvements came mostly from increased capacity of the networks, i.e. number of parameters (for instance, a wider deep residual network with only 16 layers was shown that it could learn as good or better representations as very thin 1000 layer one, provided that they were using comparable number of parameters).
|
| 41 |
+
|
| 42 |
+
Due to the above fact and due to that thin deep networks are less parallelizable than wider ones, we think that knowledge transfer needs to be revisited, and take an opposite to FitNets approach - we try to learn less deep student networks. Our attention maps used for transfer are similar to both gradient-based and activation-based maps mentioned above, which play a role similar to “hints” in FitNets, although we don’t introduce new weights.
|
| 43 |
+
|
| 44 |
+
# 3 ATTENTION TRANSFER
|
| 45 |
+
|
| 46 |
+
In this section we explain the two methods that we use for defining the spatial attention maps of a convolutional neural network as well as how we transfer attention information from a teacher to a student network in each case.
|
| 47 |
+
|
| 48 |
+
# 3.1 ACTIVATION-BASED ATTENTION TRANSFER
|
| 49 |
+
|
| 50 |
+
Let us consider a CNN layer and its corresponding activation tensor $A \in R ^ { C \times H \times W }$ , which consists of $C$ feature planes with spatial dimensions $H \times W$ . An activation-based mapping function $\mathcal { F }$ (w.r.t. that layer) takes as input the above 3D tensor $A$ and outputs a spatial attention map, i.e., a flattened 2D tensor defined over the spatial dimensions, or
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\mathcal { F } : R ^ { C \times H \times W } R ^ { H \times W } .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
To define such a spatial attention mapping function, the implicit assumption that we make in this section is that the absolute value of a hidden neuron activation (that results when the network is evaluated on given input) can be used as an indication about the importance of that neuron w.r.t. the specific input. By considering, therefore, the absolute values of the elements of tensor $A$ , we can construct a spatial attention map by computing statistics of these values across the channel dimension (see Fig. 3). More specifically, in this work we will consider the following activation-based spatial attention maps:
|
| 57 |
+
|
| 58 |
+
• sum of absolute values: $\begin{array} { r } { F _ { \mathrm { s u m } } ( A ) = \sum _ { i = 1 } ^ { C } | A _ { i } | } \end{array}$ • sum of absolute values raised to the power of $p$ (where $p > 1 _ { \cdot }$ ): $\begin{array} { r } { F _ { \mathrm { s u m } } ^ { p } ( A ) = \sum _ { i = 1 } ^ { C } | A _ { i } | ^ { p } } \end{array}$ • max of absolute values raised to the power of $p$ (where $p > 1$ ): $F _ { \operatorname* { m a x } } ^ { p } ( A ) = \operatorname* { m a x } _ { i = 1 , C } | A _ { i } | ^ { p }$ where $A _ { i } = A ( i , : , : )$ (using Matlab notation), and max, power and absolute value operations are elementwise (e.g. $| A _ { i } | ^ { p }$ is equivalent to abs $( \mathbb { A } _ { i } ) \cdot { } ^ { \wedge } \mathtt { p }$ in Matlab notation).
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 2: Sum of absolute values attention maps $F _ { \mathrm { s u m } }$ over different levels of a network trained for face recognition. Mid-level attention maps have higher activation level around eyes, nose and lips, high-level activations correspond to the whole face.
|
| 62 |
+
|
| 63 |
+
We visualized activations of various networks on several datasets, including ImageNet classification and localization, COCO object detection, face recognition, and fine-grained recognition. We were mostly focused on modern architectures without top dense linear layers, such as Network-InNetwork, ResNet and Inception, which have streamlined convolutional structure. We also examined networks of the same architecture, width and depth, but trained with different frameworks with significant difference in performance. We found that the above statistics of hidden activations not only have spatial correlation with predicted objects on image level, but these correlations also tend to be higher in networks with higher accuracy, and stronger networks have peaks in attention where weak networks don’t (e.g., see Fig. 4). Furthermore, attention maps focus on different parts for different layers in the network. In the first layers neurons activation level is high for low-level gradient points, in the middle it is higher for the most discriminative regions such as eyes or wheels, and in the top layers it reflects full objects. For example, mid-level attention maps of a network trained for face recognition Parkhi et al. (2015) will have higher activations around eyes, nose and lips, and top level activation will correspond to full face (Fig. 2).
|
| 64 |
+
|
| 65 |
+
Concerning the different attention mapping functions defined above, these can have slightly different properties. E.g.:
|
| 66 |
+
|
| 67 |
+
• Compared to $F _ { \mathrm { s u m } } ( A )$ , the spatial map $F _ { \mathrm { s u m } } ^ { p } ( A )$ (where $p > 1$ ) puts more weight to spatial locations that correspond to the neurons with the highest activations, i.e., puts more weight to the most discriminative parts (the larger the $p$ the more focus is placed on those parts with highest activations).
|
| 68 |
+
Furthermore, among all neuron activations corresponding to the same spatial location, $F _ { \mathrm { m a x } } ^ { p } ( A )$ will consider only one of them to assign a weight to that spatial location (as opposed to $F _ { \mathrm { s u m } } ^ { p } ( A )$ that will favor spatial locations that carry multiple neurons with high activations).
|
| 69 |
+
|
| 70 |
+
To further illustrate the differences of these functions we visualized attention maps of 3 networks with sufficient difference in classification performance: Network-In-Network $62 \%$ top-1 val accuracy), ResNet34 ( $73 \%$ top-1 val accuracy) and ResNet-101 ( $7 7 . 3 \%$ top-1 val accuracy). In each network we took last pre-downsampling activation maps, on the left for mid-level and on the right for top pre-average pooling activations in fig. 4. Top-level maps are blurry because their original spatial resolution is $7 \times 7$ . It is clear that most discriminative regions have higher activation levels, e.g. face of the wolf, and that shape details disappear as the parameter $p$ (used as exponent) increases.
|
| 71 |
+
|
| 72 |
+
In attention transfer, given the spatial attention maps of a teacher network (computed using any of the above attention mapping functions), the goal is to train a student network that will not only make correct predictions but will also have attentions maps that are similar to those of the teacher. In general, one can place transfer losses w.r.t. attention maps computed across several layers. For instance, in the case of ResNet architectures, one can consider the following two cases, depending on the depth of teacher and student:
|
| 73 |
+
|
| 74 |
+

|
| 75 |
+
Figure 3: Attention mapping over feature dimension.
|
| 76 |
+
|
| 77 |
+
• Same depth: possible to have attention transfer layer after every residual block • Different depth: have attention transfer on output activations of each group of residual blocks
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 4: Activation attention maps for various ImageNet networks: Network-In-Network $6 2 \%$ top-1 val accuracy), ResNet-34 $73 \%$ top-1 val accuracy), ResNet-101 $7 7 . 3 \%$ top-1 val accuracy). Left part: mid-level activations, right part: top-level pre-softmax acivations
|
| 81 |
+
|
| 82 |
+

|
| 83 |
+
Figure 5: Schematics of teacher-student attention transfer for the case when both networks are residual, and the teacher is deeper.
|
| 84 |
+
|
| 85 |
+
Similar cases apply also to other architectures (such as NIN, in which case a group refers to a block of a $3 \times 3 , 1 \times 1 , 1 \times 1$ convolutions). In fig. 5 we provide a schematic illustration of the different depth case for residual network architectures.
|
| 86 |
+
|
| 87 |
+
Without loss of generality, we assume that transfer losses are placed between student and teacher attention maps of same spatial resolution, but, if needed, attention maps can be interpolated to match their shapes. Let $S$ , $T$ and $\mathbf { W } _ { S }$ , $\mathbf { W } _ { T }$ denote student, teacher and their weights correspondingly, and let $\mathcal { L } ( \mathbf { W } , x )$ denote a standard cross entropy loss. Let also $\mathcal { T }$ denote the indices of all teacher-student activation layer pairs for which we want to transfer attention maps. Then we can define the following total loss:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\mathcal { L } _ { A T } = \mathcal { L } ( \mathbf { W } _ { S } , x ) + \frac { \beta } { 2 } \sum _ { j \in \mathcal { T } } \Vert \frac { Q _ { S } ^ { j } } { \Vert Q _ { S } ^ { j } \Vert _ { 2 } } - \frac { Q _ { T } ^ { j } } { \Vert Q _ { T } ^ { j } \Vert _ { 2 } } \Vert _ { p } \enspace ,
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $Q _ { S } ^ { j } = v e c ( F ( A _ { S } ^ { j } ) )$ and $Q _ { T } ^ { j } = v e c ( F ( A _ { T } ^ { j } ) )$ are respectively the $j$ -th pair of student and teacher attention maps in vectorized form, and $p$ refers to norm type (in the experiments we use $p = 2$ ). As can be seen, during attention transfer we make use of $l _ { 2 }$ -normalized attention maps, i.e., we replace each vectorized attention map $Q$ with QkQk2 (l1 normalization could be used as well). It is worth emphasizing that normalization of attention maps is important for the success of the student training.
|
| 94 |
+
|
| 95 |
+
Attention transfer can also be combined with knowledge distillation Hinton et al. (2015), in which case an additional term (corresponding to the cross entropy between softened distributions over labels of teacher and student) simply needs to be included to the above loss. When combined, attention transfer adds very little computational cost, as attention maps for teacher can be easily computed during forward propagation, needed for distillation.
|
| 96 |
+
|
| 97 |
+
# 3.2 GRADIENT-BASED ATTENTION TRANSFER
|
| 98 |
+
|
| 99 |
+
In this case we define attention as gradient w.r.t. input, which can be viewed as an input sensitivity map Simonyan et al. (2014), i.e., attention at an input spatial location encodes how sensitive the output prediction is w.r.t. changes at that input location (e.g., if small changes at a pixel can have a large effect on the network output then it is logical to assume that the network is “paying attention” to that pixel). Let’s define the gradient of the loss w.r.t input for teacher and student as:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
J _ { S } = \frac { \partial } { \partial x } \mathcal { L } ( \mathbf { W _ { S } } , x ) , J _ { T } = \frac { \partial } { \partial x } \mathcal { L } ( \mathbf { W _ { T } } , x )
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
Then if we want student gradient attention to be similar to teacher attention, we can minimize a distance between them (here we use $l _ { 2 }$ distance but other distances can be employed as well):
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\mathcal { L } _ { A T } ( \mathbf { W _ { S } } , \mathbf { W _ { T } } , x ) = \mathcal { L } ( \mathbf { W _ { S } } , x ) + \frac { \beta } { 2 } | | J _ { S } - J _ { T } | | _ { 2 }
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
As $\mathbf { W } _ { T }$ and $x$ are given, to get the needed derivative w.r.t. $\mathbf { W } _ { S }$ :
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\frac { \partial } { \partial \mathbf { W _ { S } } } \mathcal { L } _ { A T } = \frac { \partial } { \partial \mathbf { W _ { S } } } \mathcal { L } ( \mathbf { W _ { S } } , x ) + \beta ( J _ { S } - J _ { T } ) \frac { \partial ^ { 2 } } { \partial \mathbf { W _ { S } } \partial x } \mathcal { L } ( \mathbf { W _ { S } } , x )
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
So to do an update we first need to do forward and back propagation to get $J _ { S }$ and $J _ { T }$ , compute the second error $ { \mathbf { \bar { \rho } } } _ { 2 } ^ { \beta } | | J _ { S } - J _ { T } | | _ { 2 }$ and propagate it second time. The second propagation is similar to forward propagation in this case, and involves second order mixed partial derivative calculation ∂2∂WS∂x . The above computation is similar to the double backpropagation technique developed by Drucker & LeCun (1992) (where the $l _ { 2 }$ norm of the gradient w.r.t. input is used as regularizer). Furthermore, it can be implemented efficiently in a framework with automatic differentiation support, even for modern architectures with sophisticated graphs. The second backpropagation has approximately the same cost with first backpropagation, excluding forward propagation.
|
| 118 |
+
|
| 119 |
+
We also propose to enforce horizontal flip invariance on gradient attention maps. To do that we propagate horizontally flipped images as well as originals, backpropagate and flip gradient attention maps back. We then add $l _ { 2 }$ losses on the obtained attentions and outputs, and do second backpropagation:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\mathcal { L } _ { s y m } ( \mathbf { W } , x ) = \mathcal { L } ( \mathbf { W } , x ) + \frac { \beta } { 2 } | | \frac { \partial } { \partial x } \mathcal { L } ( \mathbf { W } , x ) - \mathrm { H i p } ( \frac { \partial } { \partial x } \mathcal { L } ( \mathbf { W } , \mathrm { H i p } ( x ) ) ) | | _ { 2 } \ ,
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
where $\operatorname { f i i p } ( x )$ denotes the flip operator. This is similar to Group Equivariant CNN approach by Cohen & Welling (2016), however it is not a hard constraint. We experimentally find that this has a regularization effect on training.
|
| 126 |
+
|
| 127 |
+
We should note that in this work we consider only gradients w.r.t. the input layer, but in general one might have the proposed attention transfer and symmetry constraints w.r.t. higher layers of the network.
|
| 128 |
+
|
| 129 |
+
# 4 EXPERIMENTAL SECTION
|
| 130 |
+
|
| 131 |
+
In the following section we explore attention transfer on various image classification datasets. We split the section in two parts, in the first we include activation-based attention transfer and gradientbased attention transfer experiments on CIFAR, and in the second activation-based attention transfer experiments on larger datasets. For activation-based attention transfer we used Network-InNetwork Lin et al. (2013) and ResNet-based architectures (including the recently introduced Wide Residual Networks (WRN) Zagoruyko & Komodakis (2016)), as they are most performant and set strong baselines in terms of number of parameters compared to AlexNet or VGG, and have been explored in various papers across small and large datasets. On Scenes, CUB and ImageNet we experimented with ResNet-18 and ResNet-34. As for gradient-based attention, we constrained ourselves to Network-In-Network without batch normalization and CIFAR dataset, due to the need of complex automatic differentiation.
|
| 132 |
+
|
| 133 |
+
# 4.1 CIFAR EXPERIMENTS
|
| 134 |
+
|
| 135 |
+
We start with CIFAR dataset which has small $3 2 \times 3 2$ images, and after downsampling top activations have even smaller resolution, so there is not much space for attention transfer. Interestingly, even under this adversarial setting, we find that attention transfer seems to give reasonable benefits, offering in all cases consistent improvements. We use horizontal flips and random crops data augmentations, and all networks have batch normalization. We find that ZCA whitening has negative effect on validation accuracy, and omit it in favor of simpler meanstd normalization. We raise Knowledge Distillation (KD) temperature for ResNet transfers to 4, and use $\alpha = 0 . 9$ (see Hinton et al. (2015) for an explanation of these parameters).
|
| 136 |
+
|
| 137 |
+
# 4.1.1 ACTIVATION-BASED ATTENTION TRANSFER
|
| 138 |
+
|
| 139 |
+
Results of attention transfer (using $F _ { \mathrm { s u m } } ^ { 2 }$ attention maps) for various networks on CIFAR-10 can be found in table 1. We experimented with teacher/student having the same depth (WRN-16-2/WRN16-1), as well as different depth (WRN-40-1/WRN-16-1, WRN-40-2/WRN-16-2). In all combinations, attention transfer (AT) shows significant improvements, which are also higher when it is combined with knowledge distillation $( \mathrm { A T + K D } )$ ).
|
| 140 |
+
|
| 141 |
+
<table><tr><td>student</td><td>teacher</td><td>student</td><td>AT</td><td>F-ActT</td><td>KD</td><td>AT+KD</td><td>teacher</td></tr><tr><td>NIN-thin,0.2M</td><td>NIN-wide,1M</td><td>9.38</td><td>8.93</td><td>9.05</td><td>8.55</td><td>8.33</td><td>7.28</td></tr><tr><td>WRN-16-1, 0.2M</td><td>WRN-16-2, 0.7M</td><td>8.77</td><td>7.93</td><td>8.51</td><td>7.41</td><td>7.51</td><td>6.31</td></tr><tr><td>WRN-16-1, 0.2M</td><td>WRN-40-1, 0.6M</td><td>8.77</td><td>8.25</td><td>8.62</td><td>8.39</td><td>8.01</td><td>6.58</td></tr><tr><td>WRN-16-2,0.7M</td><td>WRN-40-2,2.2M</td><td>6.31</td><td>5.85</td><td>6.24</td><td>6.08</td><td>5.71</td><td>5.23</td></tr></table>
|
| 142 |
+
|
| 143 |
+
Table 1: Activation-based attention transfer (AT) with various architectures on CIFAR-10. Error is computed as median of 5 runs with different seed. F-ActT means full-activation transfer (see $\ S 4 . 1 . 2 )$ .
|
| 144 |
+
|
| 145 |
+
To verify if having at least one activation-based attention transfer loss per group in WRN transfer is important, we trained three networks with only one transfer loss per network in group1, group2 and group3 separately, and compared to a network trained with all three losses. The corresponding results were 8.11, 7.96, 7.97 (for the separate losses) and 7.93 for the combined loss (using WRN16-2/WRN-16-1 as teacher/student pair). Each loss provides some additional degree of attention transfer.
|
| 146 |
+
|
| 147 |
+
We also explore which attention mapping functions tend to work best using WRN-16-1 and WRN16-2 as student and teacher networks respectively (table 2). Interestingly, sum-based functions work very similar, and better than max-based ones. From now on, we will use sum of squared attention mapping function $F _ { \mathrm { s u m } } ^ { 2 }$ for simplicity. As for parameter $\beta$ in eq. 2, it usually varies about 0.1, as we set it to $\mathrm { \bar { 1 0 ^ { 3 } } }$ divided by number of elements in attention map and batch size for each layer. In case of combinining AT with KD we decay it during traning in order to simplify learning harder examples.
|
| 148 |
+
|
| 149 |
+
# 4.1.2 ACTIVATION-BASED AT VS. TRANSFERRING FULL ACTIVATION
|
| 150 |
+
|
| 151 |
+
To check if transferring information from full activation tensors is more beneficial than from attention maps, we experimented with FitNets-style hints using $l _ { 2 }$ losses on full activations directly, with $1 \times 1$ convolutional layers to match tensor shapes, and found that improvements over baseline student were minimal (see column F-ActT in table 1). For networks of the same width different depth we tried to regress directly to activations, without $1 \times 1$ convolutions. We also use $l _ { 2 }$ normalization before transfer losses, and decay $\beta$ in eq. 2 during training as these give better performance. We find that AT, as well as full-activation transfer, greatly speeds up convergence, but AT gives much better final accuracy improvement than full-activation transfer (see fig. 7(b), Appendix). It seems quite interesting that attention maps carry information that is more important for transfer than full activations.
|
| 152 |
+
|
| 153 |
+
<table><tr><td>norm type</td><td>error</td></tr><tr><td>baseline (no attention transfer) min-l2 Drucker & LeCun (1992) grad-based AT KD symmetry norm activation-based AT</td><td>13.5 12.5 12.1 12.1 11.8 11.2</td></tr></table>
|
| 154 |
+
|
| 155 |
+
Table 2: Test error of WRN16-2/WRN-16-1 teacher/student pair for various attention mapping functions. Median of 5 runs test errors are reported.
|
| 156 |
+
Table 3: Performance of various gradient-based attention methods on CIFAR-10. Baseline is a thin NIN network with ${ \bf 0 . 2 M }$ parameters (trained only on horizontally flipped augmented data and without batch normalization), min- $\mathbf { \cdot } l _ { 2 }$ refers to using $l _ { 2 }$ norm of gradient w.r.t. input as regularizer, symmetry norm - to using flip invariance on gradient attention maps (see eq. 6), AT - to attention transfer, and KD - to Knowledge Distillation (both AT and KD use a wide NIN of 1M parameters as teacher).
|
| 157 |
+
|
| 158 |
+
<table><tr><td>attention mapping function</td><td>error</td></tr><tr><td>no attention transfer Fsum</td><td>8.77 7.99 7.93</td></tr></table>
|
| 159 |
+
|
| 160 |
+
# 4.1.3 GRADIENT-BASED ATTENTION TRANSFER
|
| 161 |
+
|
| 162 |
+
For simplicity we use thin Network-In-Network model in these experiments, and don’t apply random crop data augmentation with batch normalization, just horizontal flips augmentation. We also only use deterministic algorithms and sampling with fixed seed, so reported numbers are for single run experiments. We find that in this setting network struggles to fit into training data already, and turn off weight decay even for baseline experiments. In future we plan to explore gradient-based attention for teacher-student pairs that make use of batch normalization, because it is so far unclear how batch normalization should behave in the second backpropagation step required during gradientbased attention transfer (e.g., should it contribute to batch normalization parameters, or is a separate forward propagation with fixed parameters needed).
|
| 163 |
+
|
| 164 |
+
We explored the following methods:
|
| 165 |
+
|
| 166 |
+
• Minimizing $l _ { 2 }$ norm of gradient w.r.t. input, i.e. the double backpropagation method Drucker & LeCun (1992);
|
| 167 |
+
• Symmetry norm on gradient attention maps (see eq. 6);
|
| 168 |
+
• Student-teacher gradient-based attention transfer;
|
| 169 |
+
• Student-teacher activation-based attention transfer.
|
| 170 |
+
|
| 171 |
+
Results for various methods are shown in table 3. Interestingly, just minimizing $l _ { 2 }$ norm of gradient already works pretty well. Also, symmetry norm is one the best performing attention norms, which we plan to investigate in future on other datasets as well. We also observe that, similar to activationbased attention transfer, using gradient-based attention transfer leads to improved performance. We also trained a network with activation-based AT in the same training conditions, which resulted in the best performance among all methods. We should note that the architecture of student NIN without batch normalization is slightly different from teacher network, it doesn’t have ReLU activations before pooling layers, which leads to better performance without batch normalization, and worse with. So to achieve the best performance with activation-based AT we had to train a new teacher, with batch normalization and without ReLU activations before pooling layers, and have AT losses on outputs of convolutional layers.
|
| 172 |
+
|
| 173 |
+
# 4.2 LARGE INPUT IMAGE NETWORKS
|
| 174 |
+
|
| 175 |
+
In this section we experiment with hidden activation attention transfer on ImageNet networks which have $2 2 4 \times 2 2 4$ input image size. Presumably, attention matters more in this kind of networks as spatial resolution of attention maps is higher.
|
| 176 |
+
|
| 177 |
+
Table 4: Finetuning with attention transfer error on Scenes and CUB datasets
|
| 178 |
+
|
| 179 |
+
<table><tr><td>type</td><td>model</td><td>ImageNet-→CUB</td><td>ImageNet-→Scenes</td></tr><tr><td>student</td><td>ResNet-18</td><td>28.5</td><td>28.2</td></tr><tr><td>KD</td><td>ResNet-18</td><td>27 (-1.5)</td><td>28.1 (-0.1)</td></tr><tr><td>AT</td><td>ResNet-18</td><td>27 (-1.5)</td><td>27.1 (-1.1)</td></tr><tr><td>teacher</td><td>ResNet-34</td><td>26.5</td><td>26</td></tr></table>
|
| 180 |
+
|
| 181 |
+
# 4.2.1 TRANSFER LEARNING
|
| 182 |
+
|
| 183 |
+
To see how attention transfer works in finetuning we choose two datasets: Caltech-UCSD Birds-200- 2011 fine-grained classification (CUB) by Wah et al. (2011), and MIT indoor scene classification (Scenes) by Quattoni & Torralba (2009), both containing around 5K images training images. We took ResNet-18 and ResNet-34 pretrained on ImageNet and finetuned on both datasets. On CUB we crop bounding boxes, rescale to 256 in one dimension and then take a random crop. Batch normalization layers are fixed for finetuning, and first group of residual blocks is frozen. We then took finetuned ResNet-34 networks and used them as teachers for ResNet-18 pretrained on ImageNet, with $F _ { \mathrm { s u m } } ^ { 2 }$ attention losses on 2 last groups. In both cases attention transfer provides significant improvements, closing the gap between ResNet-18 and ResNet-34 in accuracy. On Scenes AT works as well as KD, and on CUB AT works much better, which we speculate is due to importance of intermediate attention for fine-grained recognition. Moreover, after finetuning, student’s attention maps indeed look more similar to teacher’s (Fig. 6, Appendix).
|
| 184 |
+
|
| 185 |
+
# 4.2.2 IMAGENET
|
| 186 |
+
|
| 187 |
+
To showcase activation-based attention transfer on ImageNet we took ResNet-18 as a student, and ResNet-34 as a teacher, and tried to improve ResNet-18 accuracy. We added only two losses in the 2 last groups of residual blocks and used squared sum attention $F _ { \mathrm { s u m } } ^ { 2 }$ . We also did not have time to tune any hyperparameters and kept them from finetuning experiments. Nevertheless, ResNet-18 with attention transfer achieved $1 . 1 \%$ top-1 and $0 . 8 \%$ top-5 better validation accuracy (Table. 5 and Fig. 7(a), Appendix), we plan to update the paper with losses on all 4 groups of residual blocks.
|
| 188 |
+
|
| 189 |
+
We were not able to achieve positive results with KD on ImageNet. With ResNet-18-ResNet-34 student-teacher pair it actually hurts convergence with the same hyperparameters as on CIFAR. As it was reported that KD struggles to work if teacher and student have different architecture/depth (we observe the same on CIFAR), so we tried using the same architecture and depth for attention transfer. On CIFAR both AT and KD work well in this case and improve convergence and final accuracy, on ImageNet though KD converges significantly slower (we did not train until the end due to lack of computational resources). We also could not find applications of FitNets, KD or similar methods on ImageNet in the literature. Given that, we can assume that proposed activation-based AT is the first knowledge transfer method to be successfully applied on ImageNet.
|
| 190 |
+
|
| 191 |
+
# 5 CONCLUSIONS
|
| 192 |
+
|
| 193 |
+
We presented several ways of transferring attention from one network to another, with experimental results over several image recognition datasets. It would be interesting to see how attention transfer works in cases where spatial information is more important, e.g. object detection or weaklysupervised localization, which is something that we plan to explore in the future.
|
| 194 |
+
|
| 195 |
+
Overall, we think that our interesting findings will help further advance knowledge distillation, and understanding convolutional neural networks in general.
|
| 196 |
+
|
| 197 |
+
# REFERENCES
|
| 198 |
+
|
| 199 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. CoRR, abs/1409.0473, 2014. URL http://arxiv.org/ abs/1409.0473.
|
| 200 |
+
|
| 201 |
+
Cristian Bucila, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In KDD, pp. 535–541, 2006.
|
| 202 |
+
|
| 203 |
+
Taco S. Cohen and Max Welling. Group equivariant convolutional networks. CoRR, abs/1602.07576, 2016. URL http://arxiv.org/abs/1602.07576.
|
| 204 |
+
|
| 205 |
+
Misha Denil, Loris Bazzani, Hugo Larochelle, and Nando de Freitas. Learning where to attend with deep architectures for image tracking. Neural Computation, 2012.
|
| 206 |
+
|
| 207 |
+
H. Drucker and Y LeCun. Improving generalization performance using double backpropagation. IEEE Transaction on Neural Networks, 3(6):991–997, 1992.
|
| 208 |
+
|
| 209 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015.
|
| 210 |
+
|
| 211 |
+
Geoffrey E. Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural networks. 2015.
|
| 212 |
+
|
| 213 |
+
Hugo Larochelle and Geoffrey E. Hinton. Learning to combine foveal glimpses with a third-order boltzmann machine. In J. D. Lafferty, C. K. I. Williams, J. Shawe-Taylor, R. S. Zemel, and A. Culotta (eds.), Advances in Neural Information Processing Systems 23, pp. 1243–1251. Curran Associates, Inc., 2010.
|
| 214 |
+
|
| 215 |
+
Jimmy Ba Lei and Rich Caruana. Do deep nets really need to be deep? In NIPS, 2014.
|
| 216 |
+
|
| 217 |
+
Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. CoRR, abs/1312.4400, 2013.
|
| 218 |
+
|
| 219 |
+
Volodymyr Mnih, Nicolas Heess, Alex Graves, and koray kavukcuoglu. Recurrent models of visual attention. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 27, pp. 2204–2212. Curran Associates, Inc., 2014. URL http://papers.nips.cc/paper/ 5542-recurrent-models-of-visual-attention.pdf.
|
| 220 |
+
|
| 221 |
+
M. Oquab, L. Bottou, I. Laptev, and J. Sivic. Is object localization for free? weakly-supervised learning with convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015.
|
| 222 |
+
|
| 223 |
+
O. M. Parkhi, A. Vedaldi, and A. Zisserman. Deep face recognition. In British Machine Vision Conference, 2015.
|
| 224 |
+
|
| 225 |
+
A. Quattoni and A. Torralba. Recognizing indoor scenes. In CVPR, 2009.
|
| 226 |
+
|
| 227 |
+
Ronald A. Rensink. The dynamic representation of scenes. In Visual Cognition, pp. 17–42, 2000.
|
| 228 |
+
|
| 229 |
+
Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. FitNets: Hints for thin deep nets. Technical Report Arxiv report 1412.6550, arXiv, 2014.
|
| 230 |
+
|
| 231 |
+
Ramprasaath R. Selvaraju, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Why did you say that? visual explanations from deep networks via gradient-based localization. 2016.
|
| 232 |
+
|
| 233 |
+
Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. In ICLR Workshop, 2014.
|
| 234 |
+
|
| 235 |
+
J. T. Springenberg, A. Dosovitskiy, T. Brox, and M. Riedmiller. Striving for simplicity: The all convolutional net. In arXiv:1412.6806, also appeared at ICLR 2015 Workshop Track, 2015. URL http://arxiv.org/abs/1412.6806.
|
| 236 |
+
|
| 237 |
+
Rupesh Kumar Srivastava, Klaus Greff, and Jurgen Schmidhuber. Highway networks. ¨ CoRR, abs/1505.00387, 2015.
|
| 238 |
+
|
| 239 |
+
C. Wah, S. Branson, P. Welinder, P. Perona, and S. Belongie. The Caltech-UCSD Birds-200-2011 Dataset. Technical Report CNS-TR-2011-001, California Institute of Technology, 2011.
|
| 240 |
+
|
| 241 |
+
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron C. Courville, Ruslan Salakhutdinov, Richard S. Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. CoRR, abs/1502.03044, 2015. URL http://arxiv.org/abs/1502. 03044.
|
| 242 |
+
|
| 243 |
+
Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng, and Alexander J. Smola. Stacked attention networks for image question answering. CoRR, abs/1511.02274, 2015. URL http://arxiv. org/abs/1511.02274.
|
| 244 |
+
|
| 245 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In BMVC, 2016.
|
| 246 |
+
|
| 247 |
+
Matthew Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In ECCV, 2014.
|
| 248 |
+
|
| 249 |
+
Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In Computer Vision and Pattern Recognition, 2016.
|
| 250 |
+
|
| 251 |
+
# A APPENDIX
|
| 252 |
+
|
| 253 |
+
# A.1 FIGURES AND TABLES
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Figure 6: Top activation attention maps for different Scenes networks: original pretrained ResNet-18 (ResNet-18-ImageNet), ResNet-18 trained on Scenes (ResNet-18-scenes), ResNet-18 trained with attention transfer (ResNet-18-scenes-AT) with ResNet-34 as a teacher, ResNet-34 trained on Scenes (ResNet-34-scenes). Predicted classes for each task are shown on top. Attention maps look more similar after transfer (images taken from test set).
|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
(a) Attention transfer on ImageNet between ResNet18 and ResNet-34. Solid lines represent top-5 validation error, dashed - top-5 training error. Two attention transfer losses were used on the outputs of two last groups of residual blocks respectively, no KD losses used.
|
| 260 |
+
|
| 261 |
+

|
| 262 |
+
|
| 263 |
+
(b) Activation attention transfer on CIFAR-10 from WRN-16-2 to WRN-16-1. Test error is in bold, train error is in dashed lines. Attention transfer greatly speeds up convergence and improves final accuracy.
|
| 264 |
+
|
| 265 |
+
Table 5: Attention transfer validation error (single crop) on ImageNet. Transfer losses are added on epoch 60/100.
|
| 266 |
+
|
| 267 |
+
<table><tr><td>Model</td><td>top1, top5</td></tr><tr><td>ResNet-18</td><td>30.4,10.8</td></tr><tr><td>AT</td><td>29.3,10.0</td></tr><tr><td>ResNet-34</td><td>26.1,8.3</td></tr></table>
|
| 268 |
+
|
| 269 |
+
# A.2 IMPLEMENTATION DETAILS
|
| 270 |
+
|
| 271 |
+
The experiments were conducted in Torch machine learning framework. Double propagation can be implemented in a modern framework with automatic differentiation support, e.g. Torch, Theano, Tensorflow. For ImageNet experiments we used fb.resnet.torch code, and used 2 Titan X cards with data parallelizm in both teacher and student to speed up training. Code and models for our experiments are available at https://github.com/szagoruyko/attention-transfer.
|
md/train/SkxpDT4YvS/SkxpDT4YvS.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/SyzKd1bCW/SyzKd1bCW.md
ADDED
|
@@ -0,0 +1,499 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BACKPROPAGATION THROUGH THE VOID:OPTIMIZING CONTROL VARIATES FORBLACK-BOX GRADIENT ESTIMATION
|
| 2 |
+
|
| 3 |
+
Will Grathwohl, Dami Choi, Yuhuai Wu, Geoffrey Roeder, David Duvenaud
|
| 4 |
+
|
| 5 |
+
University of Toronto and Vector Institute {wgrathwohl, choidami, ywu, roeder, duvenaud}@cs.toronto.edu
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Gradient-based optimization is the foundation of deep learning and reinforcement learning, but is difficult to apply when the mechanism being optimized is unknown or not differentiable. We introduce a general framework for learning low-variance, unbiased gradient estimators, applicable to black-box functions of discrete or continuous random variables. Our method uses gradients of a surrogate neural network to construct a control variate, which is optimized jointly with the original parameters. We demonstrate this framework for training discrete latent-variable models. We also give an unbiased, action-conditional extension of the advantage actor-critic reinforcement learning algorithm.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Gradient-based optimization has been key to most recent advances in machine learning and reinforcement learning. The back-propagation algorithm (Rumelhart & Hinton, 1986), also known as reverse-mode automatic differentiation (Speelpenning, 1980; Rall, 1981) computes exact gradients of deterministic, differentiable objective functions. The reparameterization trick (Williams, 1992; Kingma & Welling, 2014; Rezende et al., 2014) allows backpropagation to give unbiased, lowvariance estimates of gradients of expectations of continuous random variables. This has allowed effective stochastic optimization of large probabilistic latent-variable models.
|
| 14 |
+
|
| 15 |
+
Unfortunately, there are many objective functions relevant to the machine learning community for which backpropagation cannot be applied. In reinforcement learning, for example, the function being optimized is unknown to the agent and is treated as a black box (Schulman et al., 2015a). Similarly, when fitting probabilistic models with discrete latent variables, discrete sampling operations create discontinuities giving the objective function zero gradient with respect to its parameters. Much recent work has been devoted to constructing gradient estimators for these situations. In reinforcement learning, advantage actor-critic methods (Sutton et al., 2000) give unbiased gradient estimates with reduced variance obtained by jointly optimizing the policy parameters with an estimate of the value function. In discrete latent-variable models, low-variance but biased gradient estimates can be given by continuous relaxations of discrete variables (Maddison et al., 2016; Jang et al., 2016).
|
| 16 |
+
|
| 17 |
+
A recent advance by Tucker et al. (2017) used a continuous relaxation of discrete random variables to build an unbiased and lower-variance gradient estimator, and showed how to tune the free parameters of these relaxations to minimize the estimator’s variance during training. We generalize the method of Tucker et al. (2017) to learn a free-form control variate parameterized by a neural network. This gives a lower-variance, unbiased gradient estimator which can be applied to a wider variety of problems. Most notably, our method is applicable even when no continuous relaxation is available, as in reinforcement learning or black-box function optimization.
|
| 18 |
+
|
| 19 |
+
# 2 BACKGROUND: GRADIENT ESTIMATORS
|
| 20 |
+
|
| 21 |
+
How can we choose the parameters of a distribution to maximize an expectation? This problem comes up in reinforcement learning, where we must choose the parameters $\theta$ of a policy distribution $\pi ( a | s , \theta )$ to maximize the expected reward $\mathbb { E } _ { \tau \sim \pi } \left[ R \right]$ over state-action trajectories $\tau$ . It also
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Left: Training curves comparing different gradient estimators on a toy problem: $\mathcal { L } ( \theta ) = \mathbb { E } _ { p ( b \mid \theta ) } [ ( b - 0 . 4 9 9 ) ^ { 2 } ]$ Right: Log-variance of each estimator’s gradient.
|
| 25 |
+
|
| 26 |
+
comes up in fitting latent-variable models, when we wish to maximize the marginal probability $\begin{array} { r } { p ( x | \theta ) \stackrel { } { = } \sum _ { z } p ( x | \bar { z } ) p ( z | \theta ) = \mathbb { E } _ { p ( z | \theta ) } [ p ( x | z ) ] } \end{array}$ . In this paper, we’ll consider the general problem of optimizing
|
| 27 |
+
|
| 28 |
+
$$
|
| 29 |
+
\begin{array} { r } { \mathcal { L } ( \boldsymbol { \theta } ) = \mathbb { E } _ { p ( \boldsymbol { b } \mid \boldsymbol { \theta } ) } [ f ( \boldsymbol { b } ) ] . } \end{array}
|
| 30 |
+
$$
|
| 31 |
+
|
| 32 |
+
When the parameters $\theta$ are high-dimensional, gradient-based optimization is appealing because it provides information about how to adjust each parameter individually. Stochastic optimization is essential for scalablility, but is only guaranteed to converge to a fixed point of the objective when the stochastic gradients $\hat { g }$ are unbiased, i.e. $\begin{array} { r } { \mathbb { E } \left[ \hat { g } \right] = \frac { \partial } { \partial \theta } \mathcal { L } ( \theta ) } \end{array}$ (Robbins & Monro, 1951).
|
| 33 |
+
|
| 34 |
+
How can we build unbiased, stochastic gradient estimators? There are several standard methods:
|
| 35 |
+
|
| 36 |
+
The score-function gradient estimator One of the most generally-applicable gradient estimators is known as the score-function estimator, or REINFORCE (Williams, 1992):
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\hat { g } _ { \mathrm { R E I N F O R C E } } [ f ] = f \left( b \right) \frac { \partial } { \partial \theta } \log p ( b | \theta ) , \qquad b \sim p ( b | \theta )
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
This estimator is unbiased, but in general has high variance. Intuitively, this estimator is limited by the fact that it doesn’t use any information about how $f$ depends on $b$ , only on the final outcome $f ( \boldsymbol { b } )$ .
|
| 43 |
+
|
| 44 |
+
The reparameterization trick When $f$ is continuous and differentiable, and the latent variables $b$ can be written as a deterministic, differentiable function of a random draw from a fixed distribution, the reparameterization trick (Williams, 1992; Kingma $\&$ Welling, 2014; Rezende et al., 2014) creates a low-variance, unbiased gradient estimator by making the dependence of $b$ on $\theta$ explicit through a reparameterization function $b = T ( \theta , \epsilon )$ :
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\hat { g } _ { \mathrm { r e p a r a m } } [ f ] = \frac { \partial } { \partial \theta } f \left( b \right) = \frac { \partial f } { \partial T } \frac { \partial T } { \partial \theta } , \qquad \epsilon \sim p ( \epsilon )
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
This gradient estimator is often used when training high-dimensional, continuous latent-variable models, such as variational autoencoders. One intuition for why this gradient estimator is preferable to REINFORCE is that it depends on $\partial f / \partial b$ , which exposes the dependence of $f$ on $b$ .
|
| 51 |
+
|
| 52 |
+
Control variates Control variates are a general method for reducing the variance of a stochastic estimator. A control variate is a function $c ( b )$ with a known mean $\mathbb { E } _ { p ( b ) } [ c ( b ) ]$ . Given an estimator ${ \hat { g } } ( b )$ , subtracting the control variate from this estimator and adding its mean gives us a new estimator:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\hat { g } _ { \mathrm { n e w } } ( b ) = \hat { g } ( b ) - c ( b ) + \mathbb { E } _ { p ( b ) } [ c ( b ) ]
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
This new estimator has the same expectation as the old one, but has lower variance if $c ( b )$ is positively correlated with ${ \hat { g } } ( b )$ .
|
| 59 |
+
|
| 60 |
+
In this section, we introduce a gradient estimator for the expectation of a function $\begin{array} { r } { \frac { \partial } { \partial \theta } \mathbb { E } _ { p ( b \vert \theta ) } [ f ( b ) ] } \end{array}$ that can be applied even when $f$ is unknown, or not differentiable, or when is discrete. Our estimator combines the score function estimator, the reparameterization trick, and control variates.
|
| 61 |
+
|
| 62 |
+
First, we consider the case where $b$ is continuous, but that $f$ cannot be differentiated. Instead of differentiating through $f$ , we build a surrogate of $f$ using a neural network $c _ { \phi }$ , and differentiate $c _ { \phi }$ instead. Since the score-function estimator and reparameterization estimator have the same expectation, we can simply subtract the score-function estimator for $c _ { \phi }$ and add back its reparameterization estimator. This gives a gradient estimator which we call LAX:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { l } { \hat { g } _ { \mathrm { L A X } } = \hat { g } _ { \mathrm { R E I N F O R C E } } [ f ] - \hat { g } _ { \mathrm { R E I N F O R C E } } [ c _ { \phi } ] + \hat { g } _ { \mathrm { r e p a r a m } } [ c _ { \phi } ] } \\ { = \left[ f ( b ) - c _ { \phi } ( b ) \right] \displaystyle \frac { \partial } { \partial \theta } \log p ( b | \theta ) + \frac { \partial } { \partial \theta } c _ { \phi } ( b ) \qquad b = T ( \theta , \epsilon ) , \epsilon \sim p ( \epsilon ) . } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
This estimator is unbiased for any choice of $c _ { \phi }$ . When $c _ { \phi } = f$ , then LAX becomes the reparameterization estimator for $f$ . Thus LAX can have variance at least as low as the reparameterization estimator. An example of the relative bias and variance of each term in this estimator can be seen below.
|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
Figure 2: Histograms of samples from the gradient estimators that create LAX. Samples generated from our one-layer VAE experiments (Section 6.2).
|
| 72 |
+
|
| 73 |
+
# 3.1 GRADIENT-BASED OPTIMIZATION OF THE CONTROL VARIATE
|
| 74 |
+
|
| 75 |
+
Since $\hat { g } _ { \mathrm { L A X } }$ is unbiased for any choice of the surrogate $c _ { \phi }$ , the only remaining problem is to choose a $c _ { \phi }$ that gives low variance to $\hat { g } _ { \mathrm { L A X } }$ . How can we find a $\phi$ which gives our estimator low variance? We simply optimize $c _ { \phi }$ using stochastic gradient descent, at the same time as we optimize the parameters $\theta$ of our model or policy.
|
| 76 |
+
|
| 77 |
+
To optimize $c _ { \phi }$ , we require the gradient of the variance of our estimator. To estimate these gradients, we could simply differentiate through the empirical variance over each mini-batch. Or, following Ruiz et al. (2016a) and Tucker et al. (2017), we can construct an unbiased, single-sample estimator using the fact that our gradient estimator is unbiased. For any unbiased gradient estimator $\hat { g }$ with parameters $\phi$ :
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
{ \frac { \partial } { \partial \phi } } \operatorname { V a r i a n c e } ( { \hat { g } } ) = { \frac { \partial } { \partial \phi } } \mathbb { E } [ { \hat { g } } ^ { 2 } ] - { \frac { \partial } { \partial \phi } } \mathbb { E } [ { \hat { g } } ] ^ { 2 } = { \frac { \partial } { \partial \phi } } \mathbb { E } [ { \hat { g } } ^ { 2 } ] = \mathbb { E } \left[ { \frac { \partial } { \partial \phi } } { \hat { g } } ^ { 2 } \right] .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Thus, an unbiased single-sample estimate of the gradient of the variance of $\hat { g }$ is given by $\partial \hat { g } ^ { 2 } / \partial \phi$
|
| 84 |
+
|
| 85 |
+
This method of directly minimizing the variance of the gradient estimator stands in contrast to other methods such as Q-Prop (Gu et al., 2016) and advantage actor-critic (Sutton et al., 2000), which train the control variate to minimize the squared error $( \check { f } ( b ) - c _ { \phi } ( b ) ) ^ { 2 }$ . Our algorithm, which jointly optimizes the parameters $\theta$ and the surrogate $c _ { \phi }$ is given in Algorithm 1.
|
| 86 |
+
|
| 87 |
+
# 3.1.1 OPTIMAL SURROGATE
|
| 88 |
+
|
| 89 |
+
What is the form of the variance-minimizing $c _ { \phi }$ ? Inspecting the square of (5), we can see that this loss encourages $c _ { \phi } ( b )$ to approximate $f ( b )$ , but with a weighting based on $\begin{array} { r } { \frac { \partial } { \partial \theta } \log p ( \boldsymbol { b } | \boldsymbol { \theta } ) } \end{array}$ . Moreover,
|
| 90 |
+
|
| 91 |
+
as $c _ { \phi } f$ then $\begin{array} { r } { \hat { g } _ { \mathrm { L A X } } \to \frac { \partial } { \partial \theta } c _ { \phi } } \end{array}$ . Thus, this objective encourages a balance between the variance of the reparameterization estimator and the variance of the REINFORCE estimator. Figure 3 shows the learned surrogate on a toy problem.
|
| 92 |
+
|
| 93 |
+
<table><tr><td colspan="2">Algorithm 1 LAX: Optimizing parameters and a gradient control variate simultaneously.</td></tr><tr><td colspan="2">Require: f(·),log p(b|θ), reparameterized sampler b = T(0,ε), neural network c(),</td></tr><tr><td colspan="2">step sizes α1, α2 while not converged do</td></tr><tr><td colspan="2">∈~p(∈)</td></tr><tr><td colspan="2">b←T(∈,0)</td></tr><tr><td colspan="2">g ←[f(b)-c(b)]∀θ logp(b|0)+∀θcΦ(b)</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2">g←0g/</td></tr><tr><td colspan="2">0←0-αige</td></tr><tr><td colspan="2">←Φ-α2gΦ</td></tr><tr><td colspan="2">end while return 0</td></tr></table>
|
| 94 |
+
|
| 95 |
+
# 3.2 DISCRETE RANDOM VARIABLES AND CONDITIONAL REPARAMETERIZATION
|
| 96 |
+
|
| 97 |
+
We can adapt the LAX estimator to the case where $b$ is a discrete random variable by introducing a “relaxed” continuous variable $z$ . We require a continuous, reparameterizable distribution $p ( z | \theta )$ and a deterministic mapping $H ( z )$ such that $\mathbf { \bar { \theta } } H ( z ) = b \sim p ( b | \theta )$ when $z \sim p ( z | \theta )$ . In our implementation, we use the Gumbel-softmax trick, the details of which can be found in appendix B.
|
| 98 |
+
|
| 99 |
+
The discrete version of the LAX estimator is given by:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\hat { g } _ { \mathrm { D L A X } } = f ( b ) \frac { \partial } { \partial \theta } \log p ( b | \theta ) - c _ { \phi } ( z ) \frac { \partial } { \partial \theta } \log p ( z | \theta ) + \frac { \partial } { \partial \theta } c _ { \phi } ( z ) , \qquad b = H ( z ) , z \sim p ( z | \theta ) .
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
This estimator is simple to implement and general. However, if we were able to replace the $\begin{array} { r } { \frac { \partial } { \partial \theta } \log p ( z | \theta ) } \end{array}$ in the control variate with $\begin{array} { r } { \frac { \partial } { \partial \theta } \log p ( \boldsymbol { b } | \boldsymbol { \theta } ) } \end{array}$ we should be able to achieve a more cornext estimator, which we call RELAX.
|
| 106 |
+
|
| 107 |
+
To construct a more powerful gradient estimator, we incorporate a further refinement due to Tucker et al. (2017). Specifically, we evaluate our control variate both at a relaxed input $z \sim p ( z | \theta )$ , and also at a relaxed input conditioned on the discrete variable $b$ , denoted $\tilde { z } \sim p ( z | b , \theta )$ . Doing so gives us:
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\begin{array} { r } { \hat { g } _ { \mathrm { R E L A X } } = \left[ f ( b ) - c _ { \phi } ( \tilde { z } ) \right] \displaystyle \frac { \partial } { \partial \theta } \log p ( b | \theta ) + \frac { \partial } { \partial \theta } c _ { \phi } ( z ) - \frac { \partial } { \partial \theta } c _ { \phi } ( \tilde { z } ) } \\ { b = H ( z ) , z \sim p ( z | \theta ) , \tilde { z } \sim p ( z | b , \theta ) } \end{array}
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
This estimator is unbiased for any $c _ { \phi }$ . A proof and a detailed algorithm can be found in appendix A. We note that the distribution $p ( z | b , \theta )$ must also be reparameterizable. We demonstrate how to perform this conditional reparameterization for Bernoulli and categorical random variables in appendix B.
|
| 114 |
+
|
| 115 |
+
# 3.3 CHOOSING THE CONTROL VARIATE ARCHITECTURE
|
| 116 |
+
|
| 117 |
+
The variance-reduction objective introduced above allows us to use any differentiable, parametric function as our control variate $c _ { \phi }$ . How should we choose the architecture of $c _ { \phi }$ ? Ideally, we will take advantage of any known structure in $f$ .
|
| 118 |
+
|
| 119 |
+
In the discrete setting, if $f$ is known and happens to be differentiable, we can use the concrete relaxation (Jang et al., 2016; Maddison et al., 2016) and let $c _ { \phi } ( z ) = f ( \sigma _ { \lambda } ( z ) )$ . In this special case, our estimator is exactly the REBAR estimator. We are also free to add a learned component to the concrete relaxation and let $c _ { \phi } ( z ) = f ( \sigma _ { \lambda } ( z ) ) + r _ { \rho } ( z )$ where $r _ { \rho }$ is a neural network with parameters $\rho$ making $\phi = \{ \rho , \lambda \}$ . We took this approach in our experiments training discrete variational autoencoders. If $f$ is unknown, we can simply let $c _ { \phi }$ be a generic function approximator such as a neural network. We took this simpler approach in our reinforcement learning experiments.
|
| 120 |
+
|
| 121 |
+
# 3.4 REINFORCEMENT LEARNING
|
| 122 |
+
|
| 123 |
+
We now describe how we apply the LAX estimator in the reinforcement learning (RL) setting. By reinforcement learning, we refer to the problem of optimizing the parameters $\theta$ of a policy distribution $\pi ( a | s , \theta )$ to maximize the sum of rewards. In this setting, the random variable being integrated over is $\tau$ , which denotes a series of $T$ actions and states $[ ( \bar { s } _ { 1 } , a _ { 1 } ) , ( s _ { 2 } , a _ { 2 } ) , . . . , ( s _ { T } , a _ { T } ) ]$ . The function whose expectation is being optimized, $R$ , maps $\tau$ to the sum of rewards $\begin{array} { r } { R ( \tau ) = \sum _ { t = 1 } ^ { T } r _ { t } \big ( s _ { t } , a _ { t } \big ) } \end{array}$ .
|
| 124 |
+
|
| 125 |
+
Again, we want to estimate the gradient of an expectation of a black-box function: The de facto standard approach is the advantage actor-critic estimator (A2C) (Sutt $\begin{array} { r } { \frac { \partial } { \partial \theta } \mathbb { E } _ { p ( \tau | \theta ) } [ R ( \tau ) ] } \end{array}$
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\hat { g } _ { \mathrm { A 2 C } } = \sum _ { t = 1 } ^ { T } \frac { \partial \log \pi ( a _ { t } | s _ { t } , \theta ) } { \partial \theta } \left[ \sum _ { t ^ { \prime } = t } ^ { T } r _ { t ^ { \prime } } - c _ { \phi } ( s _ { t } ) \right] , \qquad a _ { t } \sim \pi ( a _ { t } | s _ { t } , \theta )
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
Where $c _ { \phi } ( s _ { t } )$ is an estimate of the state-value function, $c _ { \phi } ( s ) \approx V ^ { \pi } ( s ) = \mathbb { E } _ { \tau } [ R | s _ { 1 } = s ]$ . This estimator is unbiased when $c _ { \phi }$ does not depend on $a _ { t }$ . The main limitations of A2C are that $c _ { \phi }$ does not depend on $a _ { t }$ , and that it’s not obvious how to optimize $c _ { \phi }$ . Using the LAX estimator addresses both of these problems.
|
| 132 |
+
|
| 133 |
+
First, we assume $\pi ( a _ { t } | s _ { t } , \theta )$ is reparameterizable, meaning that we can write $a _ { t } = a ( \epsilon _ { t } , s _ { t } , \theta )$ , where $\epsilon _ { t }$ does not depend on $\theta$ . We again introduce a differentiable surrogate $c _ { \phi } ( a , s )$ . Crucially, this surrogate is a function of the action as well as the state.
|
| 134 |
+
|
| 135 |
+
The extension of LAX to Markov decision processes is:
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\hat { g } _ { \mathrm { L A X } } ^ { \mathrm { R L } } = \sum _ { t = 1 } ^ { T } \frac { \partial \log \pi ( a _ { t } | s _ { t } , \theta ) } { \partial \theta } \left[ \sum _ { t ^ { \prime } = t } ^ { T } r _ { t ^ { \prime } } - c _ { \phi } ( a _ { t } , s _ { t } ) \right] + \frac { \partial } { \partial \theta } c _ { \phi } ( a _ { t } , s _ { t } ) ,
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
This estimator is unbiased if the true dynamics of the system are Markovian w.r.t. the state $s _ { t }$ When $T = 1$ , we recover the special case $\hat { g } _ { \mathrm { L A X } } ^ { \mathrm { R L } } = \hat { g } _ { \mathrm { L A X } }$ . Comparing $\hat { g } _ { \mathrm { L A X } } ^ { \mathrm { R L } }$ to the standard advantage actor-critic estimator in (9), the main difference is that our baseline $c _ { \phi } ( a _ { t } , s _ { t } )$ is action-dependent while still remaining unbiased.
|
| 142 |
+
|
| 143 |
+
To optimize the parameters $\phi$ of our control variate $c _ { \phi } ( a _ { t } , s _ { t } )$ , we can again use the single-sample estimator of the gradient of our estimator’s variance given in (6). This approach avoids unstable training dynamics, and doesn’t require storage and replay of previous rollouts.
|
| 144 |
+
|
| 145 |
+
Details of this derivation, as well as the discrete and conditionally reparameterized version of this estimator can be found in appendix C.
|
| 146 |
+
|
| 147 |
+
# 4 SCOPE AND LIMITATIONS
|
| 148 |
+
|
| 149 |
+
The work most related to ours is the recently-developed REBAR method (Tucker et al., 2017), which greatly inspired our work. The REBAR estimator is a special case of the RELAX estimator, when the surrogate is set to $c _ { \phi } ( z ) = \eta \cdot f ( \mathrm { s o f t m a x } _ { \lambda } ( z ) )$ . The only free parameters of the REBAR estimator are the scaling factor $\eta$ , and the temperature $\lambda$ , which gives limited scope to optimize the surrogate. REBAR can only be applied when $f$ is known and differentiable. Furthermore, it depends on essentially undefined behavior of the function being optimized, since it evaluates the discrete loss function at continuous inputs.
|
| 150 |
+
|
| 151 |
+
Because LAX and RELAX can construct a surrogate from scratch, they can be used for optimizing black-box functions, as in reinforcement learning settings where the reward is an unknown function of the environment. LAX and RELAX only require that we can query the function being optimized, and can sample from and differentiate $p ( b | \theta )$ .
|
| 152 |
+
|
| 153 |
+
Direct dependence on parameters Above, we assumed that the function $f$ being optimized does not depend directly on $\theta$ , which is usually the case in black-box optimization settings. However, a dependence on $\theta$ can occur when training probabilistic models, or when we add a regularizer. In both these settings, if the dependence on $\theta$ is known and differentiable, we can use the fact that
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
\frac { \partial } { \partial \theta } \mathbb { E } _ { p ( b | \theta ) } [ f ( b , \theta ) ] = \mathbb { E } _ { p ( b | \theta ) } \left[ \frac { \partial } { \partial \theta } f ( b , \theta ) + f ( b , \theta ) \frac { \partial } { \partial \theta } \log p ( b | \theta ) \right]
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
and simply add $\frac { \partial } { \partial \theta } f ( \boldsymbol { b } , \theta )$ to any of the gradient estimators above to recover an unbiased estimator.
|
| 160 |
+
|
| 161 |
+
# 5 RELATED WORK
|
| 162 |
+
|
| 163 |
+
Miller et al. (2017) reduce the variance of reparameterization gradients in an orthogonal way to ours by approximating the gradient-generating procedure with a simple model and using that model as a control variate. NVIL (Mnih & Gregor, 2014) and VIMCO (Mnih & Rezende, 2016) provide reduced variance gradient estimation in the special case of discrete latent variable models and discrete latent variable models with Monte Carlo objectives. Salimans et al. (2017) estimate gradients using a form of finite differences, evaluating hundreds of different parameter values in parallel to construct a gradient estimate. In contrast, our method is a single-sample estimator.
|
| 164 |
+
|
| 165 |
+
Staines & Barber (2012) address the general problem of developing gradient estimators for deterministic black-box functions or discrete optimization. They introduce a sampling distribution, and optimize an objective similar to ours. Wierstra et al. (2014) also introduce a sampling distribution to build a gradient estimator, and consider optimizing the sampling distribution. In the context of general Monte Carlo integration, Oates et al. (2017) introduce a non-parametric control variate that also leverages gradient information to reduce the variance of an estimator.
|
| 166 |
+
|
| 167 |
+
In parallel to our work, there has been a string of recent developments on action-dependent baselines for policy-gradient methods in reinforcement learning. Such works include Gu et al. (2016) and Gu et al. (2017) which train an action-dependent baseline which incorporates off-policy data. Liu et al. (2017) independently develop a method similar to LAX applied to continuous control. Wu et al. (2018) exploit per-dimension independence of the action distribution in continuous control tasks to produce an action-dependent unbiased baseline.
|
| 168 |
+
|
| 169 |
+
# 6 APPLICATIONS
|
| 170 |
+
|
| 171 |
+
We demonstrate the effectiveness of our estimator on a number of challenging optimization problems. Following Tucker et al. (2017) we begin with a simple toy example to illuminate the potential of our method and then continue to the more relevant problems of optimizing binary VAE’s and reinforcement learning.
|
| 172 |
+
|
| 173 |
+
# 6.1 TOY EXPERIMENT
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
REINFORCE
|
| 177 |
+
Figure 3: The optimal relaxation for a toy loss function, using different gradient estimators. Because REBAR uses the concrete relaxation of $f$ , which happens to be implemented as a quadratic function, the optimal relaxation is constrained to be a warped quadratic. In contrast, RELAX can choose a free-form relaxation.
|
| 178 |
+
|
| 179 |
+
As a simple example, we follow Tucker et al. (2017) in minimizing $\mathbb { E } _ { p ( b | \theta ) } [ ( b - t ) ^ { 2 } ]$ as a function of the parameter $\theta$ where $\begin{array} { r l } { p ( b | \theta ) = } \end{array}$ Bernoulli $( b | \theta )$ . Tucker et al. (2017) set the target $t ~ = ~ . 4 5$ . We focus on the more challenging case where $t = . 4 9 9$ . Figures 1a and 1b show the relative performance and gradient log-variance of REINFORCE, REBAR, and RELAX.
|
| 180 |
+
|
| 181 |
+
Figure 3 plots the learned surrogate $c _ { \phi }$ for a fixed value of $\theta$ . We can see that $c _ { \phi }$ is near $f$ for all $z$ , keeping the variance of the REINFORCE part of the estimator small. Moreover the deriva
|
| 182 |
+
|
| 183 |
+
tive of $c _ { \phi }$ is positive for all $z$ meaning that the reparameterization part of the estimator will produce gradients pointing in the correct direction to optimize the expectation. Conversely, the concrete relaxation of REBAR is close to $f$ only near 0 and 1 and its gradient points in the correct direction only for values of $\begin{array} { r } { z > \log ( \frac { 1 - t } { t } ) } \end{array}$ . These factors together result in the RELAX estimator achieving the best performance.
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 4: Training curves for the VAE Experiments with the one-layer linear model. The horizontal dashed line indicates the lowest validation error obtained by REBAR.
|
| 187 |
+
|
| 188 |
+
# 6.2 DISCRETE VARIATIONAL AUTOENCODER
|
| 189 |
+
|
| 190 |
+
Next, we evaluate the RELAX estimator on the task of training a variational autoencoder (Kingma & Welling, 2014; Rezende et al., 2014) with Bernoulli latent variables. We reproduced the variational autoencoder experiments from Tucker et al. (2017), training models with one or two layers of 200 Bernoulli random variables with linear or nonlinear mappings between them, on both the MNIST and Omniglot (Lake et al., 2015) datasets. Details of these models and our experimental procedure can be found in Appendix E.1.
|
| 191 |
+
|
| 192 |
+
To take advantage of the available structure in the loss function, we choose the form of our control variate to be $c _ { \phi } ( z ) = f ( \sigma _ { \lambda } ( z ) ) + \hat { r } _ { \rho } ( z )$ where $\hat { r } _ { \rho }$ is a neural network with parameters $\rho$ and $f ( \sigma _ { \lambda } ( z ) )$ is the discrete loss function, the evidence lower-bound (ELBO), evaluated at continuously relaxed inputs as in REBAR. In all experiments, the learned control variate improved the training performance, over the state-of-the-art baseline of REBAR. In both linear models, we achieved improved validation performance as well increased convergence speed. We believe the decrease in validation performance for the nonlinear models was due to overfitting caused by improved optimization of an under-regularized model. We leave exploring this phenomenon to further work.
|
| 193 |
+
|
| 194 |
+
Table 1: Highest training ELBO for discrete variational autoencoders.
|
| 195 |
+
|
| 196 |
+
<table><tr><td>Dataset</td><td>Model</td><td>Concrete</td><td>NVIL</td><td>MuProp</td><td>REBAR</td><td>RELAX</td></tr><tr><td rowspan="3">MNIST</td><td>Nonlinear</td><td>-102.2</td><td>-101.5</td><td>-101.1</td><td>-81.01</td><td>-78.13</td></tr><tr><td>linear one-layer</td><td>-111.3</td><td>-112.5</td><td>-111.7</td><td>-111.6</td><td>-111.20</td></tr><tr><td>linear two-layer</td><td>-99.62</td><td>-99.6</td><td>-99.07</td><td>-98.22</td><td>-98.00</td></tr><tr><td rowspan="3">Omniglot</td><td>Nonlinear</td><td>-110.4</td><td>-109.58</td><td>-108.72</td><td>-56.76</td><td>-56.12</td></tr><tr><td>linear one-layer</td><td>-117.23</td><td>-117.44</td><td>-117.09</td><td>-116.63</td><td>-116.57</td></tr><tr><td>linear two-layer</td><td>-109.95</td><td>-109.98</td><td>-109.55</td><td>-108.71</td><td>-108.54</td></tr></table>
|
| 197 |
+
|
| 198 |
+
To obtain training curves we created our own implementation of REBAR, which gave identical or slightly improved performance compared to the implementation of Tucker et al. (2017).
|
| 199 |
+
|
| 200 |
+
While we obtained a modest improvement in training and validation scores (tables 1 and 3), the most notable improvement provided by RELAX is in its rate of convergence. Training curves for all models can be seen in Figure 4 and in Appendix D. In Table 4 we compare the number of training epochs that are required to match the best validation score of REBAR. In both linear models, RELAX provides an increase in rate of convergence.
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
Figure 5: Top row: Reward curves. Bottom row: Log-variance of policy gradients. In each curve, the center line indicates the mean reward over 5 random seeds. The opaque bars in the top row indicate the 25th and 75th percentiles. The opaque bars in the bottom row indicate 1 standard deviation. Since the gradient estimator is defined at the end of each episode, we display log-variance per episode. After every 10th training episode 100 episodes were run and the sample log-variance is reported averaged over all policy parameters.
|
| 204 |
+
|
| 205 |
+
<table><tr><td>Model</td><td>Cart-pole</td><td>Lunar lander</td><td>Inverted pendulum</td></tr><tr><td>A2C</td><td>1152 ± 90</td><td>162374 ± 17241</td><td>6243 ± 164</td></tr><tr><td>LAX/RELAX</td><td>472 ± 114</td><td>68712 ± 20668</td><td>2067± 412</td></tr></table>
|
| 206 |
+
|
| 207 |
+
Table 2: Mean episodes to solve tasks. Definitions of solving each task can be found in Appendix E.
|
| 208 |
+
|
| 209 |
+
# 6.3 REINFORCEMENT LEARNING
|
| 210 |
+
|
| 211 |
+
We apply our gradient estimator to a few simple reinforcement learning environments with discrete and continuous actions. We use the RELAX and LAX estimators for discrete and continuous actions, respectively. We compare with the advantage actor-critic algorithm (A2C) (Sutton et al., 2000) as a baseline.
|
| 212 |
+
|
| 213 |
+
As our control variate does not have the same interpretation as the value function of A2C, it was not directly clear how to add reward bootstrapping and other variance reduction techniques common in RL into our model. For instance, to do reward bootstrapping, we would need to use the statevalue function. In the discrete experiments, due to the simplicity of the tasks, we chose not to use reward bootstrapping, and therefore omitted the use of state-value function. However, with the more complicated continuous tasks, we chose to use the value function to enable bootstrapping. In this case, the control variate takes the form: $c _ { \phi } ( a , s ) = V ( s ) + { \hat { c } } ( a , s )$ , where $V ( s )$ is trained as it would be in A2C. Full details of our experiments can be found in Appendix E.
|
| 214 |
+
|
| 215 |
+
In the discrete action setting, we test our approach on the Cart Pole and Lunar Lander environments as provided by the OpenAI gym (Brockman et al., 2016). In the continuous action setting, we test on the MuJoCo-simulated (Todorov et al., 2012) environment Inverted Pendulum also found in the OpenAI gym. In all tested environments we observe improved performance and sample efficiency using our method. The results of our experiments can be seen in Figure 5, and Table 2.
|
| 216 |
+
|
| 217 |
+
We found that our estimator produced policy gradients with drastically reduced variance (see Figure 5) allowing for larger learning rates to be used while maintaining stable training. In both discrete environments our estimator achieved greater than a 2-times speedup in convergence over the baseline.
|
| 218 |
+
|
| 219 |
+
# 7 CONCLUSIONS AND FUTURE WORK
|
| 220 |
+
|
| 221 |
+
In this work we synthesized and generalized several standard approaches for constructing gradient estimators. We proposed a generic gradient estimator that can be applied to expectations of known or black-box functions of discrete or continuous random variables, and adds little computational overhead. We also derived a simple extension to reinforcement learning in both discrete and continuous-action domains.
|
| 222 |
+
|
| 223 |
+
Future applications of this method could include training models with hard attention or memory indexing (Zaremba & Sutskever, 2015). One could also apply our estimators to continuous latentvariable models whose likelihood is non-differentiable, such as a 3D rendering engine. Extensions to the reparameterization gradient estimator (Ruiz et al., 2016b; Naesseth et al., 2017) could also be applied to increase the scope of distributions that can be modeled.
|
| 224 |
+
|
| 225 |
+
In the reinforcement learning setting, our method could be combined with other variance-reduction techniques such as generalized advantage estimation (Kimura et al., 2000; Schulman et al., 2015b), or other optimization methods, such as KFAC (Wu et al., 2017). One could also train our control variate off-policy, as in $Q$ -prop (Gu et al., 2016).
|
| 226 |
+
|
| 227 |
+
# ACKNOWLEDGEMENTS
|
| 228 |
+
|
| 229 |
+
We thank Dougal Maclaurin, Tian Qi Chen, Elliot Creager, and Bowen Xu for helpful discussions. We also thank Christopher Prohm for pointing out an error in one of our derivations. We would also like to thank George Tucker for pointing out a bug in our initially released reinforcement learning code.
|
| 230 |
+
|
| 231 |
+
# REFERENCES
|
| 232 |
+
|
| 233 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
|
| 234 |
+
|
| 235 |
+
Thomas Unterthiner Djork-Arne Clevert and Sepp Hochreiter. Fast and accurate deep network ´ learning by exponential linear units (elus). International Conference on Learning Representations, 2016.
|
| 236 |
+
|
| 237 |
+
Shixiang Gu, Timothy Lillicrap, Zoubin Ghahramani, Richard E Turner, and Sergey Levine. Q-prop: Sample-efficient policy gradient with an off-policy critic. arXiv preprint arXiv:1611.02247, 2016.
|
| 238 |
+
|
| 239 |
+
Shixiang Gu, Tim Lillicrap, Richard E Turner, Zoubin Ghahramani, Bernhard Scholkopf, and Sergey ¨ Levine. Interpolated policy gradient: Merging on-policy and off-policy gradient estimation for deep reinforcement learning. In Advances in Neural Information Processing Systems, pp. 3849–3858, 2017.
|
| 240 |
+
|
| 241 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
|
| 242 |
+
|
| 243 |
+
Hajime Kimura, Shigenobu Kobayashi, et al. An analysis of actor-critic algorithms using eligibility traces: reinforcement learning with imperfect value functions. Journal of Japanese Society for Artificial Intelligence, 15(2):267–275, 2000.
|
| 244 |
+
|
| 245 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015.
|
| 246 |
+
|
| 247 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational Bayes. International Conference on Learning Representations, 2014.
|
| 248 |
+
|
| 249 |
+
Brenden M Lake, Ruslan Salakhutdinov, and Joshua B Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015.
|
| 250 |
+
|
| 251 |
+
Hao Liu, Yihao Feng, Yi Mao, Dengyong Zhou, Jian Peng, and Qiang Liu. Sample-efficient policy optimization with stein control variate. arXiv preprint arXiv:1710.11198, 2017.
|
| 252 |
+
|
| 253 |
+
Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016.
|
| 254 |
+
|
| 255 |
+
Andrew C Miller, Nicholas J Foti, Alexander D’Amour, and Ryan P Adams. Reducing reparameterization gradient variance. arXiv preprint arXiv:1705.07880, 2017.
|
| 256 |
+
|
| 257 |
+
Andriy Mnih and Karol Gregor. Neural variational inference and learning in belief networks. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), pp. 1791–1799, 2014.
|
| 258 |
+
|
| 259 |
+
Andriy Mnih and Danilo Rezende. Variational inference for monte carlo objectives. In International Conference on Machine Learning, pp. 2188–2196, 2016.
|
| 260 |
+
|
| 261 |
+
Christian Naesseth, Francisco Ruiz, Scott Linderman, and David Blei. Reparameterization gradients through acceptance-rejection sampling algorithms. In Artificial Intelligence and Statistics, pp. 489–498, 2017.
|
| 262 |
+
|
| 263 |
+
Chris J Oates, Mark Girolami, and Nicolas Chopin. Control functionals for monte carlo integration. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 79(3):695–718, 2017.
|
| 264 |
+
|
| 265 |
+
Louis B Rall. Automatic differentiation: Techniques and applications. 1981.
|
| 266 |
+
|
| 267 |
+
Danilo J Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Proceedings of the 31st International Conference on Machine Learning, pp. 1278–1286, 2014.
|
| 268 |
+
|
| 269 |
+
Herbert Robbins and Sutton Monro. A stochastic approximation method. The annals of mathematical statistics, pp. 400–407, 1951.
|
| 270 |
+
|
| 271 |
+
Francisco J.R. Ruiz, Michalis K Titsias, and David M Blei. Overdispersed black-box variational inference. In Uuncertainty in Artificial Intelligence, 2016a.
|
| 272 |
+
|
| 273 |
+
Francisco R Ruiz, Michalis Titsias RC AUEB, and David Blei. The generalized reparameterization gradient. In Advances in Neural Information Processing Systems, pp. 460–468, 2016b.
|
| 274 |
+
|
| 275 |
+
David E Rumelhart and Geoffrey E Hinton. Learning representations by back-propagating errors. Nature, 323:9, 1986.
|
| 276 |
+
|
| 277 |
+
Tim Salimans, Jonathan Ho, Xi Chen, and Ilya Sutskever. Evolution strategies as a scalable alternative to reinforcement learning. arXiv preprint arXiv:1703.03864, 2017.
|
| 278 |
+
|
| 279 |
+
John Schulman, Nicolas Heess, Theophane Weber, and Pieter Abbeel. Gradient estimation using stochastic computation graphs. In Advances in Neural Information Processing Systems, pp. 3528– 3536, 2015a.
|
| 280 |
+
|
| 281 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. High-dimensional continuous control using generalized advantage estimation. arXiv preprint arXiv:1506.02438, 2015b.
|
| 282 |
+
|
| 283 |
+
Bert Speelpenning. Compiling Fast Partial Derivatives of Functions Given by Algorithms. PhD thesis, University of Illinois at Urbana-Champaign, 1980.
|
| 284 |
+
|
| 285 |
+
Joe Staines and David Barber. Variational optimization. arXiv preprint arXiv:1212.4507, 2012.
|
| 286 |
+
|
| 287 |
+
Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, pp. 1057–1063, 2000.
|
| 288 |
+
|
| 289 |
+
T. Tieleman and G. Hinton. Lecture 6.5—RmsProp: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural Networks for Machine Learning, 2012.
|
| 290 |
+
|
| 291 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on, pp. 5026– 5033. IEEE, 2012.
|
| 292 |
+
|
| 293 |
+
George Tucker, Andriy Mnih, Chris J Maddison, and Jascha Sohl-Dickstein. Rebar: Low-variance, unbiased gradient estimates for discrete latent variable models. arXiv preprint arXiv:1703.07370, 2017.
|
| 294 |
+
|
| 295 |
+
George Tucker, Surya Bhupatiraju, Shixiang Gu, Richard E Turner, Zoubin Ghahramani, and Sergey Levine. The mirage of action-dependent baselines in reinforcement learning. 2018.
|
| 296 |
+
|
| 297 |
+
Daan Wierstra, Tom Schaul, Tobias Glasmachers, Yi Sun, Jan Peters, and Jurgen Schmidhuber. ¨ Natural evolution strategies. Journal of Machine Learning Research, 15(1):949–980, 2014.
|
| 298 |
+
|
| 299 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
|
| 300 |
+
|
| 301 |
+
Cathy Wu, Aravind Rajeswaran, Yan Duan, Vikash Kumar, Alexandre M Bayen, Sham Kakade, Igor Mordatch, and Pieter Abbeel. Variance reduction for policy gradient with action-dependent factorized baselines. International Conference on Learning Representations, 2018.
|
| 302 |
+
|
| 303 |
+
Yuhuai Wu, Elman Mansimov, Shun Liao, Roger Grosse, and Jimmy Ba. Scalable trust-region method for deep reinforcement learning using kronecker-factored approximation. In Advances in neural information processing systems, 2017.
|
| 304 |
+
|
| 305 |
+
Wojciech Zaremba and Ilya Sutskever. Reinforcement learning neural turing machines-revised. arXiv preprint arXiv:1505.00521, 2015.
|
| 306 |
+
|
| 307 |
+
APPENDICES
|
| 308 |
+
|
| 309 |
+
# A THE RELAX ALGORITHM
|
| 310 |
+
|
| 311 |
+
Proof. We show that $\hat { g } _ { \mathrm { R E L A X } }$ is an unbiased estimator of $\begin{array} { r } { { \frac { \partial } { \partial \theta } } \mathbb { E } _ { p ( b \mid \theta ) } \left[ f ( b ) \right] } \end{array}$ . The estimator is
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\mathbb { E } _ { p ( b | \theta ) } \bigg [ \big [ f ( b ) - \mathbb { E } _ { p ( \tilde { z } | b , \theta ) } [ c _ { \phi } ( \tilde { z } ) ] \big ] \frac { \partial } { \partial \theta } \log p ( b | \theta ) - \frac { \partial } { \partial \theta } \mathbb { E } _ { p ( \tilde { z } | b , \theta ) } [ c _ { \phi } ( \tilde { z } ) ] \bigg ] + \frac { \partial } { \partial \theta } \mathbb { E } _ { p ( z | \theta ) } [ c _ { \phi } ( z ) ] .
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
Expanding the expectation for clarity of exposition, we account for each term in the estimator separately:
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\begin{array} { l } { \displaystyle \mathbb { E } _ { p ( b | \theta ) } \bigg [ f ( b ) \frac { \partial } { \partial \theta } \log p ( b | \theta ) \bigg ] } \\ { - \mathbb { E } _ { p ( b | \theta ) } \bigg [ \mathbb { E } _ { p ( z | b , \theta ) } [ c _ { \phi } ( \widetilde { z } ) ] \frac { \partial } { \partial \theta } \log p ( b | \theta ) \bigg ] } \\ { - \mathbb { E } _ { p ( b | \theta ) } \bigg [ \frac { \partial } { \partial \theta } \mathbb { E } _ { p ( \widetilde { z } | b , \theta ) } [ c _ { \phi } ( \widetilde { z } ) ] \bigg ] } \\ { + \frac { \partial } { \partial \theta } \mathbb { E } _ { p ( z | \theta ) } [ c _ { \phi } ( z ) ] . } \end{array}
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
Term (12) is an unbiased score-function estimator of $\begin{array} { r } { \frac { \partial } { \partial \theta } \mathbb { E } _ { p ( b \vert \theta ) } \left[ f ( b ) \right] } \end{array}$ . It remains to show that the other three terms are zero in expectation. Following Tucker et al. (2017) (see the appendices of that paper for a derivation), we rewrite term (14) as follows:
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\begin{array} { l } { - \mathbb { E } _ { p ( b | \theta ) } \left[ \displaystyle \frac { \partial } { \partial \theta } \mathbb { E } _ { p ( \tilde { z } | b , \theta ) } \left[ c _ { \phi } ( \tilde { z } ) \right] \right] = \mathbb { E } _ { p ( b | \theta ) } \left[ \mathbb { E } _ { p ( \tilde { z } | b , \theta ) } \left[ c _ { \phi } ( \tilde { z } ) \right] \displaystyle \frac { \partial } { \partial \theta } \log p ( b | \theta ) \right] } \\ { - \mathbb { E } _ { p ( z | \theta ) } \left[ c _ { \phi } ( z ) \displaystyle \frac { \partial } { \partial \theta } \log p ( z ) \right] . } \end{array}
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
Note that the first term on the right-hand side of equation (16) is equal to term (13) with opposite sign. The second term on the right-hand side of equation (16) is the score-function estimator of term (15), opposite in sign. The sum of these terms is zero in expectation.
|
| 330 |
+
|
| 331 |
+
<table><tr><td colspan="2">Algorithm 2 RELAX: Low-variance control variate optimization for black-box gradient estimation.</td></tr><tr><td colspan="2">Require: f(·),log p(b|0),reparameterized samplers b = H(z), z = S(ε,0) and = S(ε,0|b), neural network c(-), step sizes α1, α2</td></tr><tr><td colspan="2">while not converged do</td></tr><tr><td colspan="2">Ei,E~p(∈)</td></tr><tr><td colspan="2">z←S(∈,0)</td></tr><tr><td colspan="2">bi←H(zi)</td></tr><tr><td colspan="2">←S(i,0bi)</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2">gθ←[f(bi)-c(2)]Vθlogp+VθcΦ(zi)-Vθc(zi)</td></tr><tr><td colspan="2">g←g/</td></tr><tr><td colspan="2">0←0-αige</td></tr><tr><td colspan="2">←Φ-α2gΦ</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2">end while return 0</td></tr></table>
|
| 332 |
+
|
| 333 |
+
# B CONDITIONAL RE-SAMPLING FOR DISCRETE RANDOM VARIABLES
|
| 334 |
+
|
| 335 |
+
When applying the RELAX estimator to a function of discrete random variables $b \sim p ( b | \theta )$ , we require that there exists a distribution $p ( z | \theta )$ and a deterministic mapping $H ( z )$ such that if $z \sim p ( z | \theta )$
|
| 336 |
+
|
| 337 |
+
then $\begin{array} { r } { H ( z ) = b \sim p ( b | \theta ) } \end{array}$ . Treating both $b$ and $z$ as random, this procedure defines a probabilistic model $p ( b , z | \theta ) = p ( b | z ) p ( z | \theta )$ . The RELAX estimator requires reparameterized samples from $p ( z | \theta )$ and $p ( z | b , \theta )$ . We describe how to sample from these distributions in the common cases of $p ( b | \theta ) = \mathrm { B e r n o u l l i } ( \theta )$ and $p ( b | \theta ) = \mathrm { C a t e g o r i c a l } ( \theta )$ .
|
| 338 |
+
|
| 339 |
+
Bernoulli When $p ( b | \theta )$ is Bernoulli distribution we let $H ( z ) = \mathbb { I } ( z > 0 )$ and we sample from $p ( z | \theta )$ with
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
z = \log { \frac { \theta } { 1 - \theta } } + \log { \frac { u } { 1 - u } } , \qquad u \sim \mathrm { u n i f o r m } [ 0 , 1 ] .
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
We can sample from $p ( z | b , \theta )$ with
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\begin{array} { r } { v ^ { \prime } = \left\{ \begin{array} { l l } { v \cdot ( 1 - \theta ) } & { b = 0 } \\ { v \cdot \theta + ( 1 - \theta ) } & { b = 1 } \end{array} \right. } \end{array}
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
$$
|
| 352 |
+
\tilde { z } = \log \frac { \theta } { 1 - \theta } + \log \frac { v ^ { \prime } } { 1 - v ^ { \prime } } , \qquad v \sim \mathrm { u n i f o r m } [ 0 , 1 ] .
|
| 353 |
+
$$
|
| 354 |
+
|
| 355 |
+
Categorical When $p ( b | \theta )$ is a Categorical distribution where $\theta _ { i } = p ( b = i | \theta )$ , we let $H ( z ) =$ argmax $( z )$ and we sample from $p ( z | \theta ) \bar { }$ with
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
z = \log \theta - \log ( - \log u ) , \qquad u \sim \mathrm { u n i f o r m } [ 0 , 1 ] ^ { k }
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
where $k$ is the number of possible outcomes.
|
| 362 |
+
|
| 363 |
+
To sample from $p ( z | b , \theta )$ , we note that the distribution of the largest $\hat { z } _ { b }$ is independent of $\theta$ , and can be sampled as $\hat { z } _ { b } = - \log ( - \log v _ { b } )$ where $v _ { b } \sim \mathrm { u n i f o r m } [ 0 , 1 ]$ . Then, the remaining $v _ { i \neq b }$ can be sampled as before but with their underlying noise truncated so $\hat { z } _ { i \neq b } < \hat { z } _ { b }$ . As shown in the appendix of Tucker et al. (2017), we can then sample from $p ( z | b , \theta )$ with:
|
| 364 |
+
|
| 365 |
+
$$
|
| 366 |
+
\hat { z } _ { i } = \left\{ \begin{array} { l l } { - \log ( - \log v _ { i } ) } & { i = b } \\ { - \log \left( - \frac { \log v _ { i } } { \theta _ { i } } - \log v _ { b } \right) } & { i \neq b } \end{array} \right.
|
| 367 |
+
$$
|
| 368 |
+
|
| 369 |
+
where $v _ { i } \sim \mathrm { u n i f o r m } [ 0 , 1 ]$
|
| 370 |
+
|
| 371 |
+
# C DERIVATIONS OF ESTIMATORS USED IN REINFORCEMENT LEARNING
|
| 372 |
+
|
| 373 |
+
We give the derivation of the LAX estimator used for continuous RL tasks.
|
| 374 |
+
|
| 375 |
+
Theorem C.1. The LAX estimator,
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\hat { g } _ { \mathrm { L A X } } ^ { \mathrm { R L } } = \sum _ { t = 1 } ^ { T } \frac { \partial \log \pi ( a _ { t } | s _ { t } , \theta ) } { \partial \theta } \left[ \sum _ { t ^ { \prime } = t } ^ { T } r _ { t ^ { \prime } } - c _ { \phi } ( a _ { t } , s _ { t } ) \right] + \frac { \partial } { \partial \theta } c _ { \phi } ( a _ { t } , s _ { t } ) ,
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
is unbiased.
|
| 382 |
+
|
| 383 |
+
Proof. Note that by using the score-function estimator, for all $t$ , we have
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\mathbb { E } _ { p ( \tau ) } \Big [ \frac { \partial \log \pi ( a _ { t } | s _ { t } , \theta ) } { \partial \theta } c _ { \phi } ( a _ { t } , s _ { t } ) \Big ] = \mathbb { E } _ { p ( a _ { 1 : t - 1 } , s _ { 1 : t } ) } \Big [ \frac { \partial } { \partial \theta } \mathbb { E } _ { \pi ( a _ { t } | s _ { t } , \theta ) } \Big [ c _ { \phi } ( a _ { t } , s _ { t } ) \Big ] \Big ] .
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
Then, by adding and subtracting the same term, we have
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
\begin{array} { r l } { \gamma \mathbb { E } _ { p ( \tau ) } [ f ( \tau ) ] = \mathbb { E } _ { p ( \tau ) } \left[ f ( \tau ) \cdot \frac { \partial } { \partial \theta } \log p ( \tau ; \theta ) \right] - \displaystyle \sum _ { t } \mathbb { E } _ { p ( \tau ) } \left[ \frac { \partial | \log \pi \left( a _ { t } | s _ { t } , \theta \right) } { \partial \theta } c _ { \phi } ( a _ { t } , s _ { t } ) \right] + } & { } \\ & { \sum _ { t } \mathbb { E } _ { p ( a _ { 1 } , \dots , s _ { 1 } , \dots ) } \left[ \frac { \partial } { \partial \theta } \mathbb { E } _ { \kappa ( a _ { t } | s _ { t } , \theta ) } \left[ c _ { \phi } ( a _ { t } , s _ { t } ) \right] \right] } \\ & { = \mathbb { E } _ { p ( \tau ) } \left[ \displaystyle \sum _ { t = 1 } ^ { \infty } \frac { \partial | \log \pi \left( a _ { t } | s _ { t } , \theta \right) } { \partial \theta } \left( \displaystyle \sum _ { \nu = t } ^ { \infty } r _ { t } \cdot c _ { \phi } ( a _ { t } , s _ { t } ) \right) \right] } \\ & { \qquad + \displaystyle \sum _ { t } \mathbb { E } _ { p ( a _ { 1 } , \dots , s _ { 1 } , \dots ) } \left[ \mathbb { E } _ { p ( \epsilon ) } \left[ \frac { \partial } { \partial \theta } c _ { \phi } ( a _ { t } ( \epsilon _ { t } , s _ { t } , \theta ) , s _ { t } ) \right] \right] } \\ & { = \mathbb { E } _ { p ( \tau ) } \left[ \displaystyle \sum _ { k = 1 } ^ { \infty } \frac { \partial | \log \pi \left( a _ { t } | s _ { t } , \theta \right) } { \partial \theta } \left( \displaystyle \sum _ { \nu = t } ^ { \infty } r _ { t } \cdot c _ { \phi } ( a _ { t } , s _ { t } ) \right) + \frac { \partial } { \partial \theta } c _ { \phi } ( a _ { t } ( \epsilon _ { t } , s _ { t } , \theta ) , s _ { t } ) \right] } \end{array}
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
In the discrete control setting, our policy parameterizes a soft-max distribution which we use to sample actions. We define $z _ { t } \sim p ( z _ { t } | s _ { t } )$ , which is equal to $\sigma ( \log \pi - \log ( - \log ( u ) ) )$ where $u \sim$ uniform $[ 0 , 1 ]$ , $a _ { t } = \mathrm { a r g m a x } ( z _ { t } )$ , $\sigma$ is the soft-max function. We also define $\tilde { z } _ { t } \sim p \big ( \boldsymbol { z } _ { t } | \boldsymbol { a } _ { t } , \boldsymbol { s } _ { t } \big )$ and uses the same reparametrization trick for sampling $\tilde { z _ { t } }$ as explicated in Appendix B.
|
| 396 |
+
|
| 397 |
+
Theorem C.2. The RELAX estimator,
|
| 398 |
+
|
| 399 |
+
$$
|
| 400 |
+
\hat { g } _ { \mathrm { R E L A X } } ^ { \mathrm { R L } } = \sum _ { t = 1 } ^ { T } \frac { \partial \log \pi ( a _ { t } | s _ { t } , \theta ) } { \partial \theta } \left( \sum _ { t ^ { \prime } = t } ^ { T } r _ { t ^ { \prime } } - c _ { \phi } ( \tilde { z } _ { t } , s _ { t } ) \right) - \frac { \partial } { \partial \theta } c _ { \phi } ( \tilde { z } _ { t } , s _ { t } ) + \frac { \partial } { \partial \theta } c _ { \phi } ( z _ { t } , s _ { t } ) ,
|
| 401 |
+
$$
|
| 402 |
+
|
| 403 |
+
is unbiased.
|
| 404 |
+
|
| 405 |
+
Proof. Note that by using the score-function estimator, for all $t$ , we have
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
\begin{array} { r l } & { \mathbb { E } _ { p ( a _ { 1 : t } , s _ { 1 : t } ) } \Big [ \frac { \displaystyle \partial \log \pi ( a _ { t } | s _ { t } , \theta ) } { \displaystyle \partial \theta } \mathbb { E } _ { p ( z _ { t } | a _ { t } , s _ { t } ) } \big [ c _ { \phi } ( z _ { t } , s _ { t } ) \big ] \Big ] } \\ & { = \mathbb { E } _ { p ( a _ { 1 : t - 1 } , s _ { 1 : t } ) } \Big [ \frac { \displaystyle \partial } { \displaystyle \partial \theta } \mathbb { E } _ { \pi ( a _ { t } | s _ { t } , \theta ) } \Big [ \mathbb { E } _ { p ( z _ { t } | a _ { t } , s _ { t } ) } \big [ c _ { \phi } ( z _ { t } , s _ { t } ) \big ] \Big ] \Big ] } \\ & { = \mathbb { E } _ { p ( a _ { 1 : t - 1 } , s _ { 1 : t } ) } \Big [ \frac { \displaystyle \partial } { \displaystyle \partial \theta } \mathbb { E } _ { p ( z _ { t } | s _ { t } ) } \big [ c _ { \phi } ( z _ { t } , s _ { t } ) \big ] \Big ] } \end{array}
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
Then, by adding and subtracting the same term, we have
|
| 412 |
+
|
| 413 |
+
$$
|
| 414 |
+
\begin{array} { r l } { \frac { \mathcal { D } } { \partial \theta } \mathbb { E } _ { \theta \in \mathcal { S } } [ f ( \tau ) ] = \mathbb { E } _ { \theta \in \mathcal { S } } [ \int ( \tau ) - \frac { \delta } { \delta \theta } \log \theta \log | \frac { \delta } { \delta \theta } \log \theta | ] } \\ & { \quad - \sum _ { \theta \in \mathcal { S } _ { \theta \in \mathcal { S } - \cup \mathcal { S } _ { \theta } } } [ \frac { \Delta \log \theta \log ( \alpha | \delta | ) \Theta } { \delta \theta } \frac { \mathcal { D } } { \log \theta \sin \theta } \frac { \mathcal { D } } { \log \theta \sin \theta } | e _ { \theta \in \mathcal { S } _ { \theta } } \mathcal { S } _ { \theta } ] } \\ & { \quad \quad + \ \sum _ { \theta \in \mathcal { S } _ { \theta \in \mathcal { S } - \cup \mathcal { S } _ { \theta } } } [ \frac { \partial } { \delta \theta } \frac { \mathcal { D } } { \delta \theta } \log \theta ] [ \frac { \mathcal { D } } { \delta \theta } \mathcal { E } _ { \theta \in \mathcal { S } _ { \theta } } \log | \mathcal { E } _ { \theta } | ] } \\ & { = \mathbb { E } _ { \theta \in \mathcal { S } _ { \theta \in \mathcal { S } } } [ \sum _ { \theta \in \mathcal { S } _ { \theta } } \frac { \mathcal { D } \log \theta \log ( \alpha | \delta | ) \Theta } { \delta \theta } ( \sum _ { \theta = \pi } ^ { \infty } - \frac { \mathcal { D } } { \delta \theta } \log | \alpha | e _ { \theta } \mathcal { S } _ { \theta } ) ] ] } \\ & { \quad \quad + \ \sum _ { \theta \in \mathcal { S } _ { \theta \in \mathcal { S } - \cup \mathcal { S } _ { \theta } } } [ \frac { \delta } { \delta \theta } \log \theta ] ( \frac { \mathcal { D } } { \delta \theta } \log | e _ { \theta \in \mathcal { S } _ { \theta } } \log | \mathcal { E } _ { \theta } | ) } \\ & { = \mathbb { E } _ { \theta \in \mathcal { S } } [ \sum _ { \theta \in \mathcal { S } _ { \theta } } \frac { \partial } { \delta \theta } \log ( \alpha | \frac { \mathcal { D } } { \delta \theta } | ) \Theta ] } \\ & \quad \quad - \sum _ \theta \in \end{array}
|
| 415 |
+
$$
|
| 416 |
+
|
| 417 |
+
Since $p ( \boldsymbol { z } _ { t } | \boldsymbol { s } _ { t } )$ is reparametrizable, we obtain the estimator in Eq.(19).
|
| 418 |
+
|
| 419 |
+

|
| 420 |
+
Figure 6: Training curves for the VAE Experiments with the two-layer linear model. The horizontal dashed line indicates the lowest validation error obtained by REBAR.
|
| 421 |
+
|
| 422 |
+
D FURTHER RESULTS ON DISCRETE VARIATIONAL AUTOENCODERS
|
| 423 |
+
|
| 424 |
+
<table><tr><td>Dataset</td><td>Model</td><td>REBAR</td><td>RELAX</td></tr><tr><td>MNIST</td><td>one-layer linear two-layer linear Nonlinear</td><td>-114.32 -101.20 -111.12</td><td>-113.62 -100.85 119.19</td></tr><tr><td>Omniglot</td><td>one-layer linear two-layer linear Nonlinear</td><td>-122.44 -115.83 -127.51</td><td>-122.11 -115.42 128.20</td></tr></table>
|
| 425 |
+
|
| 426 |
+
Table 3: Highest obtained validation ELBO.
|
| 427 |
+
|
| 428 |
+
<table><tr><td>Dataset</td><td>Model</td><td>REBAR</td><td>RELAX</td></tr><tr><td>MNIST</td><td>one-layer two-layer Nonlinear</td><td>857 900 331</td><td>531 620 1</td></tr><tr><td>Omniglot</td><td>one-layer two-layer Nonlinear</td><td>2086 1027 368</td><td>566 673 1</td></tr></table>
|
| 429 |
+
|
| 430 |
+
Table 4: Epochs needed to achieve REBAR’s best validation score. “-” indicates that the nonlinear RELAX models achieved lower validation scores than REBAR.
|
| 431 |
+
|
| 432 |
+
# E EXPERIMENTAL DETAILS
|
| 433 |
+
|
| 434 |
+
# E.1 DISCRETE VAE
|
| 435 |
+
|
| 436 |
+
We run all models for 2, 000, 000 iterations with a batch size of 24. For the REBAR models, we tested learning rates in $\left. . 0 0 5 , . 0 0 1 , . 0 0 0 5 , . 0 0 0 1 , . 0 0 0 0 5 \right.$ .
|
| 437 |
+
|
| 438 |
+
RELAX adds more hyperparameters. These are the depth of the neural network component of our control variate $r _ { \rho }$ , the weight decay placed on the network, and the scaling on the learning rate for the control variate. We tested neural network models with $l$ layers of 200 units using the ReLU nonlinearity with $l \in \{ 2 , 4 \}$ . We trained the control variate with weight decay in $\{ . 0 0 1 , \bar { . 0 0 0 1 } \}$ . We trained the control variate with learning rate scaling in $\{ 1 , 1 0 \}$ .
|
| 439 |
+
|
| 440 |
+
To limit the size of hyperparameter search for the RELAX models, we only test the best performing learning rate for the REBAR baseline and the next largest learning rate in our search set. In many cases, we found that RELAX allowed our model to converge at learning rates which made the REBAR estimators diverge. We believe further improvement could be achieved by tuning this parameter. It should be noted that in our experiments, we found the RELAX method to be fairly insensitive to all hyperparameters other than learning rate. In general, we found the larger (4 layer) control variate architecture with weight decay of .001 and learning rate scaling of 1 to work best, but only slightly outperformed other configurations.
|
| 441 |
+
|
| 442 |
+

|
| 443 |
+
Figure 7: Training curves for the VAE Experiments with the one-layer nonlinear model. The horizontal dashed line indicates the lowest validation error obtained by REBAR.
|
| 444 |
+
|
| 445 |
+
All presented results are from the models which achieve the highest ELBO on the validation data.
|
| 446 |
+
|
| 447 |
+
# E.1.1 ONE-LAYER LINEAR MODEL
|
| 448 |
+
|
| 449 |
+
In the one-layer linear models we optimize the evidence lower bound (ELBO):
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\begin{array} { r } { \log p ( x ) \ge \mathcal { L } ( \theta ) = \mathbb { E } _ { q ( b \mid x ) } [ \log p ( x \mid b ) + \log p ( b ) - \log q ( b \mid x ) ] } \end{array}
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
where $q ( b _ { 1 } | x ) = \sigma ( x \cdot W _ { q } + \beta _ { q } )$ and $p ( \boldsymbol { x } | b _ { 1 } ) = \sigma ( b _ { 1 } \cdot W _ { p } + \beta _ { p } )$ with weight matrices $W _ { q } , W _ { p }$ and bias vectors $\beta _ { q } , \beta _ { p }$ . The parameters of the prior $p ( b )$ are also learned.
|
| 456 |
+
|
| 457 |
+
# E.1.2 TWO LAYER LINEAR MODEL
|
| 458 |
+
|
| 459 |
+
In the two layer linear models we optimize the ELBO
|
| 460 |
+
|
| 461 |
+
$$
|
| 462 |
+
\mathcal { L } ( \theta ) = \mathbb { E } _ { q ( b _ { 2 } | b _ { 1 } ) q ( b _ { 1 } | x ) } [ \log p ( x | b _ { 1 } ) + \log p ( b _ { 1 } | b _ { 2 } ) + \log p ( b _ { 2 } ) - \log q ( b _ { 1 } | x ) - \log q ( b _ { 2 } | b _ { 1 } ) ]
|
| 463 |
+
$$
|
| 464 |
+
|
| 465 |
+
where $q ( b _ { 1 } | x ) = \sigma ( x \cdot W _ { q _ { 1 } } + \beta _ { q _ { 1 } } )$ , $q ( b _ { 2 } | b _ { 1 } ) = \sigma ( b _ { 1 } \cdot W _ { q _ { 2 } } + \beta _ { q _ { 2 } } )$ , $p ( x | b _ { 1 } ) = \sigma ( b _ { 1 } \cdot W _ { p _ { 1 } } + \beta _ { p _ { 1 } } )$ , and $p ( b _ { 1 } | b _ { 2 } ) = \sigma ( b _ { 2 } \cdot W _ { p _ { 2 } } + \bar { \beta _ { p _ { 2 } } } )$ with weight matrices $W _ { q _ { 1 } } , W _ { q _ { 2 } } , W _ { p _ { 1 } } , W _ { p _ { 2 } }$ and biases $\beta _ { q _ { 1 } } , \beta _ { q _ { 2 } } , \beta _ { p _ { 1 } } , \beta _ { p _ { 2 } }$ As in the one-layer model, the prior $p ( b _ { 2 } )$ is also learned.
|
| 466 |
+
|
| 467 |
+
# E.1.3 NONLINEAR MODEL
|
| 468 |
+
|
| 469 |
+
In the one-layer nonlinear model, the mappings between random variables consist of 2 deterministic layers with 200 units using the hyperbolic-tangent nonlinearity followed by a linear layer with 200 units.
|
| 470 |
+
|
| 471 |
+
We run an identical hyperpameter search in all models.
|
| 472 |
+
|
| 473 |
+
# E.2 DISCRETE RL
|
| 474 |
+
|
| 475 |
+
In both the baseline A2C and RELAX models, the policy and control variate (value function in the baseline model) were two-layer neural networks with 10 units per layer. The ReLU non linearity was used on all layers except for the output layer which was linear.
|
| 476 |
+
|
| 477 |
+
For these tasks we estimate the policy gradient with a single Monte Carlo sample. We run one episode of the environment to completion, compute the discounted rewards, and run one iteration of gradient descent. We believe using larger batches will improve performance but would less clearly demonstrate the potential of our method.
|
| 478 |
+
|
| 479 |
+
Both models were trained with the RMSProp (Tieleman & Hinton, 2012) optimizer and a reward discount factor of .99 was used. Entropy regularization with a weight of .01 was used to encourage exploration.
|
| 480 |
+
|
| 481 |
+
Both models have 2 hyperparameters to tune; the global learning rate and the scaling factor on the learning rate for the control variate (or value function). We complete a grid search for both parameters in $\{ 0 . 0 1 , 0 . 0 0 3 , 0 . 0 0 1 \}$ and present the model which “solves” the task in the fewest number of episodes averaged over 5 random seeds. “Solving” the tasks was defined by the creators of the OpenAI gym (Brockman et al., 2016). The Cart Pole task is considered solved if the agent receives an average reward greater than 195 over 100 consecutive episodes. The Lunar Lander task is considered solved if the agent receives an average reward greater than 200 over 100 consecutive episodes.
|
| 482 |
+
|
| 483 |
+
The Cart Pole experiments were run for 250,000 frames. The Lunar Lander experiments were run for 5,000,000 frames.
|
| 484 |
+
|
| 485 |
+
The results presented for the CartPole and LunarLander environments were obtained using a slightly biased sampler for $p ( z | b , \theta )$ .
|
| 486 |
+
|
| 487 |
+
# E.3 CONTINUOUS RL
|
| 488 |
+
|
| 489 |
+
The three models- policy, value, and control variate, are two-layer neural networks with 64 hidden units per layer. The value and control variate networks are identical, with the ELU (Djork-Arne Clevert ´ & Hochreiter, 2016) nonlinearity in each hidden layer. The policy network has tanh nonlinearity. The policy network, which parameterizes the Gaussian policy comprises of a network (with the architecture mentioned above) that outputs the mean, and a separate, trainable log standard deviation value that is not input dependent. All three networks have a linear output layer. We selected the batch size to be 2500, meaning for a fixed timestep (2500) we collect multiple rollouts of a task and update the networks’ parameters with the batch of episodes. Per one policy update, we optimize both the value and control variate network multiple times. The number of times we train the value network is fixed to 25, while for the control variate, it was chosen to be a hyperparameter. All models were trained using ADAM (Kingma & Ba, 2015), with $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 9 9$ , and $\epsilon = 1 e - 0 8$ .
|
| 490 |
+
|
| 491 |
+
The baseline A2C case has 2 hyperparameters to tune: the learning rate for the optimizer for the policy and value network. A grid search was done over the set: $\{ 0 . 0 3 , 0 . 0 0 3 , 0 . \bar { 0 } 0 0 3 \}$ . RELAX has 4 hyperparameters to tune: 3 learning rates for the optimizer per network, and the number of training iterations of the control variate per policy gradient update. Due to the large number of hyperparameters, we restricted the size of the grid search set to $\lbrace 0 . 0 0 3 , 0 . 0 0 0 3 \rbrace$ for the learning rates, and $\{ 1 , 5 , 2 5 \}$ for the control variate training iteration number. We chose the hyperparameter setting that yielded the shortest episode-to-completion time averaged over 5 random seeds. As with the discrete case, we used the definition of completion provided by the OpenAI gym (Brockman et al., 2016) for each task.
|
| 492 |
+
|
| 493 |
+
The Inverted Pendulum experiments were run for 1,000,000 frames.
|
| 494 |
+
|
| 495 |
+
Tucker et al. (2018) pointed out a bug in our initially released code for the continuous RL experiments. This issue has been fixed in the publicly available code and the results presented in this paper were generated with the corrected code.
|
| 496 |
+
|
| 497 |
+
# E.3.1 IMPLEMENTATION CONSIDERATIONS
|
| 498 |
+
|
| 499 |
+
For continuous RL tasks, it is convention to employ a batch of a fixed number of timesteps (here, 2500) in which the number of episodes vary. We follow this convention for the sake of providing a fair comparison to the baseline. However, this causes a complication when calculating the variance loss for the control variate because we must compute the variance averaged over completed episodes, which is difficult to obtain when the number of episodes is not fixed. For this reason, in our implementation we compute the gradients for the control variate outside of the Tensorflow computation graph. However, for practical reasons we recommend using a batch of fixed number of episodes when using our method.
|
md/train/Tsp2PL7-GQ/Tsp2PL7-GQ.md
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Can You Learn an Algorithm? Generalizing from Easy to Hard Problems with Recurrent Networks
|
| 2 |
+
|
| 3 |
+
# Avi Schwarzschild
|
| 4 |
+
|
| 5 |
+
Department of Mathematics University of Maryland College Park, MD, USA avi1@umd.edu
|
| 6 |
+
|
| 7 |
+
Eitan Borgnia Department of Computer Science University of Maryland College Park, MD, USA
|
| 8 |
+
|
| 9 |
+
Arjun Gupta Department of Robotics University of Maryland College Park, MD, USA
|
| 10 |
+
|
| 11 |
+
Furong Huang Department of Computer Science University of Maryland College Park, MD, USA
|
| 12 |
+
|
| 13 |
+
Uzi Vishkin Department of Electrical and Computer Engineering University of Maryland College Park, MD, USA
|
| 14 |
+
|
| 15 |
+
Micah Goldblum Department of Computer Science University of Maryland College Park, MD, USA
|
| 16 |
+
|
| 17 |
+
Tom Goldstein Department of Computer Science University of Maryland College Park, MD, USA
|
| 18 |
+
|
| 19 |
+
# Abstract
|
| 20 |
+
|
| 21 |
+
Deep neural networks are powerful machines for visual pattern recognition, but reasoning tasks that are easy for humans may still be difficult for neural models. Humans possess the ability to extrapolate reasoning strategies learned on simple problems to solve harder examples, often by thinking for longer. For example, a person who has learned to solve small mazes can easily extend the very same search techniques to solve much larger mazes by spending more time. In computers, this behavior is often achieved through the use of algorithms, which scale to arbitrarily hard problem instances at the cost of more computation. In contrast, the sequential computing budget of feed-forward neural networks is limited by their depth, and networks trained on simple problems have no way of extending their reasoning to accommodate harder problems. In this work, we show that recurrent networks trained to solve simple problems with few recurrent steps can indeed solve much more complex problems simply by performing additional recurrences during inference. We demonstrate this algorithmic behavior of recurrent networks on prefix sum computation, mazes, and chess. In all three domains, networks trained on simple problem instances are able to extend their reasoning abilities at test time simply by “thinking for longer.”
|
| 22 |
+
|
| 23 |
+
# 1 Introduction
|
| 24 |
+
|
| 25 |
+
In computational theories of mind, an analytical problem is tackled by embedding it in “working memory” and then iteratively applying transformations to the representation until the problem is solved [Baddeley, 2012, Baddeley and Hitch, 1974]. Iterative processes underlie the human ability to solve sequential reasoning problems, such as complex question answering, proof writing, and even object classification $\lVert \underline { { \tilde { \mathrm { L i a o ~ a n d ~ P o g g i o } } } } \rVert \underline { { 2 0 1 6 } } \rVert \underline { { \tilde { \mathrm { K a r ~ e t ~ a l l } } } } \rVert \underline { { 2 0 1 9 } } \rVert$ . They also enable humans to extrapolate their knowledge to solve problems of potentially unbounded complexity, including harder problems than they have seen before, by thinking for longer.
|
| 26 |
+
|
| 27 |
+
This work examines whether recurrent neural networks trained on easy problems can extrapolate their knowledge to solve hard problems. We find that recurrent networks can indeed generalize to harder problems simply by increasing their test time iteration budget (i.e., thinking for longer than they did at train time). Moreover, we find that the performance of recurrent models improves as they recur for more iterations, even without adding parameters or re-training in the new, more challenging problem domain. This ability is specific to recurrent networks, as standard feed-forward networks rely on layer-specific behaviors that cannot be repeated to extend their reasoning power.
|
| 28 |
+
|
| 29 |
+
The behavior we observe in recurrent networks falls outside the classical notions of generalization in which models are trained and tested on the same distribution. Because we train and test on problems of different sizes/difficulties, our training and test distributions are disjoint, and systems must extrapolate to solve problems from the test distribution. Outside the field of machine learning, computers achieve a functionally similar extrapolation ability through the use of algorithms, which encode the process required to solve a class of problems, and can therefore scale to problems of arbitrary size, albeit with longer runtime.
|
| 30 |
+
|
| 31 |
+
By training networks to solve problems iteratively, we hope to find models that encode a scalable method for solving problems rather than memorizing a mapping between input features and outputs. In short, the goal is to create recurrent architectures that are capable of learning an algorithm.
|
| 32 |
+
|
| 33 |
+
Our focus is on three reasoning problems that are classically solved using hand-crafted algorithms: computing prefix sums, solving mazes, and playing chess. Sequential reasoning tasks like these are ideal for our study because one can directly quantify the difficulty of a problem instance. In the case of mazes, for example, we can easily swap to a more challenging domain by increasing the size of the search space.
|
| 34 |
+
|
| 35 |
+
For each class of problems, recurrent networks are trained on a set of “easy” problems using a fixed number of iterations of the recurrent module on the forward pass. After training is complete, we assess whether our models exhibit logical extrapolation behaviors by testing them on “hard” problems, with varying numbers of additional iterations. Remarkably, models trained on easy examples exhibit little extrapolative behavior until their iteration budget is increased — generalizing to harder problems requires thinking deeper. Moreover, we find recurrent models tested with a sufficient number of extra iterations outperform the inflexible feed-forward models of comparable depth, often by a wide margin. Finally, we visualize the iterative behavior of the recurrent module to gain insights into the problem solving process they discover.
|
| 36 |
+
|
| 37 |
+
# 1.1 Related works
|
| 38 |
+
|
| 39 |
+
Our investigation into generalizing from easy to hard examples builds on several bodies of work. Logical extrapolation encompasses a special kind of distributional shift. A number of existing works on domain generalization instead explore shifts, such as re-stylization and image corruptions, which do not represent an increase in scale or computational complexity [Arjovsky et al., 2019, Shu et al., $\boxed { 2 0 2 0 }$ . Also, the basic neural architectures we use are not new and build upon prior studies of weight sharing and recurrence [Pinheiro and Collobert, 2014, Liang and Hu, 2015, Alom et al., 2018, Bai et al., 2018, 2019, Lan et al., 2020, Jaegle et al., 2021]. Networks with variable numbers of test time iterations/layers have also been studied, including variable depth networks [Graves, 2016, Huang et al., 2016, Kaya et al., 2019, Eyzaguirre and Soto, 2020].
|
| 40 |
+
|
| 41 |
+
Existing work on algorithm learning involves recurrent neural network (RNN) based approaches. For example, neural turing machines and neural GPUs can learn simple algorithms for tasks such as binary addition and multiplication [Graves et al., 2014, Kaiser and Sutskever, 2015]. Like most RNNs, the compute budget for these methods is inextricably tied to input length. Motivated by the fact that input sequence length is not necessarily correlated with the computational burden required to solve a problem, $\boxed { \mathrm { G r a v e s } } \boxed { \sqrt { 2 0 1 6 } }$ develops a method for RNNs to adaptively select a compute time limit. This work considers only sequence inputs and shows the benefits of decoupling compute budget from input length. A differentiable extension of the technique can also be applied to visual question answering [Eyzaguirre and Soto, 2020]
|
| 42 |
+
|
| 43 |
+
The above works leverage neural networks with adaptive computation budgets to speed up and strengthen inference when learning on stationary distributions. In contrast, our work studies the logical extrapolation behaviors that recurrent networks possess when both computation budgets and problem difficulties are extended beyond the train-time regime. In the domain of constraint satisfiability problems (CSPs), Selsam et al. [2018] show message passing neural networks trained on small CSPs can generalize to larger problems if more messages are passed at test-time – a similar type of extrapolation to our methods, but for a very specific problem formulation.
|
| 44 |
+
|
| 45 |
+
The particular problems we use to study this type of extrapolation include prefix sum computation and maze solving, two problems analyzed in the classical algorithms literature. For example, there are many ways to solve mazes, both classical (e.g. breadth first search) and learned (e.g. value iteration networks), but our goal is not to develop the best solver, rather to use mazes as a test bed for logical extrapolation $\overline { { \| \mathrm { T a m a r ~ e t ~ a l . } \| 2 0 1 6 } } $ . Our third case study is the game of chess, which has also been the focus of much artificial intelligence work [Romstad et al., Biswas and Regan, 2015, Silver et al., 2017, McIlroy-Young et al., 2020]. However, those efforts to play chess rely heavily on hand-crafted search algorithms, often paired with neural networks or opening books, and aim to play games from start to finish, both methods and goals that diverge from ours. As opposed to hard-coded algorithms, which scale by design, we are interested in studying whether learned processes can generalize from the data on which they are trained to even harder problems.
|
| 46 |
+
|
| 47 |
+
# 2 Dataset descriptions
|
| 48 |
+
|
| 49 |
+
We conduct experiments in three problem domains that are classically solved using hand-crafted algorithms. For each, we define datasets that have quantifiable notions of difficulty. This makes it possible to train models on easy/small examples and test them on harder/larger ones. We consider the task of computing prefix sums modulo two of binary bit strings, solving two-dimensional mazes, and finding the best move in chess puzzles.
|
| 50 |
+
|
| 51 |
+
Prefix sums This problem is inspired by a similar dataset used by $\widetilde { | \mathrm { G r a v e s } | } \widetilde { | 2 0 1 6 | }$ . Each training sample is a binary string. The goal is to output a binary string of equal length, where each bit represents the cumulative sum of input bits modulo two. Our models accept input strings of any size, and we consider longer strings to be more difficult to process than shorter ones. Each dataset contains 10,000 uniform random binary strings without duplicates. We use datasets with input lengths of 32, 44, and 48 bits. See Figure 1 for an example input and the corresponding target output.
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
Figure 1: Prefix sum input and target example.
|
| 55 |
+
|
| 56 |
+
Mazes We consider mazes generated using a depth-first search algorithm $\underline { { \ [ \mathrm { H i l l } ] [ 2 0 1 7 ] } }$ We train on 50,000 small $( 9 \times 9 )$ mazes, and we test on 10,000 larger $( 1 3 \times 1 3 )$ mazes. Our models are convolutional, and receive a maze as a $N \times N$ three-channel image, where the maze walls are black, and the start and goal locations are red and green, respectively. The label for each maze is a binary two-dimensional mask containing the locations of positions along the shortest path solution. Our models output a two logits per pixel which are then thresholded to a binary mask of the whole input, and we consider a candidate solution correct only if it exactly predicts the labeled path. See Figure 10 for an example. More examples are available in Appendix A.1.2.
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 2: An example maze input and target. The target is a binary classification label for each pixel indicating on/off the optimal path.
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
Figure 3: An example of a chess puzzle input (left) and target (right). In the target, white represents one and black is zero.
|
| 63 |
+
|
| 64 |
+
Chess puzzles The third dataset we use is a corpus of chess puzzles. The data is furnished by Lichess, an online open-source chess server [Lichess, 2021]. From billions of games, Lichess compiles “puzzles” – mid-game boards for which a sequence of unique best moves is determinable (e.g. sequences of moves leading to a forced checkmate). From this database, we compiled labeled data where the inputs are $8 \times 8 \times 1 2$ arrays indicating the position of each piece on the board (one channel per piece type and color) and the outputs are $8 \times 8$ binary masks showing the origin and destination positions for the optimal move. See the example in Figure 3, where it is white to move and the solution to the puzzle is to move the queen from F3 to F7.
|
| 65 |
+
|
| 66 |
+
The puzzles each have a difficulty rating determined by an Elo-like system (a standard system for rating players using tournament play) $\boxed { \boxed { \mathrm { E l o } } \boxed { 1 9 7 8 } }$ . When Lichess users, each with an Elo rating, attempt to solve the puzzle, the rating of the player and puzzle is updated as if they “played” against each other. After enough players encounter the puzzle, the rating of the puzzle reaches an equilibrium which gets recorded in the database. We use these ratings to distinguish between easy and hard; 600,000 puzzles of difficulty rating less than 1,385 are used for training, and testing is performed on 100,000 examples with ratings greater than 1,385.
|
| 67 |
+
|
| 68 |
+
Our models output a confidence score between zero and one for each square on the board. We take the two highest scores and compare their locations to the target to measure correctness – only exact matches are considered correct.
|
| 69 |
+
|
| 70 |
+
# 3 Model architectures & training
|
| 71 |
+
|
| 72 |
+
In all of the experiments in this work, we employ network architectures based on ResNets [He et al., $\bigstar$ . Our feed-forward networks are slight deviations from the most commonly used ResNets, in that the width does not change except at the first layer and after the last residual block, and we do not use batch normalization. This is done so that the recurrent models, whose internal recurrent module has the same input and output dimensions, can be as similar as possible to the feed-forward ResNets. In fact, the only difference during training between a feed-forward and recurrent model of the same effective depth is that the weights are shared between the residual blocks in the recurrent models. We refer to the recurrent portion of the network as the recurrent module. Also, our models are fully convolutional with no fully connected heads. For solving prefix sums, which involves onedimensional strings, we further deviate from classical ResNets by using one-dimensional convolutions. For complete architectural details, see Appendix A.2.
|
| 73 |
+
|
| 74 |
+
We measure recurrent models in terms of iterations and effective depth. An iteration is a repetition of the recurrent residual block, which contains four layers in all of our models. Therefore, the effective depth is equal to four times the number of iterations, plus non-recurrent encoder and head layers that sandwich the recurrent module. For example, the models used for computing prefix sums have one convolutional encoder layer, followed by the recurrent block and then by a three layer convolutional head. In this case, a 10-iteration model has effective depth $1 + 1 0 \times 4 + 3 = 4 4$ layers.
|
| 75 |
+
|
| 76 |
+
For each training sample we consider, the label is an array of binary classification variables, one per input pixel. The training loss is simply the mean cross-entropy loss across output values. In general, hyperparameters were determined with the goal of finding convergent models. The specific batch sizes, learning rate and decay schedules, and other hyperparameter values are all available in Appendix A.3. 1
|
| 77 |
+
|
| 78 |
+
# 4 Recurrent networks can generalize from easy to hard problems
|
| 79 |
+
|
| 80 |
+
We explore the ability of recurrent neural networks to generalize to more difficult problems simply by thinking deeper. To this end, we train models of varying effective depth on easy training examples and test them on harder problems. We find that recurrent models are even better at generalizing from easy to hard than their feed-forward counterparts. While there is only one way to test the feed-forward models, we take a closer look at what happens when the recurrent models are allowed to think deeper about the harder problems. Formally, we use more iterations of the recurrent module within the recurrent models when performing inference on test data. Across all three problem types, we find that the confidence of the model is a good surrogate for correctness. Therefore, when evaluating recurrent models, we use the output from the iteration to which the network assigns the highest confidence.
|
| 81 |
+
|
| 82 |
+
# 4.1 Prefix sums
|
| 83 |
+
|
| 84 |
+
The first task on which we demonstrate the ability of recurrent neural networks to learn an algorithm is one from the classical algorithms literature, namely computing prefix sums. Specifically, we study the problem of computing the prefix sums modulo two of binary input strings.
|
| 85 |
+
|
| 86 |
+
When computing prefix sums, we employ models with effective depths from 40 to 68 layers. We train models on easy data consisting of 32-bit input strings and test on harder 40-bit and 44-bit strings. In Table 1, it is clear that even when holding the depth constant at test time, recurrent models generalize from easy to hard better than feed-forward networks.
|
| 87 |
+
|
| 88 |
+
Table 1: Extrapolating to longer input strings. Shown here are the average accuracies of models trained on 32-bit inputs and tested on 40-bit inputs. The effective depths listed below correspond to 9, 10, and 11 iterations in recurrent models. We report average accuracy $\pm$ one standard error.
|
| 89 |
+
|
| 90 |
+
<table><tr><td></td><td colspan="3">Effective Depth (Layers)</td></tr><tr><td></td><td>40</td><td>44</td><td>48</td></tr><tr><td>Recurrent</td><td>24.96± 2.96</td><td>31.02 ± 2.56</td><td>35.22 ± 3.34</td></tr><tr><td>Feed-forward</td><td>22.17 ± 0.85</td><td>24.78 ± 1.65</td><td>22.79 ± 1.32</td></tr></table>
|
| 91 |
+
|
| 92 |
+

|
| 93 |
+
Figure 4: Generalizing from easy to hard prefix sums. The ability of networks to compute prefix sums on two test sets with longer input strings than were used for training (accuracy on 40-bit inputs in purple and on 44-bit inputs in red). We compare recurrent models to the best feed-forward models of comparable effective depth. The markers are at average values from several trials and the shaded regions indicate $\pm$ one standard error.
|
| 94 |
+
|
| 95 |
+
When the thought budget, or number of iterations, is increased, we see that recurrent models can get upwards of $90 \%$ of the harder testing examples correct. In Figure 4, we observe this large boost in the recurrent models’ performance and a vast difference in the accuracy of recurrent models (with added iterations at test time) and feed-forward networks. Note that the dotted lines represent the average accuracy of the deepest feed-forward networks considered. That depth is 68 layers, or the effective depth of recurrent models with 16 iterations, and we use this baseline in the plot specifically because in the range of depths corresponding to the numbers of iterations shown, these feed-forward models achieve the highest accuracy. In other words, recurrent models trained with relatively few iterations generalize well to harder data while similar and even much larger feed-forward networks fail to generalize in the same scenario.
|
| 96 |
+
|
| 97 |
+
The generalization we see in Figure 4 indicates that these recurrent models learn processes that can be extended to harder problems by running for more iterations. In particular, the recurrence is both the machinery that allows for varying the depth at test time, as well as a force at training to push the model to find parameters that make progress toward a solution with each reuse.
|
| 98 |
+
|
| 99 |
+
When these results are viewed through the lens of algorithm design, one might wonder how the receptive field, or the number of entries in the input that determine a single entry in the output, affects these models. The feed-forward models, whose accuracies are shown in Figure 4, have the same receptive field as the recurrent models when tested with 16 iterations. This makes it clear that the increase in accuracy of recurrent models does not simply occur because the receptive field grows with added iterations, rather it occurs because they have learned a process that can extrapolate beyond the training distribution. Further discussion on receptive field is presented in Appendix B.
|
| 100 |
+
|
| 101 |
+
# 4.1.1 Iterative outputs
|
| 102 |
+
|
| 103 |
+
One way to dissect the learned process and compare it to known algorithms is to plot the confidence of the model at each iteration. In Figure $\boxed { 5 }$ we show a representative example of a network’s confidence that each bit in the output is a one. Two striking observations can be made from this figure. The first is that the model is progressing to the solution with each iteration. The second observation is that it is resolving the prefix sum in the earlier bits first and moving down the string, settling on the final bits only in the last iteration. This is remarkably similar to a naive algorithm one might implement for this task that marches from the first index until the end of the string computing prefix sums in order.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 5: A recurrent model’s output from each of 11 iterations on a 40-bit input string. Shown here is the confidence that there is a 1 at each index of the output. The first index is at the top for all vectors, the input is in the left-most column and the target is in the right-most column. The model used to produce this plot was trained with fewer iterations (10) on shorter input strings (32-bit).
|
| 107 |
+
|
| 108 |
+
# 4.2 Mazes
|
| 109 |
+
|
| 110 |
+
For maze solving, we train models on a training set composed of the easier small mazes, and we investigate the ability of networks to make the leap to larger, or harder, mazes at test time. In line with the findings above, we show two important behaviors. First, the recurrent models make the leap from small to large mazes better than feed-forward models. Second, when allowed to think deeper, the recurrent models exhibit even higher performance.
|
| 111 |
+
|
| 112 |
+
The networks employed here are fully convolutional and have 512 channels in the internal layers. In assessing the confidence of a given output, we average each pixel’s classification confidence.
|
| 113 |
+
|
| 114 |
+
Table 2 shows that for a fixed effective depth, recurrent models always generalize to the hard mazes better than their feed-forward counterparts. Inspired by the upward trend in Table 2, we shift focus to deeper models. In Figure $_ { . . } ^ { 6 , }$ we show that recurrent models can extrapolate to harder problems better than feed forward models. When trained on small mazes with 20 iterations (effective depth of 84 layers), these networks can solve about half of large mazes. However, when allowed to think for longer, the recurrent models can correctly solve an even higher proportion of large mazes. In fact, models trained with 20 iterations can achieve upward of $70 \%$ accuracy on large mazes using 5 additional iterations at test time.
|
| 115 |
+
|
| 116 |
+
Table 2: The average accuracy $( \% )$ of models trained on small mazes and tested on large ones. Over a range of effective depths, we see that recurrent models generalize to the harder mazes better than their feed-forward counterparts. Figures reflect averages over several trials $\pm$ one standard error.
|
| 117 |
+
|
| 118 |
+
<table><tr><td></td><td colspan="5">Effective Depth</td></tr><tr><td></td><td>20</td><td>24</td><td>28</td><td>36</td><td>44</td></tr><tr><td>Recurrent</td><td>12.66 ± 0.44</td><td>14.02 ± 0.39</td><td>19.95 ± 0.31</td><td>22.96 ± 1.03</td><td>29.72 ± 1.22</td></tr><tr><td>Feed-forward</td><td>7.94 ± 0.36</td><td>12.43 ± 0.50</td><td>14.67 ± 0.54</td><td>17.71 ± 0.36</td><td>22.53 ± 1.14</td></tr></table>
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 6: Generalizing from easy to hard mazes. We compare recurrent models to the best feedforward models. The markers are at average values from several trials and the shaded regions indicate $\pm$ one standard error.
|
| 122 |
+
|
| 123 |
+
Maze solving is another task for which global information is needed. We investigate how dilated filters affect model performance. Dilation is a way of changing the receptive field without adding new parameters or more depth. Table $\textcircled { 3 }$ shows that dilations lead to slight improvements, however, the benefits of recurrence are still abundantly clear. Indeed, the difference in performance is even larger.
|
| 124 |
+
|
| 125 |
+
Table 3: The average accuracy $( \% )$ of models with dilated filters trained on small mazes and tested on large ones. Figures reflect averages over several trials $\pm$ one standard deviation.
|
| 126 |
+
|
| 127 |
+
<table><tr><td></td><td colspan="5">Effective Depth</td></tr><tr><td></td><td>20</td><td>24</td><td>28</td><td>32</td><td>36</td></tr><tr><td>Recurrent</td><td>33.60±1.06</td><td>40.49 ± 1.63</td><td>33.91 ± 1.99</td><td>40.56± 4.34</td><td>50.50± 7.97</td></tr><tr><td>Feed-forward</td><td>19.73 ± 0.72</td><td>21.59 ± 0.22</td><td>24.18 ± 1.33</td><td>25.82 ± 0.10</td><td>26.54 ± 2.13</td></tr></table>
|
| 128 |
+
|
| 129 |
+
# 4.2.1 Iterative outputs
|
| 130 |
+
|
| 131 |
+
The recurrent maze solving networks also produce output at every iteration. Examining this output again leads to a remarkable conclusion: these recurrent models are narrowing in on the answer with each successive iteration. In Figure $\bigstar$ it is clear from the output on iteration four that the network has found two routes emanating from the red square. Moving through the iterations, the model refines the output, increasing the confidence for pixels on the path and decreasing the others until finally at Iteration $\# 7$ , the output matches the target. It is also interesting to observe here that the output is consistently correct for two iterations, after which a few pixels flip (Iteration #9).
|
| 132 |
+
|
| 133 |
+

|
| 134 |
+
Figure 7: Input, target, and outputs from different iterations are shown to highlight the model’s ability to think sequentially about mazes. We plot the model’s confidence that each pixel belongs to the optimal path. This is a representative example from a model trained to solve small mazes in six iterations.
|
| 135 |
+
|
| 136 |
+
# 4.3 Chess puzzles
|
| 137 |
+
|
| 138 |
+
The third dataset comprises chess puzzles, or mid-game chess boards for which we seek the best next move. Unlike the other two datasets, the state of the art for chess playing algorithms is complex and has components that use algorithms like Monte Carlo tree search as well as neural network based elements for evaluating positions $\mathbf { \underline { { \{ R o m s t a d e t ~ a l . \} } } \mathbf { \underline { { \{ S i l v e r ~ e t ~ a l . \} } } } \mathbf { \underline { { \{ 2 0 1 7 \} } } } }$ . The complicated nature of these systems provides some context for how difficult these puzzles are. What makes these puzzles particularly useful for us is that there is a predetermined best next move. A move is defined as an origin square, or the current location of the piece to be moved, and a destination square $\bigstar \bigstar \mathrm { I n }$ order to generate target outputs for our models, we define a move as an $8 \times 8$ array with zeros everywhere except at the entries corresponding to the origin and destination squares which are ones.
|
| 139 |
+
|
| 140 |
+
We compare recurrent and feed-forward networks of effective depths from 84 layers to 100 layers that take $8 \times 8 \times 1 2$ arrays as input. These fully convolutional networks have 512 channels in the internal layers, and the output is $8 \times 8 \times 2$ , corresponding to binary classification at each input pixel. During training, we use an average of cross-entropy losses at every pixel. When evaluating these models, however, we define the predicted move by the locations of the two highest confidence scores.
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 8: Generalizing from easy to hard chess puzzles. The ability of networks to solve harder puzzles than were used for training. We compare recurrent models to the best feed-forward models of comparable effective depth. The markers are at average values from several trials and the shaded region indicate $\pm$ one standard error.
|
| 144 |
+
|
| 145 |
+
Once again, we see that recurrent models can solve more chess puzzles than their feed forward counterparts. Furthermore, by thinking deeper at test time, recurrent models can perform even better. While the gains shown in Figure 8 are modest in comparison to the other two problem settings, the trend is clear – recurrent models can solve more puzzles with more iterations.
|
| 146 |
+
|
| 147 |
+
# 4.3.1 Iterative outputs
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 9: Input, target, and outputs form different iterations are shown to highlight the model’s ability to think about the next move. We plot the model’s confidence that each pixel is one of the two that define a move. In this example, black is to move next. For space consideration, iterations 2-14, which look like the first iteration, are left out of this plot. More examples are available in Appendix C.
|
| 151 |
+
|
| 152 |
+
While the outputs from the other two datasets show the similarity between the learned iterative process and known sum and search algorithms, extracting that insight on chess puzzles is much more difficult. Partly, this is because exploiting known search algorithms on such a large search space is hard to visualize. Nonetheless, the network’s output, shown in Figure 9, tells a fascinating story. First, the Iteration #1 plot shows that after one iteration, we observe equal confidence at every location on the board. In the next frame, Iteration $\# 1 5$ , it is clear that the model is considering moving the D8 rook to multiple squares, and it also considers the intuitive idea of using the E5 queen to place the white king in check on H2. With each successive iteration, the network becomes more confident – first that the rook is the correct piece to move, and then where to move it to.
|
| 153 |
+
|
| 154 |
+
# 5 Discussion
|
| 155 |
+
|
| 156 |
+
More than an answer, the results and conclusions in this paper are posing a question: Can learned models behave like classical algorithms in the way they generalize to harder or larger problems?
|
| 157 |
+
|
| 158 |
+
Our discussion of this question and our observations begins with delineating the limitations of our work. The first major limitation is that we do not propose a definitive answer. Rather, using representative cases, we demonstrate that recurrence can help neural models make the leap from easy training data to hard testing examples. A more subtle limitation of our work lies in how we split the data by difficulty. For prefix sum computation and for mazes, the classical algorithms approach to measuring problem complexity is tied to problem size, so in those settings we make intuitive easy/hard splits. With chess however, the issue is much more complex. Should puzzles with higher ratings require more memory or more computation? We carry out our work assuming the answer is yes, but we remain open minded to the possibility that the ratings assigned by Lichess may be weak surrogates for algorithmic complexity of each puzzle. In short, chess is an extremely difficult domain to analyze.
|
| 159 |
+
|
| 160 |
+
The observations above indicate that iterative models can learn processes that generalize beyond the training distribution with more iterations. One exciting use case is when the testing distribution is inaccessible, a setting where training on the harder distribution itself would be impossible. Many real life scenarios demand exactly this type of problem solving, from robots deployed in the real world after training in simulation to humans who spend a lot of time practicing on easy math problems only to spend years on difficult unsolved questions.
|
| 161 |
+
|
| 162 |
+
On a conceptual level, the recurrent model behavior we show is analogous to the human behavior of manipulating representations in working memory; in this analogy, the recurrent block performs the transformations and the activations it generates are the memory. It is not the goal of the experiments here to suggest that iterative models use mechanisms similar to those in a human brain. Nonetheless, it is exciting to see, even in a proof of concept setting, neural models that appear to deliberate on a problem until it is solved and can extend their abilities by thinking for longer.
|
| 163 |
+
|
| 164 |
+
This raises a questions that motivates future work. Can we build neural networks that can think for even longer? Is it feasible to have models whose performance only increases with added compute time? Humans who are given more than enough time to solve a maze, will not suddenly get it wrong after arriving at the right answer, perhaps this awareness of when to stop thinking can be built into networks like the ones we study here.
|
| 165 |
+
|
| 166 |
+
# 6 Conclusion
|
| 167 |
+
|
| 168 |
+
In this work, we demonstrate that neural networks are capable of solving sequential reasoning tasks and then extrapolating this knowledge to solve problems of greater complexity than they were trained on. These recurrent models are largely inspired by the classical theory of mind, in which the brain iteratively applies primitive strategies to solve complex problems over time [Baddeley, 2012] Our models are recurrent versions of popular architectures and we acknowledge that variations to the model may be helpful. Thus, we leave an in depth investigation into other neural network designs for future work.
|
| 169 |
+
|
| 170 |
+
Interestingly, the resulting models excel at solving problems that are classically solved by handcrafted algorithms; prefix sums are computed using reduction trees, mazes are classically solved by depth/breadth first search, and chess is solved by Monte-Carlo tree search. Even with the advances in machine learning that we have today, hand-crafted algorithms still play a role in state-of-the-art reasoning systems. A prominent example is AlphaZero, which plays board games using Monte-Carlo tree search algorithms assisted by a learned pruning function [Silver et al., 2017]. While moving away from this paradigm that includes hand-crafted elements is highly ambitious, this work suggests that it may be possible to train gameplay systems without building them on top of a hand-crafted tree search engine. In other words, it may be possible to machine-learn these algorithmic behaviors end-to-end.
|
| 171 |
+
|
| 172 |
+
# Acknowledgements
|
| 173 |
+
|
| 174 |
+
This project was supported by the ONR MURI program, AFOSR MURI program, the DARPA Young Faculty Award, and the National Science Foundation Division of Mathematical Sciences. Additional support was provided by Capital One Bank and JP Morgan Chase. Additionally, we thank Avrim Blum for thought-provoking and insightful conversations.
|
| 175 |
+
|
| 176 |
+
# References
|
| 177 |
+
|
| 178 |
+
Md Zahangir Alom, Mahmudul Hasan, Chris Yakopcic, Tarek M Taha, and Vijayan K Asari. Recurrent residual convolutional neural network based on u-net (r2u-net) for medical image segmentation. arXiv preprint arXiv:1802.06955, 2018.
|
| 179 |
+
Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019.
|
| 180 |
+
Alan Baddeley. Working memory: theories, models, and controversies. Annual review of psychology, 63:1–29, 2012.
|
| 181 |
+
Alan D Baddeley and Graham Hitch. Working memory. In Psychology of learning and motivation, volume 8, pages 47–89. Elsevier, 1974.
|
| 182 |
+
Shaojie Bai, J Zico Kolter, and Vladlen Koltun. Trellis networks for sequence modeling. In International Conference on Learning Representations, 2018.
|
| 183 |
+
Shaojie Bai, J Zico Kolter, and Vladlen Koltun. Deep equilibrium models. Advances in Neural Information Processing Systems, 32:690–701, 2019.
|
| 184 |
+
|
| 185 |
+
Tamal Biswas and Kenneth Regan. Measuring level-k reasoning, satisficing, and human error in gameplay data. In 2015 IEEE 14th International Conference on Machine Learning and Applications (ICMLA), pages 941–947. IEEE, 2015.
|
| 186 |
+
|
| 187 |
+
Arpad E Elo. The rating of chessplayers, past and present. Arco Pub., 1978.
|
| 188 |
+
|
| 189 |
+
Cristobal Eyzaguirre and Alvaro Soto. Differentiable adaptive computation time for visual reasoning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12817–12825, 2020.
|
| 190 |
+
|
| 191 |
+
Alex Graves. Adaptive computation time for recurrent neural networks. arXiv preprint arXiv:1603.08983, 2016.
|
| 192 |
+
|
| 193 |
+
Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014.
|
| 194 |
+
|
| 195 |
+
K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–778, 2016.
|
| 196 |
+
|
| 197 |
+
Christian Hill. Making a maze, Apr 2017. URL https://scipython.com/blog/ making-a-maze/.
|
| 198 |
+
|
| 199 |
+
Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with stochastic depth. In European conference on computer vision, pages 646–661. Springer, 2016.
|
| 200 |
+
|
| 201 |
+
Andrew Jaegle, Felix Gimeno, Andrew Brock, Andrew Zisserman, Oriol Vinyals, and Joao Carreira. Perceiver: General perception with iterative attention. arXiv preprint arXiv:2103.03206, 2021.
|
| 202 |
+
|
| 203 |
+
Łukasz Kaiser and Ilya Sutskever. Neural gpus learn algorithms. arXiv preprint arXiv:1511.08228, 2015.
|
| 204 |
+
|
| 205 |
+
Kohitij Kar, Jonas Kubilius, Kailyn Schmidt, Elias B Issa, and James J DiCarlo. Evidence that recurrent circuits are critical to the ventral stream’s execution of core object recognition behavior. Nature neuroscience, 22(6):974–983, 2019.
|
| 206 |
+
|
| 207 |
+
Yigitcan Kaya, Sanghyun Hong, and Tudor Dumitras. Shallow-deep networks: Understanding and mitigating network overthinking. In International Conference on Machine Learning, pages 3301–3310. PMLR, 2019.
|
| 208 |
+
|
| 209 |
+
Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. Albert: A lite bert for self-supervised learning of language representations. In International Conference on Learning Representations, 2020.
|
| 210 |
+
|
| 211 |
+
Ming Liang and Xiaolin Hu. Recurrent convolutional neural network for object recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3367–3375, 2015.
|
| 212 |
+
|
| 213 |
+
Qianli Liao and Tomaso Poggio. Bridging the gaps between residual learning, recurrent neural networks and visual cortex. arXiv preprint arXiv:1604.03640, 2016.
|
| 214 |
+
|
| 215 |
+
Lichess. Lichess open puzzles database. https://database.lichess.org/#puzzles, 2021. Accessed: 2021-04-01.
|
| 216 |
+
|
| 217 |
+
Reid McIlroy-Young, Siddhartha Sen, Jon Kleinberg, and Ashton Anderson. Aligning superhuman ai with human behavior: Chess as a model system. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 1677–1687, 2020.
|
| 218 |
+
|
| 219 |
+
Pedro Pinheiro and Ronan Collobert. Recurrent convolutional neural networks for scene labeling. In International conference on machine learning, pages 82–90. PMLR, 2014.
|
| 220 |
+
|
| 221 |
+
Tord Romstad, Marco Costalba, and et al. Kiiski, Joona. Stockfish: A strong open source chess engine. URL https://stockfishchess.org/.
|
| 222 |
+
|
| 223 |
+
Avi Schwarzschild, Eitan Borgnia, Arjun Gupta, Arpit Bansal, Zeyad Emam, Furong Huang, Micah Goldblum, and Tom Goldstein. Datasets for studying generalization from easy to hard examples. arXiv preprint arXiv:2108.06011, 2021.
|
| 224 |
+
|
| 225 |
+
Daniel Selsam, Matthew Lamm, Benedikt Bünz, Percy Liang, Leonardo de Moura, and David L Dill. Learning a sat solver from single-bit supervision. arXiv preprint arXiv:1802.03685, 2018.
|
| 226 |
+
|
| 227 |
+
Manli Shu, Zuxuan Wu, Micah Goldblum, and Tom Goldstein. Preparing for the worst: Making networks less brittle with adversarial batch normalization. arXiv preprint arXiv:2009.08965, 2020.
|
| 228 |
+
|
| 229 |
+
David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, et al. Mastering chess and shogi by self-play with a general reinforcement learning algorithm. arXiv preprint arXiv:1712.01815, 2017.
|
| 230 |
+
|
| 231 |
+
Aviv Tamar, Yi Wu, Garrett Thomas, Sergey Levine, and Pieter Abbeel. Value iteration networks. arXiv preprint arXiv:1602.02867, 2016.
|
md/train/Y4RJQO2jivm/Y4RJQO2jivm.md
ADDED
|
@@ -0,0 +1,417 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Characterizing and Measuring the Similarity of Neural Networks with Persistent Homology
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Characterizing the structural properties of neural networks is crucial yet poorly
|
| 11 |
+
2 understood, and there are no well-established similarity measures between net
|
| 12 |
+
3 works. In this work, we observe that neural networks can be represented as abstract
|
| 13 |
+
4 simplicial complex and analyzed using their topological ’fingerprints’ via Persis
|
| 14 |
+
5 tent Homology (PH). We then describe a PH-based representation proposed for
|
| 15 |
+
6 characterizing and measuring similarity of neural networks. We empirically show
|
| 16 |
+
7 the effectiveness of this representation as a descriptor of different architectures
|
| 17 |
+
8 in several datasets. This approach based on Topological Data Analysis is a step
|
| 18 |
+
9 towards better understanding neural networks and serves as a useful similarity
|
| 19 |
+
10 measure.
|
| 20 |
+
|
| 21 |
+
# 11 1 Introduction
|
| 22 |
+
|
| 23 |
+
12 Machine learning practitioners can train different neural networks for the same task. Even for the
|
| 24 |
+
13 same neural architecture, there are many hyperparameters, such as the number of neurons per layer
|
| 25 |
+
14 or the number of layers. Moreover, the final weights for the same architecture and hyperparameters
|
| 26 |
+
15 can vary depending on the initialization and the optimization process itself, which is stochastic. Thus,
|
| 27 |
+
16 there is no direct way of comparing neural networks accounting for the fact that neural networks
|
| 28 |
+
17 solving the same task should be measured as being similar, regardless of the specific weights. This
|
| 29 |
+
18 also prevents one from finding and comparing modules inside neural networks (e.g., determining if a
|
| 30 |
+
19 given sub-network does the same function as other sub-network in another model). Moreover, there
|
| 31 |
+
20 are no well-known methods for effectively characterizing neural networks.
|
| 32 |
+
21 This work aims to characterize neural networks such that they can be measured to be similar
|
| 33 |
+
22 once trained for the same task, with independence of the particular architecture, initialization, or
|
| 34 |
+
23 optimization process. We focus on Multi-Layer Perceptrons (MLPs) for the sake of simplicity. We
|
| 35 |
+
24 start by observing that we can represent a neural network as a directed weighted graph to which we
|
| 36 |
+
25 can associate certain topological concepts.1 Considering it as a simplicial complex, we obtain its
|
| 37 |
+
26 associated Persistent Diagram. Then, we can compute distances between Persistent Diagrams of
|
| 38 |
+
27 different neural networks.
|
| 39 |
+
28 The proposed experiments aim to show that the selected structural feature, Persistent Homology,
|
| 40 |
+
29 serves to relate neural networks trained for similar problems and that such a comparison can be
|
| 41 |
+
30 performed by means of a predefined measure between the associated Persistent Homology diagrams.
|
| 42 |
+
31 To test the hypothesis, we study different classical problems (MNIST, Fashion MNIST, CIFAR-10,
|
| 43 |
+
32 and language identification and text classification datasets), different architectures (number and size
|
| 44 |
+
33 of layers) as well as a control experiment (input order).
|
| 45 |
+
|
| 46 |
+
34 In summary, the main contributions of this work are the following:
|
| 47 |
+
|
| 48 |
+
• We propose an effective graph characterization strategy of neural networks based on Persistent Homology. • Based on this characterization, we suggest a similarity measure of neural networks. • We provide empirical evidence that this Persistent Homology framework captures valuable information from neural networks and that the proposed similarity measure is meaningful.
|
| 49 |
+
|
| 50 |
+
40 The remainder of this paper is organized as follows. In Section 2, we go through the related work.
|
| 51 |
+
41 Then, in Section 3 we describe our proposal and the experimental framework to validate it. Finally, in
|
| 52 |
+
42 sections 4 and 5 we report and discuss the results and arrive to conclusions, respectively.
|
| 53 |
+
|
| 54 |
+
# 43 2 Related Work
|
| 55 |
+
|
| 56 |
+
44 One of the fundamental papers of Topological Data Analysis (TDA) is presented in Carlsson [8]
|
| 57 |
+
45 and suggests the use of Algebraic Topology to obtain qualitative information and deal with metrics
|
| 58 |
+
46 for large amounts of data. For an extensive overview of simplicial topology on graphs, see Giblin
|
| 59 |
+
47 [18], Jonsson [21]. Aktas et al. [2] provide a thorough analysis of PH methods.
|
| 60 |
+
48 More recently, a number of publications have dealt with the study of the capacity of neural networks
|
| 61 |
+
49 using PH. Guss and Salakhutdinov [19] characterize learnability of different neural architectures by
|
| 62 |
+
50 computable measures of data complexity. Rieck et al. [30] introduce the neural persistence metric, a
|
| 63 |
+
51 complexity measure based on TDA on weighted stratified graphs. This work suggests a representation
|
| 64 |
+
52 of the neural network as a multipartite graph and the filtering of the Persistent Homology diagrams
|
| 65 |
+
53 are performed for each layer independently. As the filtration contains at most 1-simplices (edges),
|
| 66 |
+
54 they only capture zero-dimensional topological information, i.e. connectivity information. Donier
|
| 67 |
+
55 [14] propose the concept of spatial capacity allocation analysis. Konuk and Smith [22] propose an
|
| 68 |
+
56 empirical study of how NNs handle changes in topological complexity of the input data.
|
| 69 |
+
57 In terms of pure neural network analysis, there are relevant works, like Hofer et al. [20], that study
|
| 70 |
+
58 topological regularization. Clough et al. [11] introduce a method for training neural networks for
|
| 71 |
+
59 image segmentation with prior topology knowledge, specifically via Betti numbers. Corneanu et al.
|
| 72 |
+
60 [13] try to estimate (with limited success) the performance gap between training and testing via
|
| 73 |
+
61 neuron activations and linear regression of the Betti numbers.
|
| 74 |
+
62 On the other hand, topological analysis of decision boundaries has been a very prolific area. Ra
|
| 75 |
+
63 mamurthy et al. [28] propose a labeled Vietoris-Rips complex to perform PH inference of decision
|
| 76 |
+
64 boundaries for quantification of the complexity of neural networks.
|
| 77 |
+
65 Naitzat et al. [27] experiment on the PH of a wide range of point cloud input datasets for a binary
|
| 78 |
+
66 classification problems to see that NNs transform a topologically rich dataset (in terms of Betti
|
| 79 |
+
67 numbers) into a topologically simpler one as it passes through the layers. They also verify that
|
| 80 |
+
68 the reduction in Betti numbers is significantly faster for ReLU activations than hyperbolic tangent
|
| 81 |
+
69 activations.
|
| 82 |
+
70 Liu [25] obtain certain geometrical and topological properties of decision regions for neural models,
|
| 83 |
+
71 and provide some principled guidance to designing and regularizing them. Additionally, they use
|
| 84 |
+
72 curvatures of decision boundaries in terms of network weights, and the rotation index theorem
|
| 85 |
+
73 together with the Gauss-Bonnet-Chern theorem.
|
| 86 |
+
74 Regarding neural network representations, one of the most related works to ours, Gebhart et al. [16],
|
| 87 |
+
75 focuses on topological representations of neural networks. They introduce a method for computing PH
|
| 88 |
+
76 over the graphical activation structure of neural networks, which provides access to the task-relevant
|
| 89 |
+
77 substructures activated throughout the network for a given input.
|
| 90 |
+
78 Interestingly, in Watanabe and Yamana [35], authors work on neural network representations through
|
| 91 |
+
79 simplicial complexes based on deep Taylor decomposition and they calculate the PH of neural
|
| 92 |
+
80 networks in this representation. In Chowdhury et al. [10], they use directed homology to represent
|
| 93 |
+
81 MLPs. They show that the path homology of these networks is non-trivial in higher dimensions and
|
| 94 |
+
82 depends on the number and size of the network layers. They investigate homological differences
|
| 95 |
+
83 between distinct neural network architectures.
|
| 96 |
+
84 As far as neural network similarity measures are concerned, the literature is not especially prolific. In
|
| 97 |
+
85 Kornblith et al. [23], authors examine similarity measures for representations (meaning, outputs of
|
| 98 |
+
86 different layers) of neural networks based on canonical correlation analysis. However, note that this
|
| 99 |
+
87 method compares neural network representations (intermediate outputs), not the neural networks
|
| 100 |
+
88 themselves. Remarkably, in Ashmore and Gashler [3], authors do deal with the intrinsic similarity
|
| 101 |
+
89 of neural networks themselves based on Forward Bipartite Alignment. Specifically, they propose
|
| 102 |
+
90 an algorithm for aligning the topological structures of two neural networks. Their algorithm finds
|
| 103 |
+
91 optimal bipartite matches between the nodes of the two MLPs by solving the well-known graph
|
| 104 |
+
92 cutting problem. The alignment enables applications such as visualizations or improving ensembles.
|
| 105 |
+
93 However, the methods only works under very restrictive assumptions,2 and this line of work does not
|
| 106 |
+
94 appear to have been followed up.
|
| 107 |
+
95 Finally, we note that there has been a considerable growth of interest in applied topology in the
|
| 108 |
+
96 recent years. This popularity increase and the development of new software libraries,3 along with the
|
| 109 |
+
97 growth of computational capabilities, have empowered new works. Some of the most remarkable
|
| 110 |
+
98 libraries are Ripser [32, 5], and Flagser [26]. They are focused on the efficient computation of PH.
|
| 111 |
+
99 For GPU-Accelerated computation of Vietoris-Rips PH, Ripser $^ { + + }$ [37] offers an important speedup.
|
| 112 |
+
100 The Python library we are using, Giotto-TDA [31], makes use of both above libraries underneath.
|
| 113 |
+
101 We have seen that there is a trend towards the use of algebraic topology methods for having a better
|
| 114 |
+
102 understanding of phenomena of neural networks and having more principled deep learning algorithms.
|
| 115 |
+
103 Nevertheless, little to no works have proposed neural network characterizations or similarity measures
|
| 116 |
+
104 based on intrinsic properties of the networks, which is what we intend to do.
|
| 117 |
+
|
| 118 |
+
# 05 3 Methodology
|
| 119 |
+
|
| 120 |
+
106 In this section, we propose our method, which is heavily based on concepts from algebraic topology.
|
| 121 |
+
107 We refer the reader to the Supplementary Material for the mathematical definitions. In this section,
|
| 122 |
+
108 we also describe the conducted experiments.
|
| 123 |
+
109 Intrinsically characterizing and comparing neural networks is a difficult, unsolved problem. First, the
|
| 124 |
+
110 network should be represented in an object that captures as much information as possible and then it
|
| 125 |
+
111 should be compared with a measure depending on the latent structure. Due to the stochasticity of
|
| 126 |
+
112 both the initialization and training procedure, networks are parameterized differently. For the same
|
| 127 |
+
113 task, different functions that effectively solve it can be obtained. Being able to compare the trained
|
| 128 |
+
114 networks can be helpful to detect similar neural structures.
|
| 129 |
+
115 We want to obtain topological characterizations associated to neural networks trained on a given
|
| 130 |
+
116 task. For doing so, we use the Persistence Homology (from now on, PH) of the graph associated to a
|
| 131 |
+
117 neural network. We compute the PH for various neural networks learned on different tasks. We then
|
| 132 |
+
118 compare all the diagrams for each one of the task.
|
| 133 |
+
119 More specifically, for each of the studied tasks (image classification on MNIST, Fashion MNIST and
|
| 134 |
+
120 CIFAR-10; language identification, and text classification on the Reuters dataset), 4 we proceed as
|
| 135 |
+
121 follows:
|
| 136 |
+
|
| 137 |
+
• We train several neural network models on the particular problem.
|
| 138 |
+
• We create a directed graph from the weights of the trained neural networks (after changing the direction of the negative edges and normalising the weights of the edges).
|
| 139 |
+
• We consider the directed graph as a simplicial complex and calculate its PH, using the weight of the edges as the filtering parameter, which range from 0 to 1. This way we obtain the so-called Persistence Diagram.
|
| 140 |
+
We compute the distances between the Persistence Diagrams (prior discretization of the Persistence Diagram so that it can be computed) of the different networks.
|
| 141 |
+
Finally, we analyze the similarity between different neural networks trained for the same task, for a similar task, and for a completely different task, independently of the concrete architecture, to see whether there is topological similarity.
|
| 142 |
+
|
| 143 |
+
133 As baselines, we set two standard matrix comparison methods that are the 1-Norm and the Frobenius
|
| 144 |
+
134 norm. Having adjacency matrix $A$ and $B$ , we compute the difference as $n o r m ( A - B )$ . However, these
|
| 145 |
+
135 methods only work for matrices of similar size and thus, they are not general enough. We could also
|
| 146 |
+
136 have used the Fast Approximate Quadratic assignment algorithm suggested in Vogelstein et al. [34],
|
| 147 |
+
137 but for large networks this method becomes unfeasible to compute.
|
| 148 |
+
|
| 149 |
+
# 138 3.1 Proposal
|
| 150 |
+
|
| 151 |
+
139 Our method is as follows. We start by associating to a neural network a weighted directed graph
|
| 152 |
+
140 that is analyzed as an abstract simplicial complex consisting on the union of points, edges, triangles,
|
| 153 |
+
141 tetrahedrons and larger dimension polytopes (those are the elements referred as simplices). Abstract
|
| 154 |
+
142 simplicial complexes are used in opposition to geometric simplicial complexes, generated by a point
|
| 155 |
+
143 cloud embedded in the Euclidean space $\mathbb { R } ^ { n }$ .
|
| 156 |
+
144 Given a trained neural network, we take the collection of neural network parameters as directed and
|
| 157 |
+
145 weighted edges that join neurons, represented by graph nodes. Biases are considered as new vertices
|
| 158 |
+
146 that join target neurons with an edge having a given weight. Note that, in this representation, we lose
|
| 159 |
+
147 the information about the activation functions, for simplicity and to avoid representing the network
|
| 160 |
+
148 as a multiplex network. Bias information could also have been ignored because we want large PH
|
| 161 |
+
149 groups that characterize the network, while these connections will not change the homology group
|
| 162 |
+
150 dimension of any order.
|
| 163 |
+
151 For negative edge weights, we reverse edge directions and maintain the absolute value of the weights.
|
| 164 |
+
152 We discard the use of weight absolute value since neural networks are not invariant under weight sign
|
| 165 |
+
153 transformations. This representation is consistent with the fact that every neuron can be replaced by a
|
| 166 |
+
154 neuron from which two edges with opposite weights emerge and converge again on another neuron
|
| 167 |
+
155 with opposite weights. From the point of view of homology, this would be represented as a closed
|
| 168 |
+
156 cycle.
|
| 169 |
+
157 We then normalize the weights of all the edges as expressed in Equation 1 where $w$ is the weight
|
| 170 |
+
158 to normalize, W are all the weights and $\zeta$ is an smoothing parameter that we set to 0.000001. This
|
| 171 |
+
159 smoothing parameter is necessary as we want to avoid normalized weights of edges to be 0. This is
|
| 172 |
+
160 because 0 implies a lack of connection.
|
| 173 |
+
|
| 174 |
+
$$
|
| 175 |
+
m a x ( 1 - \frac { | w | } { m a x ( | m a x ( W ) | , | m i n ( W ) | ) } , \zeta )
|
| 176 |
+
$$
|
| 177 |
+
|
| 178 |
+
161 Given this weighted directed graph, we then define a directed flag complex associated to it. Topology
|
| 179 |
+
162 of this directed flag complex can be studied using homology groups $H _ { n }$ . In this work we calculate
|
| 180 |
+
163 homology groups up to degree 3 $\left( H _ { 0 } – H _ { 3 } \right)$ due to computational complexity and our neural network
|
| 181 |
+
164 representation method’s layer connectivity limit.
|
| 182 |
+
165 The dimensions of these homology groups are known as Betti numbers. The $i$ -th Betti number is
|
| 183 |
+
166 the number of $i \cdot$ -dimensional voids in the simplicial complex ( $\beta _ { 0 }$ gives the number of connected
|
| 184 |
+
167 components of the simplicial complex, $\beta _ { 1 }$ gives the number of non reducible loops and so on). For a
|
| 185 |
+
168 deeper introduction to algebraic topology and computational topology, we refer to Edelsbrunner and
|
| 186 |
+
169 Harer [15], Ghrist [17].
|
| 187 |
+
170 We work with a family of simplicial complexes, $K _ { \varepsilon }$ , for a range of values of $\varepsilon \in \mathbb { R }$ so that the complex
|
| 188 |
+
171 at step $\varepsilon _ { t }$ is embedded in the complex at $\varepsilon _ { t + 1 }$ for $\varepsilon _ { t } \leq \varepsilon _ { t + 1 }$ , i.e. $K _ { \varepsilon } \subseteq K _ { \varepsilon _ { t + 1 } }$ . In our case, $\varepsilon$ is the
|
| 189 |
+
172 minimum weight of included edges of our graph representation of neural networks.
|
| 190 |
+
173 The nested family of simplicial complexes is called a filtration. We calculate a sequence of homology
|
| 191 |
+
174 groups by varying the $\varepsilon$ parameter, obtaining a persistence homology diagram. PH calculations are
|
| 192 |
+
175 performed on $\mathbb { Z } _ { 2 }$ .
|
| 193 |
+
176 This filtration gives a collection of contained directed weighted graph or simplicial complex $K _ { \varepsilon _ { m i n } } \subseteq$
|
| 194 |
+
177 $\dots \subseteq K _ { \varepsilon _ { t } } \subseteq K _ { \varepsilon _ { t + 1 } } \subseteq \dots \subseteq K _ { \varepsilon _ { m a x } }$ , where $t \in [ 0 , 1 ]$ and $\varepsilon _ { m i n } = 0$ , $\varepsilon _ { m a x } = 1$ (recall that edge weights are
|
| 195 |
+
178 normalized).
|
| 196 |
+
179 Given a filtration, one can look at the birth, when a homology class appears, and death, the time
|
| 197 |
+
180 when the homology class disappears. The PH treats the birth and the death of these homological
|
| 198 |
+
181 features in $K _ { \varepsilon }$ for different $\varepsilon$ values. Lifespan of each homological feature can be represented as
|
| 199 |
+
182 an interval $( b i r t h , d e a t h )$ , of the homological feature. Given a filtration, one can record all these
|
| 200 |
+
183 intervals by a Persistence Barcode (PB) [8], or in a Persistence Diagram (PD), as a collection of
|
| 201 |
+
184 multiset of intervals.
|
| 202 |
+
185 As mentioned previously, our interest in this work is to compare PDs from two different simplicial
|
| 203 |
+
186 complexes. There are two distances traditionally used to compare PDs, Wasserstein distance and
|
| 204 |
+
187 Bottleneck distance. Their stability with respect to perturbations on PDs has been object of different
|
| 205 |
+
188 studies [9, 12].
|
| 206 |
+
189 In order to make computations feasible and to obviate noisy intervals, we filter the PDs by limiting
|
| 207 |
+
190 the minimum PD interval size. We do so by setting a minimum threshold $\eta = 0 . 0 1$ . Intervals with
|
| 208 |
+
191 a lifespan under this value are not considered. Additionally, for computing distances, we need to
|
| 209 |
+
192 remove infinity values. As we are only interested in the deaths until the maximum weight value, we
|
| 210 |
+
193 replace all the infinity values by 1.0.
|
| 211 |
+
194 Wasserstein distance calculations are computationally hard for large PDs (each PD of our NN models
|
| 212 |
+
195 has a million persistence intervals per diagram). Therefore we use a vectorized version of PDs instead,
|
| 213 |
+
196 also called PD discretization. This vectorized version summaries have been proposed and used on
|
| 214 |
+
197 recent literature [1, 6, 7, 24, 29].
|
| 215 |
+
|
| 216 |
+
For the persistence diagram distance calculation, we use the Giotto-TDA library [31] and compute the following supported vectorized persistence summaries: 1. Persistence landscape. 2. Weighted silhouette. 3. Heat vectorizations.
|
| 217 |
+
|
| 218 |
+
# 3.2 Experimental Framework
|
| 219 |
+
|
| 220 |
+
Datasets To determine the topological structural properties of trained NNs, we select different kinds of datasets. We opt for four well-known benchmarks in the machine learning community and one regarding language identification: (1) the MNIST5 dataset for classifying handwritten digit images, (2) the Fashion MNIST [36] dataset for classifying clothing images into 10 categories, (3) the CIFAR- $\cdot 1 0 ^ { 6 }$ (CIFAR) dataset for classifying 10 different objects, (4) the Reuters dataset for classifying news into 46 topics, and (5) the Language Identification Wikipedia dataset7 for identifying 7 different languages.
|
| 221 |
+
|
| 222 |
+
209 We selected these datasets because, apart from being well-known benchmarks, the performances
|
| 223 |
+
210 without transfer learning are good enough and they have different data types and sizes. For CIFAR
|
| 224 |
+
211 10 and Fashion MNIST datasets we train a Convolutional Neural Network (CNN) first, and the
|
| 225 |
+
212 convolutional layers are shared between all the models of the same dataset as a feature extractor.
|
| 226 |
+
213 Recall that in this work we are focusing on MLPs, so we do not consider that convolutional weights.
|
| 227 |
+
214 For the MNIST, Reuters and Language Identification datasets, we use an MLP. For Reuters and
|
| 228 |
+
215 Language identification datasets, we vectorize the sentences with character frequency.
|
| 229 |
+
|
| 230 |
+
6 Experiments Pipeline We study the following variables (hyperparameters): 1. Layer width, 2. Number of layers, 3. Input order8), 4. Number of labels (number of considered classes).
|
| 231 |
+
|
| 232 |
+
We define the base architecture as the one with a layer width of 512, 2 layers, the original features order, and considering all the classes (10 in the case of MNIST, Fashion MNIST and CIFAR, 46 in the case of Reuters and 7 in the case of the language identification task). Then, doing one change at a time, keeping the rest of the base architecture hyperparameters, we experiment with architectures with the following configurations:
|
| 233 |
+
|
| 234 |
+
• Layer width: 128, 256, 512 (base) and 1024.
|
| 235 |
+
• Number of layers: 2 (base), 4, 6, 8 and 10.
|
| 236 |
+
• Input order: 5 different randomizations (with base structure), the control experiment.
|
| 237 |
+
• Number of labels (MNIST, Fashion MNIST, CIFAR-10): 2, 4, 6, 8 and 10 (base).
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
Figure 1: Distance matrices using Silhouette discretization.
|
| 241 |
+
|
| 242 |
+
• Number of labels (Reuters): 2, 6, 12, 23 and 46 (base).
|
| 243 |
+
|
| 244 |
+
• Number of labels (Language Identification): 2, 3, 4, 6 and 7 (base).
|
| 245 |
+
|
| 246 |
+
Note that this is not a grid search over all the combinations. We always modify one hyperparameter at a time, and keep the rest of them as in the base architecture. In other words, we experiment with all the combinations such that only one of the hyperparameters is set to a non-base value at a time.
|
| 247 |
+
|
| 248 |
+
For each dataset, we train 5 times (each with a different random weight initialization) each of these neural network configurations. Then, we compute the topological distances (persistence landscape, weighted silhouette, heat) among the different architectures. In total, we obtain $5 \times 5 \times 3$ distance matrices (5 datasets, 5 random initializations, 3 distance measures). Finally, we average the 5 random initializations, such that we get $5 \times 3$ matrices, one for each distance on each dataset. All the matrices have dimensions $1 9 \times 1 9$ , since 19 is the number of experiments for each dataset (corresponding to the total the number of architectural configurations mentioned above). Note that the base architecture appears 8 times (1, on the number of neurons per layer, 1 on the number of layers, 1 on the number of labels and the 5 randomizations of weight initializations).
|
| 249 |
+
|
| 250 |
+
All experiments were executed in a machine with 2 NVIDIA V100 of 32GB, 2 Intel(R) Xeon(R) Platinum 8176 CPU $\textcircled { a } 2 . 1 0 \mathrm { G H z }$ , and of 1.5TB RAM, for a total of around 3 days.
|
| 251 |
+
|
| 252 |
+
The code and results are fully open source9243 under MIT license.
|
| 253 |
+
|
| 254 |
+
# 4 Results & Discussion
|
| 255 |
+
|
| 256 |
+
Results from control experiments can be seen in the third group on Figures 1 and 4. In these figures, groups are separated visually using white dashed lines. Experiments groups are specified in Table 1. Control experiments in all the images appear very dimmed, which means that they are very similar, as expected. Recall that the control experiments consist of 5 (randomizations) $\times ~ 5$ (executions) and that 25 different neural networks have been trained; each one of the network has more than 690,000 parameters that have been randomly initialized. After the training, results show that these networks have very close topological distance, as expected.
|
| 257 |
+
|
| 258 |
+
<table><tr><td>Number</td><td>Experiment</td><td>Index</td></tr><tr><td>1</td><td>Layer size</td><td>1-4</td></tr><tr><td>2</td><td>Number of layers</td><td>5-9</td></tr><tr><td>3</td><td>Input order</td><td>10-14</td></tr><tr><td>4</td><td>Number of labels</td><td>15-19</td></tr></table>
|
| 259 |
+
|
| 260 |
+
Table 1: Indices of the experiments of the distance matrices.
|
| 261 |
+
|
| 262 |
+

|
| 263 |
+
Figure 2: Control experiments using norms.
|
| 264 |
+
Table 2: Normalized difference comparison of self-norm against the maximum mean distance of the experiment.
|
| 265 |
+
|
| 266 |
+
<table><tr><td>Norm</td><td>Minimum</td><td>Maximum</td><td>Mean</td><td>Standard deviation</td></tr><tr><td>1-Norm</td><td>0.6683</td><td>4.9159</td><td>1.9733</td><td>1.5693</td></tr><tr><td>Frobenius</td><td>0.0670</td><td>0.9886</td><td>0.4514</td><td>0.3074</td></tr></table>
|
| 267 |
+
|
| 268 |
+
57 For Figure 2 we computed both 1-norm and Frobenius norm (the baselines) for graphs’ adjacency
|
| 269 |
+
258 matrices of control experiments. Note that as we ran the experiment five times, we make the mean
|
| 270 |
+
259 for each value of the matrix. In order to show whether the resulting values are positive or negative,
|
| 271 |
+
260 we subtract to the maximum difference of each dataset the norm of each cell separately, we take the
|
| 272 |
+
261 absolute value and we divide by the maximum difference of each dataset. Therefore, we obtain five
|
| 273 |
+
262 values per dataset. Table 2 shows the statistics reflecting that the distance among the experiments are
|
| 274 |
+
263 large and, thus, they are not characterizing any similarity but rather an important dissimilarity.
|
| 275 |
+
|
| 276 |
+
In contrast, Figure 3, with our method (Silhouette), shows perfect diagonal of similarity blocks. In the corresponding numeric results, we obtained show small distances, as shown in Table 3. We can appreciate that each dataset has its own hub. This confirms the validity of our proposed similarity measure.
|
| 277 |
+
|
| 278 |
+
268 The method we present also seems to capture
|
| 279 |
+
269 some parts of hyperparameter setup. For in
|
| 280 |
+
270 stance, in Figure 4 we can observe gradual in
|
| 281 |
+
271 crease of distances in the first group regarding
|
| 282 |
+
272 layer size meaning that, as layer size increases,
|
| 283 |
+
273 the topological distance increases too. Similarly,
|
| 284 |
+
274 for the number of layers (second group) and
|
| 285 |
+
275 number of labels (fourth group) the same situ
|
| 286 |
+
276 ation holds. Note that in Fashion MNIST and
|
| 287 |
+
277 CIFAR-10, the distances are dimmer because we
|
| 288 |
+
278 are not dealing with the weights of the CNNs.
|
| 289 |
+
279 Recall that the CNN acts as a frozen extractor
|
| 290 |
+
280 and are pretrained for all runs (with the same
|
| 291 |
+
281 weights), such that the MLP layers themselves
|
| 292 |
+
282 are the only potential source of dissimilarity be
|
| 293 |
+
283 tween runs.
|
| 294 |
+
84 Thus, our characterization is sensitive to the architecture (e.g., if we increase the capacity, distances
|
| 295 |
+
85 vary), but at the same time, as we saw before, it is not dataset-agnostic, meaning that it also captures
|
| 296 |
+
86 whether two neural networks are learning the same problem or not.
|
| 297 |
+
|
| 298 |
+

|
| 299 |
+
Figure 3: Control experiment comparison matrix using Silhouette discretization.
|
| 300 |
+
|
| 301 |
+

|
| 302 |
+
Figure 4: Distance matrices using Heat discretization.
|
| 303 |
+
Table 3: PH distances across input order (control) experiments, normalized by dataset.
|
| 304 |
+
|
| 305 |
+
<table><tr><td></td><td colspan="2">Heat distance</td><td colspan="2">Silhouette distance</td></tr><tr><td>Dataset</td><td>Mean</td><td>Deviation</td><td>Mean</td><td>Deviation</td></tr><tr><td>MNIST</td><td>0.0291</td><td>0.0100</td><td>0.1115</td><td>0.0364</td></tr><tr><td>F.MNIST</td><td>0.0308</td><td>0.0132</td><td>0.0824</td><td>0.0353</td></tr><tr><td>CIFAR-10</td><td>0.0243</td><td>0.0068</td><td>0.0769</td><td>0.0204</td></tr><tr><td>Language I.</td><td>0.0159</td><td>0.0040</td><td>0.0699</td><td>0.0159</td></tr><tr><td>Reuters</td><td>0.0166</td><td>0.0051</td><td>0.0387</td><td>0.0112</td></tr></table>
|
| 306 |
+
|
| 307 |
+
In Figure 4, Fashion MNIST (Figure 4b) and CIFAR (Figure 4c) dataset results are interestingly different from those of MNIST (Figure 4a) dataset. This is, presumably, because both Fashion MNIST and CIFAR use a pretrained CNN for the problem. Thus, we must analyze the results taking into account this perspective. The first fully connected layer size is important as it can avoid a bottleneck from the previous CNN output. Some works in the literature show that adding multiple fully connected layers does not necessarily enhance the prediction capability of CNNs [4], which is congruent with our results when adding fully connected layers (experiments 5 to 9) that result in dimmer matrices than the one from. Concerning the experiments on input order, there is slightly more homogeneity than in MNIST, again showing that the order of sample has negligible influence. Moreover, there could have been even more homogeneity taking into account that the fully connected network reduced its variance thanks to the frozen weights of the CNN. This also supports the fact that the CNN is the main feature extractor of the network. As in MNIST results, CIFAR results show that the topological properties are, indeed, a mapping of the practical properties of neural networks.
|
| 308 |
+
|
| 309 |
+

|
| 310 |
+
Figure 5: Language Identification dataset PH Landscape distance matrix.
|
| 311 |
+
|
| 312 |
+
We refer to the Supplementary Material for all distance matrices for all datasets and all distances, as well as for the standard deviations matrices and experiment group statistics.
|
| 313 |
+
|
| 314 |
+
# 5 Conclusions & Future Work
|
| 315 |
+
|
| 316 |
+
Results from different experiments, in five different datasets from computer vision and natural language, lead to similar topological properties and are trivially interpretable, which yields to general applicability.
|
| 317 |
+
|
| 318 |
+
The bests discretizations chosen for this work are the Heat and Silhouette. They show better separation of experiment groups, and are effectively reflecting changes in a sensitive way. We also explored the Landscape discretization but it offers a very low interpretability and clearance.
|
| 319 |
+
|
| 320 |
+
316 In other words, it is not helpful for comparing PH diagrams associated to neural networks.
|
| 321 |
+
|
| 322 |
+
The most remarkable conclusion comes from the control experiments. The corresponding neural networks, with different input order but the same architecture, are very close to each other. The PH framework does, indeed, abstract away the specific weight values, and captures latent information from the networks, allowing comparisons to be based on the function they approximate. The selected neural network representation is reliable and complete, and yields coherent and meaningful results. Instead, the baseline measures, the 1-Norm and the Frobenius norm, implied an important dissimilarity between the experiments in the control experiments, meaning that they did not capture the fact that these neural networks were very similar in terms of the solved problem.
|
| 323 |
+
|
| 324 |
+
We conclude that our proposed characterization, does, indeed, capture meaningful information from neural network, and the computed distances can serve as an effective similarity measure between networks. To the best of our knowledge, this similarity measure between neural networks is the first of its kind.
|
| 325 |
+
|
| 326 |
+
As future work, we suggest adapting the method to different deep learning libraries and make it support popular neural architectures such as CNNs, Recurrent Neural Networks, and Transformers [33]. Finally, we suggest performing more analysis regarding the learning of a neural network, and trying to topologically answer the question of how a neural network learns.
|
| 327 |
+
|
| 328 |
+
1. For all authors...
|
| 329 |
+
|
| 330 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 331 |
+
(b) Did you describe the limitations of your work? [Yes] See second paragraph of the introduction and last paragraph of the conclusions.
|
| 332 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 333 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 334 |
+
|
| 335 |
+
2. If you are including theoretical results...
|
| 336 |
+
|
| 337 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 338 |
+
|
| 339 |
+
3. If you ran experiments...
|
| 340 |
+
|
| 341 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Both code and outputs.
|
| 342 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] Check the Experimental Framework Section and the code.
|
| 343 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We include means, standard deviations and raw outputs.
|
| 344 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] Check Experimental Framework Section.
|
| 345 |
+
|
| 346 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 347 |
+
|
| 348 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] In the case of the datasets. We do not use any other additional asset.
|
| 349 |
+
(b) Did you mention the license of the assets? [No]
|
| 350 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] Code, results and pictures we have made for explanations.
|
| 351 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 352 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 353 |
+
|
| 354 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 355 |
+
|
| 356 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 357 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 358 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
| 359 |
+
[1] H. Adams, T. Emerson, M. Kirby, R. Neville, C. Peterson, P. Shipman, S. Chepushtanova, E. Hanson, F. Motta, and L. Ziegelmeier. Persistence images: A stable vector representation of persistent homology. J. Mach. Learn. Res., 18:8:1–8:35, 2017.
|
| 360 |
+
[2] M. Aktas, E. Akba¸s, and A. E. Fatmaoui. Persistence homology of networks: methods and applications. Applied Network Science, 4:1–28, 2019.
|
| 361 |
+
[3] S. Ashmore and M. Gashler. A method for finding similarity between multi-layer perceptrons by forward bipartite alignment. In 2015 International Joint Conference on Neural Networks (IJCNN), pages 1–7, 2015. doi: 10.1109/IJCNN.2015.7280769.
|
| 362 |
+
[4] S. H. S. Basha, S. R. Dubey, V. Pulabaigari, and S. Mukherjee. Impact of fully connected layers on performance of convolutional neural networks for image classification. CoRR, abs/1902.02771, 2019. URL http://arxiv.org/abs/1902.02771.
|
| 363 |
+
[5] U. Bauer. Ripser: efficient computation of vietoris-rips persistence barcodes, 2021.
|
| 364 |
+
[6] E. Berry, Y.-C. Chen, J. Cisewski-Kehe, and B. T. Fasy. Functional summaries of persistence diagrams. Journal of Applied and Computational Topology, 4:211–262, 2020.
|
| 365 |
+
[7] P. Bubenik. Statistical topological data analysis using persistence landscapes. J. Mach. Learn. Res., 16:77–102, 2015.
|
| 366 |
+
[8] G. Carlsson. Topology and data. Bulletin of the American Mathematical Society, 46:255–308, 2009.
|
| 367 |
+
[9] F. Chazal, V. D. Silva, and S. Oudot. Persistence stability for geometric complexes. Geometriae Dedicata, 173:193–214, 2012.
|
| 368 |
+
[10] S. Chowdhury, T. Gebhart, S. Huntsman, and M. Yutin. Path homologies of deep feedforward networks. 2019 18th IEEE International Conference On Machine Learning And Applications (ICMLA), pages 1077–1082, 2019.
|
| 369 |
+
[11] J. Clough, I. Öksüz, N. Byrne, V. Zimmer, J. A. Schnabel, and A. P. King. A topological loss function for deep-learning based image segmentation using persistent homology. IEEE transactions on pattern analysis and machine intelligence, PP, 2020.
|
| 370 |
+
[12] D. Cohen-Steiner, H. Edelsbrunner, and J. Harer. Stability of persistence diagrams. Proceedings of the twenty-first annual symposium on Computational geometry, 2005.
|
| 371 |
+
[13] C. Corneanu, M. Madadi, S. Escalera, and A. Martínez. Computing the testing error without a testing set. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 2674–2682, 2020.
|
| 372 |
+
[14] J. Donier. Capacity allocation analysis of neural networks: A tool for principled architecture design. ArXiv, abs/1902.04485, 2019.
|
| 373 |
+
[15] H. Edelsbrunner and J. Harer. Computational Topology - an Introduction. American Mathematical Society, 2009.
|
| 374 |
+
[16] T. Gebhart, P. Schrater, and A. Hylton. Characterizing the shape of activation space in deep neural networks. 2019 18th IEEE International Conference On Machine Learning And Applications (ICMLA), pages 1537–1542, 2019.
|
| 375 |
+
[17] R. Ghrist. Elementary Applied Topology. Self-published, 2014.
|
| 376 |
+
[18] P. Giblin. Graphs, surfaces, and homology : an introduction to algebraic topology. Chapman and Hall, 1977.
|
| 377 |
+
[19] W. H. Guss and R. Salakhutdinov. On characterizing the capacity of neural networks using algebraic topology. ArXiv, abs/1802.04443, 2018.
|
| 378 |
+
[20] C. Hofer, F. Graf, M. Niethammer, and R. Kwitt. Topologically densified distributions. ArXiv, abs/2002.04805, 2020.
|
| 379 |
+
[21] J. Jonsson. Simplicial complexes of graphs. PhD thesis, KTH Royal Institute of Technology, 2007.
|
| 380 |
+
[22] E. Konuk and K. Smith. An empirical study of the relation between network architecture and complexity. 2019 IEEE/CVF International Conference on Computer Vision Workshop (ICCVW), pages 4597–4599, 2019.
|
| 381 |
+
|
| 382 |
+
425 [23] S. Kornblith, M. Norouzi, H. Lee, and G. E. Hinton. Similarity of neural network representations
|
| 383 |
+
426 revisited. CoRR, abs/1905.00414, 2019. URL http://arxiv.org/abs/1905.00414.
|
| 384 |
+
427 [24] P. Lawson, A. Sholl, J. Brown, B. T. Fasy, and C. Wenk. Persistent homology for the quantitative
|
| 385 |
+
428 evaluation of architectural features in prostate cancer histology. Scientific Reports, 9, 2019.
|
| 386 |
+
429 [25] B. Liu. Geometry and topology of deep neural networks’ decision boundaries. ArXiv,
|
| 387 |
+
430 abs/2003.03687, 2020.
|
| 388 |
+
431 [26] D. Lütgehetmann, D. Govc, J. Smith, and R. Levi. Computing persistent homology of directed
|
| 389 |
+
432 flag complexes. arXiv: Algebraic Topology, 2019.
|
| 390 |
+
433 [27] G. Naitzat, A. Zhitnikov, and L. Lim. Topology of deep neural networks. J. Mach. Learn. Res.,
|
| 391 |
+
434 21:184:1–184:40, 2020.
|
| 392 |
+
435 [28] K. Ramamurthy, K. R. Varshney, and K. Mody. Topological data analysis of decision boundaries
|
| 393 |
+
436 with application to model selection. ArXiv, abs/1805.09949, 2019.
|
| 394 |
+
437 [29] B. A. Rieck, F. Sadlo, and H. Leitte. Topological machine learning with persistence indicator
|
| 395 |
+
438 functions. ArXiv, abs/1907.13496, 2019.
|
| 396 |
+
439 [30] B. A. Rieck, M. Togninalli, C. Bock, M. Moor, M. Horn, T. Gumbsch, and K. Borgwardt.
|
| 397 |
+
440 Neural persistence: A complexity measure for deep neural networks using algebraic topology.
|
| 398 |
+
441 ArXiv, abs/1812.09764, 2019.
|
| 399 |
+
442 [31] G. Tauzin, U. Lupo, L. Tunstall, J. B. Pérez, M. Caorsi, A. Medina-Mardones, A. Dassatti,
|
| 400 |
+
443 and K. Hess. giotto-tda: A topological data analysis toolkit for machine learning and data
|
| 401 |
+
444 exploration, 2020.
|
| 402 |
+
445 [32] C. Tralie, N. Saul, and R. Bar-On. Ripser.py: A lean persistent homology library for python.
|
| 403 |
+
446 The Journal of Open Source Software, 3(29):925, Sep 2018. doi: 10.21105/joss.00925. URL
|
| 404 |
+
447 https://doi.org/10.21105/joss.00925.
|
| 405 |
+
448 [33] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and
|
| 406 |
+
449 I. Polosukhin. Attention is all you need. CoRR, abs/1706.03762, 2017. URL http://arxiv.
|
| 407 |
+
450 org/abs/1706.03762.
|
| 408 |
+
451 [34] J. T. Vogelstein, J. M. Conroy, V. Lyzinski, L. J. Podrazik, S. G. Kratzer, E. T. Harley, D. E.
|
| 409 |
+
452 Fishkind, R. J. Vogelstein, and C. E. Priebe. Fast approximate quadratic programming for
|
| 410 |
+
453 graph matching. PLOS ONE, 10(4):1–17, 04 2015. doi: 10.1371/journal.pone.0121002. URL
|
| 411 |
+
454 https://doi.org/10.1371/journal.pone.0121002.
|
| 412 |
+
455 [35] S. Watanabe and H. Yamana. Topological measurement of deep neural networks using persistent
|
| 413 |
+
456 homology. In ISAIM, 2020.
|
| 414 |
+
457 [36] H. Xiao, K. Rasul, and R. Vollgraf. Fashion-mnist: a novel image dataset for benchmarking
|
| 415 |
+
458 machine learning algorithms, 2017.
|
| 416 |
+
459 [37] S. Zhang, M. Xiao, and H. Wang. Gpu-accelerated computation of vietoris-rips persistence
|
| 417 |
+
460 barcodes. In Symposium on Computational Geometry, 2020.
|
md/train/Yx1OzVU_SRi/Yx1OzVU_SRi.md
ADDED
|
@@ -0,0 +1,421 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Predicting What You Already Know Helps: Provable Self-Supervised Learning
|
| 2 |
+
|
| 3 |
+
Jason D. Lee1, Qi Lei1, Nikunj Saunshi1, Jiacheng Zhuo2
|
| 4 |
+
|
| 5 |
+
1 Princeton University 2 University of Texas at Austin {jasonlee@,qilei@,nsaunshi@cs}.princeton.edu, jzhuo@utexas.edu
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Self-supervised representation learning solves auxiliary prediction tasks (known as pretext tasks) without requiring labeled data to learn useful semantic representations. These pretext tasks are created solely using the input features, such as predicting a missing image patch, recovering the color channels of an image from context, or predicting missing words in text; yet predicting this known information helps in learning representations effective for downstream prediction tasks.
|
| 10 |
+
|
| 11 |
+
We posit a mechanism exploiting the statistical connections between certain reconstruction-based pretext tasks that guarantee to learn a good representation. Formally, we quantify how the approximate independence between the components of the pretext task (conditional on the label and latent variables) allows us to learn representations that can solve the downstream task by just training a linear layer on top of the learned representation. We prove the linear layer yields small approximation error even for complex ground truth function class and will drastically reduce labeled sample complexity.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Self-supervised learning revitalizes machine learning models in computer vision, NLP, and control problems (see reference therein [36, 38, 15, 63, 35]). Training a model with auxiliary tasks based only on input features reduces the extensive costs of data collection and semantic annotations for downstream tasks. It is also known to improve the adversarial robustness of models [29, 11, 12]. Self-supervised learning creates pseudo labels solely based on input features, and solves auxiliary prediction tasks (or pretext tasks) in a supervised manner. However, the underlying principles of self-supervised learning are mysterious since it is a-priori unclear why predicting what we already know should help. We thus raise the following question:
|
| 16 |
+
|
| 17 |
+
What conceptual connection between pretext and downstream tasks ensures good representations? What is a good way to quantify this?
|
| 18 |
+
|
| 19 |
+
As a thought experiment, consider a simple downstream task of classifying desert, forest, and sea images. A meaningful pretext task is to predict the background color of images (known as image colorization [66]). Denote $X _ { 1 } , X _ { 2 } , Y$ to be the input image, color channel, and the downstream label respectively. Given knowledge of the label $Y$ , one can possibly predict the background $X _ { 2 }$ without knowing much about $X _ { 1 }$ . In other words, $X _ { 2 }$ is approximately independent of $X _ { 1 }$ conditional on the label $Y$ . Consider another task of inpainting [48] the front of a building $\left( X _ { 2 } \right)$ from the rest $( X _ { 1 } )$ . While knowing the label “building” $( Y )$ is not sufficient for successful inpainting, adding additional latent variables $Z$ such as architectural style, location, window positions, etc. will ensure that variation in $X _ { 2 }$ given $Y , Z$ is small. We can mathematically interpret this as $X _ { 1 }$ being approximate conditionally independent of $X _ { 2 }$ given $Y , Z$ .
|
| 20 |
+
|
| 21 |
+
The main insight that we exploit in this work is that with approximate conditional independence (as in the above examples), a method that predicts $X _ { 2 }$ from $X _ { 1 }$ will inadvertently implicitly encode and learn to predict $Y$ (and $Z$ ) from $X _ { 1 }$ as an intermediate step, and then predict $X _ { 2 }$ from $Y ^ { 1 }$ . Building upon this insight, we make the following contributions.
|
| 22 |
+
|
| 23 |
+
Contributions. The goal of this paper, as in statistical learning theory, is to investigate the statistical connections between the random variables of input features (in this paper $( X _ { 1 } , X _ { 2 } ) )$ and downstream labels $Y$ , and show how specific connections can guarantee a successful learning procedure. For self-supervised learning (SSL), success is measured using the following 2 notions, 1) expressivity, i.e. does the learned representation from SSL have the ability to express the ground truth prediction function for labels $Y$ , and 2) sample complexity, i.e. can it do so with way fewer labeled samples than what would be required without SSL.
|
| 24 |
+
|
| 25 |
+
In this work, we show such guarantees for a class of reconstruction-based SSL methods under a statistical assumption of approximate conditional independence $( A C I )$ . In particular we show that under such an assumption, the learned representation from SSL will end up having the following properties, 1) it can express the ground truth label as a linear function, thus guaranteeing expressivity, and 2) will also end up being low-rank (or low-dimensional), thus guaranteeing smaller labeled sample complexity. Note that such an expressive and sample efficient (summarized as good) representation is often not a-priori available. For instance, the original input features themselves may not be able to express the ground truth function linearly, while kernel methods with a fixed kernel, while expressive, may not be sample efficient for many problems of interest. The strategy in modern machine learning is to find such a good representation as the output of a complicated neural network. The benefit of SSL, as we formally show here, is that the complicated but good representation function can be learned using just unlabeled data, so that labeled data is just needed to learn a linear function.
|
| 26 |
+
|
| 27 |
+
The reconstruction-based SSL method (differentiated from other SSL methods in Section 1.1) we consider is strongly motivated by empirical works [66, 48, 15, 25], but is a simplification that captures the essence of the problem and is amenable to a precise theoretical analysis. We consider a two-staged pipeline, where we first learn a representation function $\psi$ (e.g. output of a neural network) from input $X _ { 1 }$ and pretext target $X _ { 2 }$ using unlabeled data by minimizing $\mathbb { E } _ { ( X _ { 1 } , X _ { 2 } ) } [ \| X _ { 2 } - \psi ( X _ { 1 } ) \| ^ { 2 } ]$ In the second stage of downstream task, we learn a linear layer on top of representation $\psi$ using labeled samples $( X _ { 1 } , Y )$ , thus restricting to learning from a significantly smaller hypothesis class of ${ \mathcal { H } } _ { \psi } = \{ f : X _ { 1 } \to Y | f$ is linear in $\psi \}$ . The key non-trivial question of expressivity is now whether the ground truth predictor $f ^ { * } \equiv \bar { \mathbb { E } } [ Y | X _ { 1 } ]$ can be approximated well by this class $\mathcal { H } _ { \psi }$ , and the question of sample complexity reduces to the understanding the sample complexity of learning $\mathcal { H } _ { \psi }$ . Under appropriate statistical connections2 between input data $X _ { 1 } , X _ { 2 }$ and target $Y$ , we prove both the desired properties, expressivity and low sample complexity, for the aforementioned SSL method.
|
| 28 |
+
|
| 29 |
+
Our statistical assumption based on approximate conditional independence (ACI) helps us demonstrate how solving pretext tasks created from known information can learn useful representations. Specifically, we show that once the complicated representation function $\psi$ is learned using an abundance of unlabeled data in the SSL stage, not only is $\psi$ expressive enough, but it will also require only $\tilde { \mathcal { O } } ( k )$ labeled samples to solve a $k$ -way supervised learning task under exact conditional independence (CI). In contrast, solving the downstream task without any pretraining will require a lot of labeled data to learn the representation function from scratch. Since the strong exact conditional independence assumption will likely not be satisfied in practice, our main contribution is to derive similar risk bounds when only approximate CI (ACI) is satisfied. We quantify the notion of ACI using the norm of a certain partial covariance matrix (Definition 4.1) and our risk bound scales linearly with it. We verify this and other aspects of our main Theorem 4.2 using simulations and also find that pretext task helps when CI is approximately enforced in text domain. We further demonstrate on a real-world image dataset that a pretext task-based linear model performs at least as well as many baselines.
|
| 30 |
+
|
| 31 |
+
# 1.1 Related work
|
| 32 |
+
|
| 33 |
+
Self-supervised learning (SSL) methods in practice: There has been a flurry of self-supervised methods lately. One class of methods reconstruct images from corrupted or incomplete versions of it, like denoising auto-encoders [61], image inpainting [48], and split-brain autoencoder [67]. Pretext tasks are also created using visual common sense, including predicting rotation angle [22], relative patch position [16], recovering color channels [66], solving jigsaw puzzle games [45], and discriminating images created from distortion [17]. We refer to the above procedures as reconstruction-based SSL. Another popular paradigm is contrastive learning [13, 14]. The idea is to learn representations that bring similar data points closer while pushing randomly selected points further away [63, 39, 5] or to maximize a contrastive-based mutual information lower bound between different views [30, 46, 54]. A popular approach for text domain is based on language modeling where models like BERT and GPT create auxiliary tasks for next word predictions [15, 49]. The natural ordering or topology of data is also exploited in video-based [64, 43, 19], graph-based [65, 33] or map-based [68] SSL. For instance, the pretext task is to determine the correct temporal order for video frames as in [43].
|
| 34 |
+
|
| 35 |
+
Theory for SSL: While we theoretically study reconstruction-based SSL, prior work has different flavors of theoretical results for different kinds of SSL methods. Most relevant are the guarantees for representation learning using SSL methods on downstream tasks that just learn a linear classifier on top of the learned representations. [5] shows guarantees for representations from a contrastive learning objective: $L _ { 1 } ^ { c o n t } ( \psi ) = \mathbb { E } _ { ( X _ { 1 } , X _ { 2 } ) , X _ { 2 } ^ { \prime } } [ \log ( 1 + e ^ { - \psi ( X _ { 1 } ) ^ { \top } \psi ( X _ { 2 } ) + \psi ( X _ { 1 } ) ^ { \top } \psi ( X _ { 2 } ^ { \prime } ) } ) ]$ . Under a class conditional independence assumption, i.e. $X _ { 1 } \perp X _ { 2 } \mid Y$ , they show that representation $\psi$ that does well on contrastive objective, i.e. $L _ { 1 } ^ { c o n t } ( \psi ) \leq \epsilon$ , will have $\mathcal { O } ( \epsilon )$ linear classification loss on the average binary task involving pairs of classes $( y _ { 1 } , y _ { 2 } )$ . However, their analysis cannot handle the general case of approximate conditional independence. Recently, Tosh et al. [56] show that contrastive learning representations can linearly recover continuous functions of the underlying topic posterior under a topic modeling assumption for text. While their assumption bears similarity to ours, the assumption of independent sampling of words is strong and does not generalizable to other domains like images. Most relevant is a concurrent work [57] that shows guarantees for a contrastive learning objective that looks like $L _ { 2 } ^ { c o n t } ( \psi , \eta ) = \mathbb { E } _ { ( X _ { 1 } , X _ { 2 } ) , X _ { 2 } ^ { \prime } } \left[ \log ( 1 + e ^ { - \psi ( X _ { 1 } ) ^ { \top } \eta ( X _ { 2 } ) } ) + \log ( 1 + e ^ { \psi ( X _ { 1 } ) ^ { \top } \overline { { \eta ( X _ { 2 } ^ { ' } ) } } } ) \right] .$ , with a multi-view redundancy assumptions that is very similar to our ACI assumption. We take a closer look at their assumption in Section F.2. All the above objectives are different from the simple reconstruction-based objective we consider: $L ( \psi ) = \mathbb { E } _ { ( X _ { 1 } , X _ { 2 } ) } \left[ \lVert X _ { 2 } - \psi ( X _ { 1 } ) \rVert ^ { 2 } \right]$ . Saunshi et al. [51] show guarantees for representations learned using language modeling on sentence classification tasks. Some more recent work [58, 44, 55, 62] provide theoretical understanding on SSL respectively based on causality, mutual information, gradient-descent dynamics, and alignment/uniformity of representations, without explicit risk bounds for downstream tasks. There is a mutual information maximization view of contrastive learning, but [59] points out issues with it. Previous attempts to explain negative sampling [42] based methods use the theory of noise contrastive estimation [27, 40] to show asymptotic guarantees, without explicit connections to downstream tasks. CI is also used in sufficient dimension reduction [21, 20], while CI and redundancy assumptions on multiple views [37, 2] are used to analyze a canonical-correlation based dimension reduction algorithm and also for self-supervised learning algorithms like co-training [10]. Finally, [1, 60] provide a theoretical analysis for denoising auto-encoder.
|
| 36 |
+
|
| 37 |
+
# 1.2 Overview of results:
|
| 38 |
+
|
| 39 |
+
Section 2 introduces notation, setup, and the self-supervised learning procedure considered in this work. In Section 3, we analyze downstream sample complexity under exact CI and unlimited labeled data to highlight the key ideas. Section 4 presents our main result with relaxed conditions: under ACI with latent variables, and assuming finite samples in both pretext and downstream tasks, for various function classes, and both regression and classification tasks. Experiments verifying our theoretical findings are in Section 6. Proofs of most results are in the Appendix.
|
| 40 |
+
|
| 41 |
+
# 2 Preliminary
|
| 42 |
+
|
| 43 |
+
# 2.1 Notation
|
| 44 |
+
|
| 45 |
+
We use lower case symbols $( x )$ to denote scalar quantities, bold lower case symbols $( { \pmb x } )$ for vector values, capital letters $( X )$ for random variables, and capital and bold letters $\boldsymbol { X }$ for matrices. $P _ { X }$ denotes the probability law of random variable $X$ , and the space of square-integrable functions with probability $P$ is denoted by $L ^ { 2 } ( P )$ . We use standard $\mathcal { O }$ notation to hide universal factors and $\tilde { \mathcal { O } }$ to hide log factors. $\| \cdot \|$ stands for $\ell _ { 2 }$ -norm for vectors or Frobenius norm for matrices.
|
| 46 |
+
|
| 47 |
+
Linear conditional expectation. $\mathbb { E } ^ { L } [ Y | X ]$ denotes the prediction of $Y$ with linear regression:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\mathbb { E } ^ { L } [ Y | X = x ] : = W ^ { * } x + b ^ { * } , \mathrm { ~ w h e r e ~ } W ^ { * } , b ^ { * } : = \operatorname * { a r g m i n } _ { W , b } \mathbb { E } [ \| Y - W X - b \| ^ { 2 } ] .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
In other words, $\mathbb { E } ^ { L } [ Y | X ]$ denotes the best linear predictor of $Y$ given $X$ . We also note that $\mathbb { E } [ Y | X ] \equiv$ arg $\begin{array} { r l } { \operatorname* { m i n } _ { f } \mathbb { E } [ \| Y - \bar { f } ( \bar { X } ) \| ^ { 2 } ] } \end{array}$ is the best predictor of $Y$ given $X$ .
|
| 54 |
+
|
| 55 |
+
(Partial) covariance matrix. For random variables $X , Y$ , we denote $\pmb { \Sigma } _ { X Y }$ to be covariance matrix of $X$ and $Y$ . For simplicity in most cases, we assume $\mathbb { E } [ X ] = 0$ and $\mathbb { E } [ Y ] = 0$ ; thus we do not distinguish $\mathbb { E } [ X Y ]$ and $\pmb { \Sigma } _ { X Y }$ . The partial covariance matrix between $X$ and $Y$ given $Z$ is:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\Sigma _ { X Y | Z } : = \operatorname { c o v } \{ X - \mathbb { E } ^ { L } [ X | Z ] , Y - \mathbb { E } ^ { L } [ Y | Z ] \} \equiv \Sigma _ { X Y } - \Sigma _ { X Z } \Sigma _ { Z Z } ^ { - 1 } \Sigma _ { Z Y } ,
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
which captures the correlation between $X$ and $Y$ setting aside the effect of $Z$ .
|
| 62 |
+
|
| 63 |
+
Sub-gaussian random vectors. $X \in \mathbb { R } ^ { d }$ is $\rho ^ { 2 }$ -sub-gaussian if for every fixed unit vector $\pmb { v } \in \mathbb { R } ^ { d }$ , the variable $v ^ { \top } X$ is $\rho ^ { 2 }$ -sub-gaussian, i.e., $\begin{array} { r } { \mathbb { E } \bigl [ e ^ { s \cdot { \pmb v } ^ { \top } ( { \pmb X } - \mathbb { E } [ { \pmb X } ] ) } \bigr ] \leq e ^ { s ^ { 2 } \rho ^ { 2 } / 2 } ( \bar { \forall } s \in \mathbb { R } ) . } \end{array}$ .
|
| 64 |
+
|
| 65 |
+
# 2.2 Setup and methodology
|
| 66 |
+
|
| 67 |
+
We denote by $X _ { 1 }$ the input variable, $X _ { 2 }$ the target random variable for the pretext task, and $Y$ the label for the downstream task, with $\bar { X _ { 1 } ^ { \ ' } } \in \mathcal { X } _ { 1 } \overset { } { \subset } \mathbb { R } ^ { d _ { 1 } } , X _ { 2 } \in \mathcal { X } _ { 2 } \subset \mathbb { R } ^ { d _ { 2 } }$ and $Y \in \mathcal { V } \subset \mathbb { R } ^ { k }$ . If $\mathcal { V }$ is finite with $| \mathcal { V } | = k$ , we assume $\mathcal { V } \subset \mathbb { R } ^ { k }$ is the one-hot encoding of the labels. $P _ { X _ { 1 } X _ { 2 } Y }$ denotes the joint distribution over $\mathcal { X } _ { 1 } \times \mathcal { X } _ { 2 } \times \mathcal { Y }$ . $P _ { X _ { 1 } Y } , P _ { X _ { 1 } }$ denote the corresponding marginal distributions. Our proposed self-supervised learning aims to fulfill the following two steps:
|
| 68 |
+
|
| 69 |
+
Step 1 (pretext task): Learn a representation $\psi ( { \pmb x } _ { 1 } )$ close to $\begin{array} { r } { \psi ^ { * } : = \arg \operatorname* { m i n } _ { g \in { \mathcal { H } } } \mathbb { E } \| X _ { 2 } - g ( X _ { 1 } ) \| ^ { 2 } } \end{array}$ , where $\mathcal { H }$ can vary for different settings that we will specify and discuss later.
|
| 70 |
+
|
| 71 |
+
Step 2 (downstream task): Perform linear regression on $Y$ with $\psi ( X _ { 1 } )$ , i.e. $f ( \pmb { x } _ { 1 } ) : = ( \pmb { W } ^ { * } ) ^ { \top } \psi ( \pmb { x } _ { 1 } )$
|
| 72 |
+
where $\begin{array} { r } { W ^ { * } \operatorname * { a r g m i n } _ { W } \mathbb { E } _ { X _ { 1 } , Y } [ \| Y - W ^ { \top } \psi ( X _ { 1 } ) \| ^ { 2 } ] } \end{array}$ . Namely we learn $f ( \cdot ) = \mathbb { E } ^ { L } [ Y | \psi ( \cdot ) ]$ .
|
| 73 |
+
|
| 74 |
+
We study this simplified version in the main text, where in practice, the SSL procedure may utilize an encoder-decoder structure, while the downstream task uses both $X _ { 1 }$ and $X _ { 2 }$ to predict $Y$ . We incorporate these extensions in Appendix C.3 and G.
|
| 75 |
+
|
| 76 |
+
With finite samples, performance of a learned representation $\psi$ on the downstream task depends on the following quantities that capture expressivity and sample complexity respectively:
|
| 77 |
+
|
| 78 |
+
Approximation error indicates whether $Y$ is linearly separable by the learned representation $\psi$ , thus measuring expressivity. We measure this by comparing $W \psi ( X _ { 1 } )$ to the optimal predictor $f ^ { * } : = \mathbb { E } [ Y | X _ { 1 } ^ { - } = \bar { { \mathbf { x } } } _ { 1 } ]$ . Denote $\begin{array} { r } { e _ { \mathrm { a p x } } ( \psi ) = \operatorname* { m i n } _ { W } \mathbb { \vec { E } } [ \| f ^ { * } ( \bar { X } _ { 1 } ) - W \psi ( X _ { 1 } ) \| ^ { 2 } ] } \end{array}$ . This gives a measure of how well $\psi$ can linearly predict $Y$ when given infinite samples for the task.
|
| 79 |
+
|
| 80 |
+
Estimation error measure sample complexity of $\psi$ on the downstream task and assume access to $n _ { 2 }$ i.i.d. samples $( \pmb { x } _ { 1 } ^ { ( 1 ) } , \pmb { y } ^ { ( 1 ) } ) , \idotsint _ { \ast } ( \bar { \pmb { x } _ { 1 } ^ { ( n _ { 2 } ) } } , \bar { \pmb { y } } ^ { ( n _ { 2 } ) } )$ drawn from $P _ { X _ { 1 } Y }$ . We express the $n _ { 2 }$ samples collectively as $X _ { 1 } ^ { \mathrm { d o w n } } \ \in \ \mathbb { R } ^ { n _ { 2 } \times d _ { 1 } }$ , $\boldsymbol { Y } \in \mathbb { R } ^ { n _ { 2 } \times k }$ and overload notation to say $\psi ( X _ { 1 } ^ { \mathrm { d o w n } } ) = $ $\left[ \psi ( \pmb { x } _ { 1 } ^ { ( 1 ) } ) | \psi ( \pmb { x } _ { 1 } ^ { ( 2 ) } ) \cdots | \psi ( \pmb { x } _ { 1 } ^ { ( n _ { 2 } ) } ) \right] ^ { \top } \in \mathbb { R } ^ { n _ { 2 } \times d _ { 2 } }$ . We perform linear regression on the learned representation $\psi$ and measure excess risk, that incorporates both approximation and estimation errors.
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\hat { W } \operatorname { a r g m i n } _ { W } \frac { 1 } { 2 n _ { 2 } } \| Y - \psi ( X _ { 1 } ) W \| _ { F } ^ { 2 } ; ~ \mathrm { E R } _ { \psi } ( \hat { W } ) : = \frac { 1 } { 2 } \mathbb { E } \| f ^ { * } ( X _ { 1 } ) - \hat { W } ^ { \top } \psi ( X _ { 1 } ) \| _ { 2 } ^ { 2 } .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
# 3 Guaranteed recovery with conditional independence
|
| 87 |
+
|
| 88 |
+
In this section, we focus on the case where the input $X _ { 1 }$ and pretext target $X _ { 2 }$ are conditionally independent (CI) given the downstream label $Y$ . While this is a strong assumption that is rarely satisfied in practice, it helps us understand the role of CI with clean results and builds up to our main results with ACI with latent variables in Section 4. As a warm-up, we show how CI helps when $( X _ { 1 } , X _ { 2 } , Y )$ are jointly Gaussian to give us a flavor for the results to follow in Appendix B. We then analyze it for general random variables under two settings: (a) when the function class used for $\psi$ is universal, (b) when $\psi$ is restricted to be a linear function of given features. For now we assume access to a large amount of unlabeled data so as to learn the optimal $\psi ^ { * }$ perfectly and this will be relaxed later in Section 4. The general recipe for the results is as follows:
|
| 89 |
+
|
| 90 |
+
1. Find a closed-form expression for the optimal solution $\psi ^ { * }$ for the pretext task.
|
| 91 |
+
2. Use conditional independence to show that optimal $f ^ { * }$ is linear in $\psi ^ { * }$ , i.e., $e _ { \mathrm { a p x } } ( \psi ^ { * } )$ is small.
|
| 92 |
+
3. Exploit the low rank structure of $\psi ^ { * }$ to show small estimation error on downstream tasks.
|
| 93 |
+
|
| 94 |
+
Data assumption. Suppose $Y = f ^ { * } ( X _ { 1 } ) + N$ , where $f ^ { * } = \mathbb { E } [ Y | X _ { 1 } ]$ and $\mathbb { E } [ N ] = 0$ . We assume $N$ is $\sigma ^ { 2 }$ -subgaussian. For simplicity, we assume non-degeneracy: $\Sigma _ { X _ { i } X _ { i } }$ , $\Sigma _ { Y Y }$ are full rank.
|
| 95 |
+
|
| 96 |
+
Assumption 3.1. Let $X _ { 1 } \in \mathbb { R } ^ { d _ { 1 } } , X _ { 2 } \in \mathbb { R } ^ { d _ { 2 } }$ be random variables from some unknown distribution. Let label $Y \in \mathcal { D }$ be a discrete random variable with $k = \ | \mathcal { V } | \ < \ d _ { 2 }$ . We assume conditional independence: $X _ { 1 } \bot X _ { 2 } | Y$ .
|
| 97 |
+
|
| 98 |
+
Here $Y$ can be interpreted as the multi-class labels where $k$ is the number of classes. For regression problems, one can think about $Y$ as the discretized values of continuous labels. We do not specify the dimension for $Y$ since $Y$ could be arbitrarily encoded but the results only depend on $k$ and the variance of $Y$ (conditional on the input $X _ { 1 }$ ).
|
| 99 |
+
|
| 100 |
+
# 3.1 Universal function class.
|
| 101 |
+
|
| 102 |
+
Suppose we learn the optimal $\psi ^ { * }$ among all measurable functions The optimal function $\psi ^ { * }$ in this case is naturally given by conditional expectation: $\psi ^ { * } ( \pmb { x } _ { 1 } ) = \mathbb { E } [ X _ { 2 } | X _ { 1 } = \pmb { x } _ { 1 } ]$ . We show that $\mathrm { C I }$ implies that $\psi ^ { * }$ is good for downstream tasks, which is not apriori clear.
|
| 103 |
+
|
| 104 |
+
Lemma 3.1 (Approximation error). If random variables $X _ { 1 } , X _ { 2 } , Y$ satisfy Assumption 3.1, and $\pmb { A } \in \mathbb { R } ^ { \mathcal { V } \times d _ { 2 } }$ with $\pmb { A } _ { y , : } : = \mathbb { E } [ X _ { 2 } | Y = \pmb { \dot { y } } ]$ has rank $k = | \mathcal { D } |$ . Then $f ^ { * } \equiv W ^ { * } \psi ^ { * }$ , i.e., $\bar { e } _ { a p x } ( \psi ^ { * } ) = 0$ .
|
| 105 |
+
|
| 106 |
+
This tells us that although $f ^ { * }$ could be nonlinear in $\scriptstyle { \mathbf { { \vec { x } } } } _ { 1 }$ , it is guaranteed to be linear in $\psi ^ { * } ( \pmb { x } _ { 1 } )$ .
|
| 107 |
+
|
| 108 |
+
Proof Sketch of Lemma 3.1. Lemma is proved by law of total expectation:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\begin{array} { r l } & { \psi ^ { * } ( \cdot ) : = \mathbb { E } [ X _ { 2 } | X _ { 1 } ] = \mathbb { E } [ \mathbb { E } [ X _ { 2 } | X _ { 1 } , Y ] | X _ { 1 } ] = \mathbb { E } [ \mathbb { E } [ X _ { 2 } | Y ] | X _ { 1 } ] } \\ & { \qquad = \displaystyle \sum _ { y } P ( Y = y | X _ { 1 } ) \mathbb { E } [ X _ { 2 } | Y = y ] = : f ( X _ { 1 } ) ^ { \top } { \pmb { A } } , } \end{array}
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
where $f ( x _ { 1 } ) _ { y } = P ( Y = y | X _ { 1 } = x _ { 1 } )$ , and $\pmb { A } \in \mathbb { R } ^ { \mathcal { V } \times d _ { 2 } }$ satisfies $A _ { y , : } = \mathbb { E } [ X _ { 2 } | Y = y ]$ . One could see that through predicting $X _ { 2 }$ , due to the CI assumption, $\psi ^ { * }$ has implicitly encoded the information of $Y | X _ { 1 }$ . Finally due to the fact that matrix $\pmb { A }$ is full rank, we get that $f ^ { * }$ is linear in $\psi ^ { * }$ as well.
|
| 115 |
+
|
| 116 |
+
We see that besides $\mathrm { C I }$ , another important property is $\mathbb { E } [ X _ { 2 } | Y ]$ being rank $k$ . This means $X _ { 2 }$ is correlated with every instance of $Y$ , and thus captures information of every prediction class. This is naturally a necessary assumption for $X _ { 2 }$ to be a reasonable pretext task for predicting $Y$ . Note that this assumption does not trivialize the problem and that even though $\psi$ is designed to predict $X _ { 2 }$ , it can still be a better representation than $X _ { 2 }$ for downstream tasks. Note that $Y$ does not have to be linear in $X _ { 2 }$ but is proven to be linear in $\psi$ , since $\psi$ learns to ignore some information in $X _ { 2 }$ that is irrelevant to $Y$ . We provide this simple example for better understanding:
|
| 117 |
+
|
| 118 |
+
Example 3.1. Let $Y \in \{ - 1 , 1 \}$ be binary labels, and $X _ { 1 } , X _ { 2 }$ be 2−mixture Gaussian random variables with $X _ { 1 } \sim \mathcal { N } ( Y \pmb { \mu } _ { 1 } , \mathbf { I } ) , X _ { 2 } \sim \mathcal { N } ( Y \pmb { \mu } _ { 2 } , \mathbf { I } )$ . In this example, $X _ { 1 } \bot X _ { 2 } | Y$ . Although $\mathbb { E } [ Y | X _ { 2 } ]$ and $\mathbb { E } [ Y | X _ { 1 } ]$ are not linear, $\mathbb { E } [ Y | \psi ]$ is linear: $\begin{array} { r } { \psi ( \pmb { x } _ { 1 } ) = P ( Y = 1 | X _ { 1 } = \pmb { x } _ { 1 } ) \pmb { \mu } _ { 2 } - P ( Y = - 1 | X _ { 1 } = } \end{array}$ ${ \pmb x } _ { 1 } ) { \pmb \mu } _ { 2 }$ and $f ^ { * } ( { \pmb x } _ { 1 } ) = P ( Y = 1 | X _ { 1 } = { \pmb x } _ { 1 } ) - P ( Y = - 1 | X _ { 1 } = { \pmb x } _ { 1 } ) \equiv \mu _ { 2 } ^ { T } \psi ( { \pmb x } _ { 1 } ) / \| { \pmb \mu } _ { 2 } \| ^ { 2 } .$
|
| 119 |
+
|
| 120 |
+
Given that $\psi ^ { * }$ is good for downstream, we now care about the sample complexity. We will need to assume that the representation has some nice concentration properties. We make an assumption about the whitened data $\psi ^ { * } ( X _ { 1 } )$ to ignore scaling factors.
|
| 121 |
+
|
| 122 |
+
Assumption 3.2. We assume the whitened feature variable $U : = \Sigma _ { \psi } ^ { - 1 / 2 } \psi ( X _ { 1 } )$ is a $\rho ^ { 2 }$ -subgaussian random variable, where $\Sigma _ { \psi } = \mathbb { E } [ \psi ( X _ { 1 } ) \psi ( X _ { 1 } ) ^ { \top } ]$ .
|
| 123 |
+
|
| 124 |
+
We note that all bounded random variables satisfy sub-gaussian property.
|
| 125 |
+
|
| 126 |
+
Theorem 3.2 (General conditional independence). Fix a failure probability $\delta \in ( 0 , 1 )$ , under the same assumption as Lemma 3.1 and Assumption 3.2 for $\psi ^ { * }$ , if additionally $n \gg \rho ^ { 4 } ( k + \log ( 1 / \delta ) )$ , then the excess risk of the learned predictor $\pmb { x } _ { 1 } \hat { \pmb { W } } ^ { \top } \psi ^ { * } ( \pmb { x } _ { 1 } )$ on the downstream task satsifies
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\begin{array} { r } { \mathrm { E R } _ { \psi ^ { * } } [ \hat { W } ] \leq \tilde { \mathcal { O } } \left( \frac { k } { n _ { 2 } } \sigma ^ { 2 } \right) ^ { 3 } } \end{array}
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
Remark 3.1. This analysis assumes we could perfectly learn $\psi ^ { * } = \mathbb { E } [ X _ { 2 } | X _ { 1 } ]$ disregarding the number of samples in the SSL phase (unlabeled data is cheap to obtain). Here by sample complexity we refer to the labeled data $( X _ { 1 } , Y )$ . We defer the effect of imprecise representation $\psi$ in Section $^ { 4 }$ .
|
| 133 |
+
|
| 134 |
+
# 3.2 Function class induced by feature maps.
|
| 135 |
+
|
| 136 |
+
Given feature map $\phi _ { 1 } : \mathcal { X } _ { 1 } \mathbb { R } ^ { D _ { 1 } }$ , we consider the function class $\mathcal { H } _ { 1 } = \{ \psi : \mathcal { X } _ { 1 } \mathbb { R } ^ { d _ { 2 } } | \exists B \in$ $\mathbb { R } ^ { d _ { 2 } \times D _ { 1 } } , \psi ( { \pmb x } _ { 1 } ) = { \pmb B } \phi _ { 1 } ( { \pmb x } _ { 1 } ) \}$ .
|
| 137 |
+
|
| 138 |
+
Claim 3.3 (Closed form solution). The optimal function in $\mathcal { H }$ is $\psi ^ { * } ( { \pmb x } _ { 1 } ) = \Sigma _ { X _ { 2 } \phi _ { 1 } } \Sigma _ { \phi _ { 1 } \phi _ { 1 } } ^ { - 1 } \phi _ { 1 } ( { \pmb x } _ { 1 } ) ,$ where and $\pmb { \Sigma } _ { \phi _ { 1 } \phi _ { 1 } } : = \pmb { \Sigma } _ { \phi _ { 1 } ( X _ { 1 } ) \phi _ { 1 } ( X _ { 1 } ) } .$ .
|
| 139 |
+
|
| 140 |
+
We again show the benefit of $\mathrm { C I }$ , but only comparing the performance of $\psi ^ { * }$ to the original features $\phi _ { 1 }$ . Since $\psi ^ { * }$ is linear in $\phi _ { 1 }$ , it cannot have smaller approximation error than $\phi _ { 1 }$ . However CI will ensure that $\psi ^ { * }$ has the same approximation error as $\phi _ { 1 }$ and enjoys better sample complexity.
|
| 141 |
+
|
| 142 |
+
Lemma 3.4 (Approximation error). If Assumption 3.1 is satisfied, and if the matrix $\pmb { A } \in \mathbb { R } ^ { \mathcal { V } \times d _ { 2 } }$ with $\pmb { A } _ { y , : } : = \mathbb { E } [ X _ { 2 } | \bar { Y } = \pmb { y } ]$ is of rank $k = | \mathcal { D } |$ . Then $e _ { a p x } ( \psi ^ { * } ) = \stackrel { \cdot } { e } _ { a p x } ( \phi _ { 1 } )$ .
|
| 143 |
+
|
| 144 |
+
We additionally need an assumption on the residual $a ( \pmb { x } _ { 1 } ) : = \mathbb { E } [ Y | X _ { 1 } = \pmb { x } _ { 1 } ] - \mathbb { E } ^ { L } [ Y | \phi _ { 1 } ( \pmb { x } _ { 1 } ) ] .$
|
| 145 |
+
|
| 146 |
+
Assumption 3.3. (Bounded approx. error; Condition $^ 3$ in $I 3 2 J )$ ) We have almost surely
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
\| \Sigma _ { \phi _ { 1 } \phi _ { 1 } } ^ { - 1 / 2 } \phi _ { 1 } ( X _ { 1 } ) a ( X _ { 1 } ) ^ { \top } \| _ { F } \leq b _ { 0 } \sqrt { k }
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
Theorem 3.5. (CI with approximation error) Fix a failure probability $\delta \in ( 0 , 1 )$ , under the same assumption as Lemma 3.4, Assumption 3.2 for $\psi ^ { * }$ and Assumption 3.3, if $n _ { 2 } \gg \dot { \rho } ^ { 4 } ( k + \log ( 1 / \delta ) )$ , then the excess risk of the learned predictor $\pmb { x } _ { 1 } \hat { \pmb { W } } ^ { \top } \psi ^ { * } ( \pmb { x } _ { 1 } )$ on the downstream task satisfies:
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\begin{array} { r } { \mathrm { E R } _ { \psi ^ { * } } [ \hat { W } ] \leq e _ { a p x } ( \phi _ { 1 } ) + \tilde { \mathcal { O } } \Big ( \frac { k } { n _ { 2 } } \sigma ^ { 2 } \Big ) . } \end{array}
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
Thus with SSL, the requirement of labels is reduced from complexity for $D _ { 1 }$ to ${ \mathcal { O } } ( k )$ .
|
| 159 |
+
|
| 160 |
+
# 4 Beyond conditional independence
|
| 161 |
+
|
| 162 |
+
In the previous section, we focused on the case where we have exact CI. A weaker but more realistic assumption is that $Y$ captures some portion of the dependence between $X _ { 1 }$ and $X _ { 2 }$ but not all. We quantify this notion of approximate ACI through a quantity $\epsilon _ { \mathrm { C I } } ^ { 2 }$ (Definition 4.1), and show excess risk bounds for the representation learned from $\mathsf { S S L } ^ { 4 }$ . In particular, the excess risk will have the form $\begin{array} { r } { \tilde { \mathcal { O } } \left( \frac { d _ { 2 } } { n _ { 2 } } + \epsilon _ { \mathrm { C I } } ^ { 2 } + \epsilon _ { \mathrm { p r e } } ^ { 2 } \right) } \end{array}$ , which suggests that only $n _ { 2 } = \mathcal { O } ( d _ { 2 } )$ labeled samples will be required to get small error on downstream task, as long as approximate CI is satisfied $\cdot \epsilon _ { \mathrm { { C I } } } ^ { 2 }$ is small) and the pretext task is solved well enough ( $\displaystyle \langle \epsilon _ { \mathrm { p r e } } ^ { 2 }$ is small). This is in contrast to not doing SSL, where many more labeled samples will be required to learn a solve the downstream task that learns a complicated representation function from scratch. We now describe the SSL method on finite samples, followed by the definition of ACI which we use to discuss the main excess risk bound and its consequences.
|
| 163 |
+
|
| 164 |
+
SSL with finite samples and general function space: Let $X _ { 1 } ^ { \mathrm { p r e } } = [ \pmb { x } _ { 1 } ^ { ( 1 , \mathrm { p r e } ) } , \cdot \cdot \cdot , \pmb { x } _ { 1 } ^ { ( n _ { 1 } , \mathrm { p r e } ) } ] ^ { \top } \in$ $\mathbb { R } ^ { n _ { 1 } \times d _ { 1 } }$ and $\pmb { X } _ { 2 } = [ \pmb { x } _ { 2 } ^ { ( 1 ) } , \cdots , \pmb { x } _ { 2 } ^ { ( n _ { 1 } ) } ] ^ { \top } \in \mathbb { R } ^ { n _ { 1 } \times d _ { 2 } }$ x(n1)2 ]⊤ ∈ Rn1×d2 be n1 training samples for pretext task, where $( \pmb { x } _ { 1 } ^ { ( i , \mathrm { p r e } ) } , \pmb { x } _ { 2 } ^ { ( i ) } )$ is sampled from $P _ { X _ { 1 } X _ { 2 } }$ . The $n _ { 2 }$ labeled samples for the downstream task are defined as $X _ { 1 } ^ { \mathrm { d o w n } } \in \mathbb { R } ^ { n _ { 2 } \times d _ { 1 } }$ , $\pmb { Y } \in \mathbb { R } ^ { n _ { 2 } \times d _ { 3 } 5 }$ . Given a representation function space $\mathcal { H } : \mathcal { X } _ { 1 } \mathbb { R } ^ { d _ { 2 } }$ , we learn $\tilde { \psi }$ from $\mathcal { H }$ using the $n _ { 1 }$ unlabeled samples and then use the $n _ { 2 }$ labeled samples to learn a linear classifier on the learned representation $\tilde { \psi } ( X _ { 1 } ^ { \mathrm { d o w n } } )$ to fit $\mathbf { Y }$ . This process is summarized below.
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
\tilde { \psi } : = \underset { f \in \mathcal { H } } { \mathrm { a r g } \mathrm { m i n } } \frac { 1 } { n _ { 1 } } \| X _ { 2 } - f ( X _ { 1 } ^ { \mathrm { p r e } } ) \| _ { F } ^ { 2 } , ~ 2 ) ~ \hat { W } \underset { W } { \mathrm { a r g } \mathrm { m i n } } \frac { 1 } { 2 n _ { 2 } } \| Y - \tilde { \psi } ( X _ { 1 } ^ { \mathrm { d o w n } } ) W \| _ { F } ^ { 2 } .
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
In our main results, we consider two types of function spaces: $\mathcal { H } \in \{ \mathcal { H } _ { 1 } , \mathcal { H } _ { u } \}$ . Recall that $\mathcal { H } _ { 1 } =$ $\{ \boldsymbol { \psi } ( \cdot ) = B \phi _ { 1 } ( \cdot ) ; B \in \mathbb { R } ^ { d _ { 2 } \times D _ { 1 } } \}$ is a class of linear representations induced by feature map $\phi _ { 1 } :$ $\dot { \mathcal { X } } _ { 1 } \stackrel { } { } \mathbb { R } ^ { D _ { 1 } }$ . We use $\mathcal { H } _ { u }$ to denote a function space with universal approximation power (e.g. deep networks) that ensures $\psi ^ { * } = \mathbb { E } [ X _ { 2 } | X _ { 1 } ] \in \mathcal { \bar { H } } _ { u }$ . We define the optimal predictor in each case as $f _ { \mathcal { H } } ^ { * } ( X _ { 1 } ) = \mathbb { E } ^ { L } [ Y | \phi _ { 1 } ( X _ { 1 } ) ]$ when $\mathcal { H } = \mathcal { H } _ { 1 }$ , $f _ { \mathcal { H } } ^ { * } = f ^ { * }$ for $\mathcal { H } = \mathcal { H } _ { u }$ , we define excess risk as
|
| 171 |
+
|
| 172 |
+
$$
|
| 173 |
+
\begin{array} { r } { \mathrm { E R } _ { \tilde { \psi } } ( \hat { W } ) : = \mathbb { E } _ { X _ { 1 } } \left[ \| f _ { \mathcal { H } } ^ { * } ( X _ { 1 } ) - \hat { W } ^ { \top } \tilde { \psi } ( X _ { 1 } ) \| _ { 2 } ^ { 2 } \right] . } \end{array}
|
| 174 |
+
$$
|
| 175 |
+
|
| 176 |
+
Approximate conditional independence: Our new assumption will generalize Assumption 3.1 in two ways, 1) we allow for additional latent variables $Z$ that together with $Y$ could potentially make $X _ { 1 }$ and $X _ { 2 }$ independent, and 2) we allow this conditional independence to be approximate. Note that allowing for extra latent variable can trivially make $X _ { 1 }$ and $X _ { 2 }$ to be conditionally independent by picking a large enough $Z$ (e.g. $\boldsymbol { Z } = ( X _ { 1 } , X _ { 2 } ) ,$ ). However the following assumption, that needs the pretext target $X _ { 2 }$ to correlate with all instances of variable $\bar { Y } = [ Y , Z ]$ (analogous to Lemma 3.1), will impose this restriction on how large $Z$ can be.
|
| 177 |
+
|
| 178 |
+
Assumption 4.1 (Correlation between $X _ { 2 }$ and $Y , Z )$ . Suppose there exists latent variable $Z \in { }$ ${ \mathcal { Z } } , | { \mathcal { Z } } | = m$ that ensures $\Sigma _ { \phi _ { \bar { y } } } { \cal X } _ { 2 }$ is full column rank and $\| \Sigma _ { Y \phi _ { \bar { y } } } \Sigma _ { X _ { 2 } \phi _ { \bar { y } } } ^ { \dagger } \| _ { 2 } = 1 / \beta$ , where $A ^ { \dagger }$ is pseudo-inverse, and $\phi _ { \bar { y } }$ is the one-hot embedding for $\bar { Y } = [ Y , Z ]$ .
|
| 179 |
+
|
| 180 |
+
Just as in Section 3, this assumption will not assume away the problem (Example 3.1 can be suitably extended). The additional term $1 / \beta$ here captures both the “scale” of $X _ { 2 }$ and also the strength of correlation between $X _ { 2 }$ and $[ Y , Z ]$ that was discussed after Lemma 3.1. For $\Sigma _ { \phi _ { \bar { y } } X _ { 2 } }$ to be full column rank, it is essential that $d _ { 2 } \geq k m$ , and this already gives an upper bound on the size of $Z$ . Given this restriction on $Z$ (and thus $\bar { Y }$ ), we define the notion of approximate conditional independence.
|
| 181 |
+
|
| 182 |
+
Definition 4.1 (Approximate conditional independence with function space $\mathcal { H }$ ). For ${ \bar { Y } } = [ Y , Z ] ,$
|
| 183 |
+
|
| 184 |
+
Firstly we note that this is indeed an extension of exact $\mathrm { C I }$ , since exact CI in both cases will imply that $\epsilon _ { \mathrm { C I } } = 0$ . We present a unified analysis in the appendix that shows the $\epsilon _ { \mathrm { { C I } } }$ for the second case is same as the first case, with covariance operators instead of matrices (A direct derivation is in Claim D.7). We also present more relaxed and general form of the above assumptions in Appendix F.1. With this assumption, we are ready to present our main bound.
|
| 185 |
+
|
| 186 |
+
Bound on excess risk: Recall that we assume that the residual term $N : = Y - \mathbb { E } [ Y | X _ { 1 } ]$ is mean zero and $\sigma ^ { 2 }$ -subgaussian. Before showing our main result, analogous to Assumption 3.3, for the class $\mathcal { H } _ { 1 }$ with non-universal features $\phi _ { 1 }$ , we will need an assumption6 on the residual $a : = f ^ { \ast } - f _ { \mathcal { H } _ { 1 } } ^ { \ast } = \mathbb { E } [ Y | X _ { 1 } ] - \mathbb { E } ^ { L } [ Y | \phi _ { 1 } ( X _ { 1 } ) ]$ :
|
| 187 |
+
|
| 188 |
+
Assumption 4.2. (Bounded approximation error on pretext phase [32]) There exists a universal constant $b _ { 0 }$ , such that $\| \Sigma _ { \phi _ { 1 } \phi _ { 1 } } ^ { - 1 / 2 } \phi _ { 1 } ( X _ { 1 } ) a ( X _ { 1 } ) ^ { \top } \| _ { F } \leq b _ { 0 } \sqrt { d _ { 2 } }$ almost surely.
|
| 189 |
+
|
| 190 |
+
Theorem 4.2. For a fixed $\delta \in ( 0 , 1 )$ , under Assumptions 4.1,3.2 for $\tilde { \psi }$ and $\psi ^ { * }$ and 4.2 for nonuniversal feature maps, if $\dot { n _ { 1 } } , \dot { n _ { 2 } } \gg \rho ^ { 4 } ( d _ { 2 } + \log 1 / \delta )$ , and we learn the pretext tasks such that: $\mathbb { E } \| \tilde { \psi } ( X _ { 1 } ) - \psi ^ { * } ( X _ { 1 } ) \| _ { F } ^ { 2 } \leq \epsilon _ { p r e } ^ { 2 }$ . Then the generalization error for downstream task w.p. $1 - \delta$ is:
|
| 191 |
+
|
| 192 |
+
$$
|
| 193 |
+
\begin{array} { r } { \mathrm { E R } _ { \tilde { \psi } } ( \hat { W } ) \leq \tilde { \mathcal { O } } \left( \underbrace { \sigma ^ { 2 } \frac { d _ { 2 } } { n _ { 2 } } } _ { e s t i m a t i o n \ e r r o r } + \underbrace { \frac { \epsilon _ { C I } ^ { 2 } } { \beta ^ { 2 } } + \frac { \epsilon _ { p r e } ^ { 2 } } { \beta ^ { 2 } } } _ { a p p r o x i m a t i o n \ e r r o r } \right) } \end{array}
|
| 194 |
+
$$
|
| 195 |
+
|
| 196 |
+
We defer the proof to the appendix. The proof technique is similar to that of Section 3. The difference is that now $\tilde { \psi } ( X ^ { ( \mathrm { d o w n } ) } ) \in \mathbb { R } ^ { n _ { 2 } \times d _ { 2 } }$ will be an approximately low rank matrix, where the low rank part is the high-signal features that implicitly comes from $Y , Z$ that can linearly learn downstream task. The remaining part comes from $\epsilon _ { \mathrm { { C I } } }$ and $\epsilon _ { \mathrm { p r e } }$ and causes the approximation error. Again by selecting the top $k m$ (dimension of $\phi _ { \bar { y } }$ ) features we could further improve the bound:
|
| 197 |
+
|
| 198 |
+
Remark 4.1. By applying PCA on $\tilde { \psi } ( X _ { 1 } ^ { d o w n } )$ and keeping the top km principal components only, we can improve the bound in Theorem 4.2 to $\begin{array} { r } { \mathrm { E R } _ { \tilde { \psi } } ( \hat { W } ) \leq \tilde { \mathcal { O } } \left( \sigma ^ { 2 } \frac { k m } { n _ { 2 } } + \frac { \epsilon _ { C I } ^ { 2 } } { \beta ^ { 2 } } + \frac { \epsilon _ { p r e } ^ { 2 } } { \beta ^ { 2 } } \right) } \end{array}$ .
|
| 199 |
+
|
| 200 |
+
We take a closer look at the different sources of errors in Lemma 4.1: 1) The first term is estimation error on learning with finite samples $n _ { 2 }$ with noise level $\sigma ^ { 2 }$ in $Y - f ^ { * } ( X _ { 1 } )$ ; 2) $\epsilon _ { \mathrm { { C I } } }$ measures the approximate CI; and 3) $\epsilon _ { \mathrm { p r e } }$ is the error from not learning the pretext task exactly. The first term is optimal ignoring log factors as we do linear regression on $m k$ -dimensional features. The second and third term together form approximation error. They are non-reducible due to the fact that $f ^ { * }$ is not exactly linear in $\psi$ and we use it as a fixed representation. Fine-tuning the representations might be necessary to get rid of these terms when we have sufficient downstream labeled data. We leave this exploring this as future work. Compared to traditional supervised learning, learning $f _ { \mathcal { H } } ^ { * }$ requires sample complexity scaling with the (Rademacher/Gaussian) complexity of $\mathcal { H }$ (see e.g. [8, 52]), which is very large for complicated models such as deep networks. Thus SSL can significantly reduce the labeled sample complexity down from this complexity measure of $\mathcal { H }$ to $\tilde { \mathcal { O } } ( k m )$ , demonstrating the power of predicting what you already know using unlabeled data. In Section H, we consider a similar result for classification.
|
| 201 |
+
|
| 202 |
+
# 5 Example: Topic Modeling
|
| 203 |
+
|
| 204 |
+
In this section, we will demonstrate how our framework can be instantiated for standard data model like topic modeling. Topic modeling for text that has a rich literature [47, 31, 9, 4, 3] and is used for analyzing and designing algorithms for information retrieval, dimensionality reduction and data analysis for large text corpora. We describe the basic setup below, followed by how our results for reconstruction-based SSL can be instantiated to learn such models.
|
| 205 |
+
|
| 206 |
+
For a set $S$ , let $\Delta _ { S }$ denote the set of all distributions on $S$ . In the topic modeling framework, generation of a text document with a vocabulary set $[ V ] = \{ 1 , \dots , V \}$ is governed by certain latent topics from the set $[ k ]$ , where $k$ is the total number of topics. Each topic $i \in [ k ]$ is associated with a distribution over the vocabulary $[ V ]$ that is denoted by vector $A _ { i } \in \Delta _ { [ V ] }$ ; stack these vectors into the columns of a matrix $A \in \mathbb { R } ^ { V \times k }$ . A document $X = ( x _ { 1 } , \ldots , x _ { n } ) \in [ V ] ^ { N }$ of length $N$ is then sampled from a mixture of the $k$ topics $\mu \in \Delta _ { [ k ] }$ . The generative process is described below:
|
| 207 |
+
|
| 208 |
+
1. Sample a topic mixture $\mu \sim \tau$ . $\tau$ is some underlying distribution over $\Delta _ { k }$ , i.e. $\tau \in \Delta _ { \Delta _ { [ k ] } }$
|
| 209 |
+
2. For each $i \in [ N ]$ , sample a topic $t _ { i } \sim \mu$ and sample a word $x _ { i } \sim A _ { t _ { i } }$ from the topic
|
| 210 |
+
|
| 211 |
+
For the reconstruction SSL task, we evenly split the document as $X = ( \bar { X _ { 1 } } , \bar { X _ { 2 } } )$ , where ${ \bar { X _ { 1 } } }$ and ${ \bar { X _ { 2 } } }$ denote the first and second halves of the document; note that $\bar { X _ { 1 } } , \bar { X _ { 2 } } \in [ V ] ^ { N / 2 }$ . We let $X _ { 1 }$ and $X _ { 2 }$ be the multiset of words in the two halves by using the normalized bag-of-words representation, i.e. $\begin{array} { r } { X _ { i } = \frac { 2 } { N } \mathfrak { b a g \mathrm { - } 0 f \mathrm { - } w o r d s } ( \bar { X } _ { i } ) \in \mathbb { R } ^ { V } , \ i \in \{ 1 , 2 \} ^ { 7 } } \end{array}$ . The downstream task is chosen to be a linear function of the topic posterior distribution $\mu$ for a given document $X$ , i.e. $Y = w ^ { \top } \mathbb { E } [ \mu | X ] + N$ , where $N$ is 0 mean and $\sigma ^ { 2 }$ -subgaussian. The error of a predictor $f : [ V ] ^ { N } \to \mathbb { R }$ is measured as $\mathbb { E } _ { \mu , X } \left[ \left( f ( X ) - \mu ^ { \top } w \right) ^ { 2 } \right]$ , the optimal predictor being $f ^ { * } ( X ) = \mathbb { E } \left[ Y \mid X \right]$ .
|
| 212 |
+
|
| 213 |
+
A crucial property of topic model described above is that words in the document are sampled independently given the topic mixture $\mu$ , thus giving us the property: $X _ { 1 } \perp X _ { 2 } \mid \mu$ . Although the cardinality of $\mu \in \Delta _ { [ k ] }$ (that implicitly shows up in Theorem 4.2) is infinite, we can still show the benefit of SSL using our theoretical framework. We will show appropriate bounds for $\epsilon _ { \mathrm { { C I } } }$ and $\beta$ , that show up in Theorem 4.2, using the topic model generative process. We make the following standard assumptions about the topic modeling distribution, motivated by prior work [4, 3].
|
| 214 |
+
|
| 215 |
+
Assumption 5.1. Let $A \in \mathbb { R } ^ { V \times k }$ be the word-topic matrix and $\Gamma = \mathbb { E } _ { \mu \sim \tau } \left[ \mu \mu ^ { \top } \right]$ be the topic covariance matrix, then the following hold
|
| 216 |
+
|
| 217 |
+
• (Anchor word) The word-topic matrix $A$ is $p$ -separable for $p > 0$ , i.e. for every topic $i \in [ k ]$ there is a word $j$ such that $A _ { i } ( j ) \geq p$ and $A _ { i ^ { \prime } } ( j ) = 0$ when $i ^ { \prime } \neq i$
|
| 218 |
+
• Γ is full rank, so condition number $\begin{array} { r } { \kappa = \frac { \lambda _ { \operatorname* { m a x } } ( \Gamma ) } { \lambda _ { \operatorname* { m i n } } ( \Gamma ) } < \infty } \end{array}$
|
| 219 |
+
|
| 220 |
+

|
| 221 |
+
Figure 1: Left two: how MSE scales with $k$ (the dimension of $Y$ ) and $\epsilon _ { C I }$ (Definition 4.1) with the linear function class. Right two: how MSE scales with $k$ and $\epsilon$ with $\psi ^ { * }$ and non-linear function class. Mean of 30 trials are shown in solid line and one standard error is shown by shadow.
|
| 222 |
+
|
| 223 |
+
Theorem 5.1. Let $\epsilon _ { C I }$ be the definition (2) from Definition 4.1 and $\beta$ as defined in Assumption 4.1 and suppose the topic model satisfies Assumption 5.1, then there exists a latent variable $\bar { Y } \in \bar { \mathcal { V } }$ such that the following hold
|
| 224 |
+
|
| 225 |
+
1. $\bar { Y }$ takes $k$ distinct values, i.e. $| \bar { \mathcal { V } } | = \underline { { k } }$
|
| 226 |
+
2. $X _ { 1 }$ and $X _ { 1 }$ are uncorrelated given $\bar { Y }$ , which implies $\epsilon _ { C I } = \mathbf { 0 }$
|
| 227 |
+
3 $ \xi [ Y | X _ { 1 } ]$ is a linear function of $\mathbb { E } [ { \bar { Y } } | X _ { 1 } ]$
|
| 228 |
+
4. $\beta ^ { - 1 } \leq \kappa \| w \| _ { 2 } / \lambda _ { \operatorname* { m i n } } ( A ) \leq \kappa \| w \| _ { 2 } / p$
|
| 229 |
+
|
| 230 |
+
The proof for this is presented in Section E.1. Note that the $p$ -separability is not necessarily needed, and the bound with $\lambda _ { \mathrm { m i n } } ( A )$ can be invoked instead. Thus the upper bound from Theorem 4.2) will look like $\tilde { \mathcal { O } } \left( \sigma ^ { 2 } \frac { k } { n _ { 2 } } + \epsilon _ { \mathrm { p r e } } ^ { 2 } \frac { \kappa \| w \| _ { 2 } } { p } \right)$ , thus requiring only ${ \mathcal { O } } ( k )$ samples for the downstream task.
|
| 231 |
+
|
| 232 |
+
# 6 Experiments
|
| 233 |
+
|
| 234 |
+
In this section, we empirically verify our claim that SSL performs well when ACI is satisfied. More details for experiments can be found in Section J, including experiments in the text domain.
|
| 235 |
+
|
| 236 |
+
Simulations. With synthetic data, we verify how excess risk (ER) scales with the cardinality/feature dimension of $\mathcal { V } \left( k \right)$ , and ACI ( $\epsilon _ { C I }$ in Definition 4.1). We consider a mixture of Gaussian data and conduct experiments with both linear function space $\mathcal { H } _ { 1 }$ with $\phi _ { 1 }$ as identity map) and universal function space $\mathcal { H } _ { u }$ . We sample the label $Y$ uniformly from $\{ 1 , . . . , k \}$ . For $i$ -th class, the centers $\mu _ { 1 i } \in \mathbb { R } ^ { d _ { 1 } }$ and $\mu _ { 2 i } \in \mathbb { R } ^ { d _ { 2 } }$ are uniformly sampled from $[ 0 , 1 0 )$ . Given $Y \ = \ i$ , $\alpha \in [ 0 , 1 ]$ , let $X _ { 1 } \sim \mathcal { N } ( \mu _ { 1 i } , \mathbf { I } )$ , $\hat { X _ { 2 } } \sim \mathcal { N } ( \mu _ { 2 i } , \mathbf { I } )$ , and $X _ { 2 } = ( 1 - \alpha ) \hat { X _ { 2 } } + \alpha X _ { 1 }$ . Therefore $\alpha$ is a correlation coefficient: $\alpha = 0$ ensures $X _ { 2 }$ being CI with $X _ { 1 }$ given $Y$ and when $\alpha = 1$ , $X _ { 2 }$ fully depends on $X _ { 1 }$ . (if $d _ { 1 } \neq d _ { 2 }$ , we append zeros or truncate to fit accordingly).
|
| 237 |
+
|
| 238 |
+
We first conduct experiments with linear function class. We learn a linear representation $\psi$ with $n _ { 1 }$ samples and the linear prediction of $Y$ from $\psi$ with $n _ { 2 }$ samples. We set $d _ { 1 } = 5 0$ , $d _ { 2 } = 4 0$ , $n _ { 1 } = 4 0 0 0$ , $n _ { 2 } = 1 0 0 0$ and ER is measured with Mean Squared Error (MSE). As shown in Figure 1(a)(b), the MSE of learning with $\psi ( X _ { 1 } )$ scales linearly with $k$ as indicated in Theorem 3.5, and scales linearly with $\epsilon _ { C I }$ associated with linear function class as indicated in Theorem 4.2. Next we move on to general function class, i.e., $\psi ^ { * } = \mathbb { E } [ Y | X _ { 1 } ]$ with a closed form solution (see example 3.1). We use the same parameter settings as above. For baseline method, we use kernel linear regression to predict $Y$ using $X _ { 1 }$ (we use RBF kernel which also has universal approximation power). As shown in Figure 1(c)(d), the phenomenon is the same as what we observe in the linear function class setting, and hence they respectively verify Theorem 3.2 and Theorem 4.2 with $\mathcal { H } _ { u }$ .
|
| 239 |
+
|
| 240 |
+
Computer Vision Task. We verify if learning from $\psi$ is more effective than learning directly from $X _ { 1 }$ , in a realistic setting (without enforcing conditional independence). Specifically, we test on the Yearbook dataset [23], and try to predict the date when the portraits are taken (denoted as $Y _ { D }$ ), which ranges from 1905 to 2013. We resize all the portraits to be 128 by 128. We crop out the center 64 by 64 pixels (the face), and treat it as $X _ { 2 }$ , and treat the outer rim as $X _ { 1 }$ as shown in Figure 2. Our task is to predict $Y _ { D }$ , which is the year when the portraits are taken, and the year ranges from 1905 to 2013. For $\psi$ , we learn $X _ { 2 }$ from $X _ { 1 }$ with standard image inpainting techniques [48], and full set of training data (without labels). After that we fix the learned $\psi$ and learn a linear model to predict $Y _ { D }$ from $\psi$ using a smaller set of data (with labels). Besides linear model on $X _ { 1 }$ , another strong baseline that we compare with is using ResNet18 [28] to predict $Y _ { D }$ from $X _ { 1 }$ . With the full set of training data, this model is able to achieve a Mean Absolute Difference of 6.89, close to what state-of-the-art can achieve [23]. ResNet18 has similar amount of parameters as our generator, and hence roughly in the same function class. We show the MSE result as in Figure 2. Learning from $\psi$ is more effective than learning from $X _ { 1 }$ or $X _ { 2 }$ directly, with linear model as well as with ResNet18. Practitioner usually fine-tune $\psi$ with the downstream task, which leads to more competitive performance [48].
|
| 241 |
+
|
| 242 |
+

|
| 243 |
+
Figure 2: Left: Example of the $X _ { 2 }$ (in the red box of the 1st row), the $X _ { 1 }$ (out of the red box of the 1st row), the input to the inpainting task (the second row), $\psi ( X _ { 1 } )$ (the 3 row in the red box), and in this example $Y = 1 9 6 7$ . Middle: Mean Squared Error comparison of yearbook regression predicting dates. Right: Mean Absolute Error comparison of yearbook regression predicting dates. Experiments are repeated 10 times, with mean shown in solid line and one standard deviation in shadow.
|
| 244 |
+
|
| 245 |
+
# 7 Conclusion
|
| 246 |
+
|
| 247 |
+
In this work we theoretically quantify how an approximate conditional independence assumption that connects pretext and downstream task data distributions can give sample complexity benefits of self-supervised learning on downstream tasks. Our theoretical findings are also supported by experiments on simulated data and also on real CV and NLP tasks. We would like to note that approximate CI is only a sufficient condition for a useful pretext task. We leave it for future work to investigate other mechanisms by which pretext tasks help with downstream tasks.
|
| 248 |
+
|
| 249 |
+
# Acknowledgment
|
| 250 |
+
|
| 251 |
+
JDL acknowledges support of the ARO under MURI Award W911NF-11-1-0304, the Sloan Research Fellowship, NSF CCF 2002272, NSF IIS 2107304, and an ONR Young Investigator Award. QL was supported by NSF #2030859 and the Computing Research Association for the CIFellows Project. NS is supported by NSF, ONR, Simons Foundation, DARPA and SRC. JZ acknowledges sponsorship of Army Research Office and support of Cooperative Agreement Number W911NF-19-2-0333 and NSF grant 2019844. The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of the Army Research Office or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation herein.
|
| 252 |
+
|
| 253 |
+
# References
|
| 254 |
+
|
| 255 |
+
[1] Guillaume Alain and Yoshua Bengio. What regularized auto-encoders learn from the datagenerating distribution. The Journal of Machine Learning Research, 15(1):3563–3593, 2014.
|
| 256 |
+
[2] Rie Kubota Ando and Tong Zhang. Two-view feature generation model for semi-supervised learning. In Proceedings of the 24th international conference on Machine learning, pages 25–32, 2007.
|
| 257 |
+
[3] Sanjeev Arora, Rong Ge, Yonatan Halpern, David Mimno, Ankur Moitra, David Sontag, Yichen Wu, and Michael Zhu. A practical algorithm for topic modeling with provable guarantees. In International conference on machine learning. PMLR, 2013.
|
| 258 |
+
|
| 259 |
+
[4] Sanjeev Arora, Rong Ge, and Ankur Moitra. Learning topic models–going beyond svd. In 2012 IEEE 53rd annual symposium on foundations of computer science. IEEE, 2012.
|
| 260 |
+
|
| 261 |
+
[5] Sanjeev Arora, Hrishikesh Khandeparkar, Mikhail Khodak, Orestis Plevrakis, and Nikunj Saunshi. A theoretical analysis of contrastive unsupervised representation learning. In Proceedings of the 36th International Conference on Machine Learning, 2019.
|
| 262 |
+
|
| 263 |
+
[6] Charles R Baker. Joint measures and cross-covariance operators. Transactions of the American Mathematical Society, 186:273–289, 1973.
|
| 264 |
+
|
| 265 |
+
[7] Andrew R Barron. Universal approximation bounds for superpositions of a sigmoidal function. IEEE Transactions on Information theory, 39(3):930–945, 1993.
|
| 266 |
+
|
| 267 |
+
[8] Peter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. Journal of Machine Learning Research, 3(Nov):463–482, 2002.
|
| 268 |
+
|
| 269 |
+
[9] David M Blei, Andrew $\mathrm { ~ Y ~ N ~ g ~ }$ , and Michael I Jordan. Latent dirichlet allocation. the Journal of machine Learning research, 2003.
|
| 270 |
+
|
| 271 |
+
[10] Avrim Blum and Tom Mitchell. Combining labeled and unlabeled data with co-training. In Proceedings of the eleventh annual conference on Computational learning theory, 1998.
|
| 272 |
+
|
| 273 |
+
[11] Yair Carmon, Aditi Raghunathan, Ludwig Schmidt, John C Duchi, and Percy S Liang. Unlabeled data improves adversarial robustness. In Advances in Neural Information Processing Systems, pages 11190–11201, 2019.
|
| 274 |
+
|
| 275 |
+
[12] Tianlong Chen, Sijia Liu, Shiyu Chang, Yu Cheng, Lisa Amini, and Zhangyang Wang. Adversarial robustness: From self-supervised pre-training to fine-tuning. arXiv preprint arXiv:2003.12862, 2020.
|
| 276 |
+
|
| 277 |
+
[13] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020.
|
| 278 |
+
|
| 279 |
+
[14] Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey Hinton. Big self-supervised models are strong semi-supervised learners. arXiv preprint arXiv:2006.10029, 2020.
|
| 280 |
+
|
| 281 |
+
[15] 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.
|
| 282 |
+
|
| 283 |
+
[16] Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised visual representation learning by context prediction. In Proceedings of the IEEE International Conference on Computer Vision, pages 1422–1430, 2015.
|
| 284 |
+
|
| 285 |
+
[17] Alexey Dosovitskiy, Philipp Fischer, Jost Tobias Springenberg, Martin Riedmiller, and Thomas Brox. Discriminative unsupervised feature learning with exemplar convolutional neural networks. IEEE transactions on pattern analysis and machine intelligence, 38(9):1734–1747, 2015.
|
| 286 |
+
|
| 287 |
+
[18] Simon S Du, Wei Hu, Sham M Kakade, Jason D Lee, and Qi Lei. Few-shot learning via learning the representation, provably. arXiv preprint arXiv:2002.09434, 2020.
|
| 288 |
+
|
| 289 |
+
[19] Basura Fernando, Hakan Bilen, Efstratios Gavves, and Stephen Gould. Self-supervised video representation learning with odd-one-out networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3636–3645, 2017.
|
| 290 |
+
|
| 291 |
+
[20] Kenji Fukumizu, Francis R Bach, and Michael I Jordan. Dimensionality reduction for supervised learning with reproducing kernel hilbert spaces. Journal of Machine Learning Research, 5(Jan):73–99, 2004.
|
| 292 |
+
|
| 293 |
+
[21] Kenji Fukumizu, Francis R Bach, Michael I Jordan, et al. Kernel dimension reduction in regression. The Annals of Statistics, 37(4):1871–1905, 2009.
|
| 294 |
+
|
| 295 |
+
[22] Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. arXiv preprint arXiv:1803.07728, 2018.
|
| 296 |
+
|
| 297 |
+
[23] Shiry Ginosar, Kate Rakelly, Sarah Sachs, Brian Yin, and Alexei A Efros. A century of portraits: A visual historical record of american high school yearbooks. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pages 1–7, 2015.
|
| 298 |
+
|
| 299 |
+
[24] Arthur Gretton, Olivier Bousquet, Alex Smola, and Bernhard Schölkopf. Measuring statistical dependence with hilbert-schmidt norms. In International conference on algorithmic learning theory, pages 63–77. Springer, 2005.
|
| 300 |
+
|
| 301 |
+
[25] Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020.
|
| 302 |
+
|
| 303 |
+
[26] David Gross. Recovering low-rank matrices from few coefficients in any basis. IEEE Transactions on Information Theory, 57(3):1548–1566, 2011.
|
| 304 |
+
|
| 305 |
+
[27] Michael Gutmann and Aapo Hyvärinen. Noise-contrastive estimation: A new estimation principle for unnormalized statistical models. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, 2010.
|
| 306 |
+
|
| 307 |
+
[28] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
|
| 308 |
+
|
| 309 |
+
[29] Dan Hendrycks, Mantas Mazeika, Saurav Kadavath, and Dawn Song. Using self-supervised learning can improve model robustness and uncertainty. In Advances in Neural Information Processing Systems, pages 15637–15648, 2019.
|
| 310 |
+
|
| 311 |
+
[30] R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. arXiv preprint arXiv:1808.06670, 2018.
|
| 312 |
+
|
| 313 |
+
[31] Thomas Hofmann. Probabilistic latent semantic indexing. In Proceedings of the 22nd annual international ACM SIGIR conference on Research and development in information retrieval, 1999.
|
| 314 |
+
|
| 315 |
+
[32] Daniel Hsu, Sham M Kakade, and Tong Zhang. Random design analysis of ridge regression. In Conference on learning theory, pages 9–1, 2012.
|
| 316 |
+
|
| 317 |
+
[33] Weihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik, Percy Liang, Vijay Pande, and Jure Leskovec. Strategies for pre-training graph neural networks. arXiv preprint arXiv:1905.12265, 2019.
|
| 318 |
+
|
| 319 |
+
[34] Tzee-Ming Huang. Testing conditional independence using maximal nonlinear conditional correlation. The Annals of Statistics, 38(4):2047–2091, 2010.
|
| 320 |
+
|
| 321 |
+
[35] Eric Jang, Coline Devin, Vincent Vanhoucke, and Sergey Levine. Grasp2vec: Learning object representations from self-supervised grasping. arXiv preprint arXiv:1811.06964, 2018.
|
| 322 |
+
|
| 323 |
+
[36] Longlong Jing and Yingli Tian. Self-supervised visual feature learning with deep neural networks: A survey. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020.
|
| 324 |
+
|
| 325 |
+
[37] Sham M Kakade and Dean P Foster. Multi-view regression via canonical correlation analysis. In International Conference on Computational Learning Theory, pages 82–96. Springer, 2007.
|
| 326 |
+
|
| 327 |
+
[38] Alexander Kolesnikov, Xiaohua Zhai, and Lucas Beyer. Revisiting self-supervised visual representation learning. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 1920–1929, 2019.
|
| 328 |
+
|
| 329 |
+
[39] Lajanugen Logeswaran and Honglak Lee. An efficient framework for learning sentence representations. In Proceedings of the International Conference on Learning Representations, 2018.
|
| 330 |
+
|
| 331 |
+
[40] Zhuang Ma and Michael Collins. Noise contrastive estimation and negative sampling for conditional models: Consistency and statistical efficiency. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, 2018.
|
| 332 |
+
|
| 333 |
+
[41] Charles A Micchelli, Yuesheng Xu, and Haizhang Zhang. Universal kernels. Journal of Machine Learning Research, 7(Dec):2651–2667, 2006.
|
| 334 |
+
|
| 335 |
+
[42] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, 2013.
|
| 336 |
+
|
| 337 |
+
[43] Ishan Misra, C Lawrence Zitnick, and Martial Hebert. Shuffle and learn: unsupervised learning using temporal order verification. In European Conference on Computer Vision, pages 527–544. Springer, 2016.
|
| 338 |
+
|
| 339 |
+
[44] Jovana Mitrovic, Brian McWilliams, Jacob Walker, Lars Buesing, and Charles Blundell. Representation learning via invariant causal mechanisms. arXiv preprint arXiv:2010.07922, 2020.
|
| 340 |
+
|
| 341 |
+
[45] Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In European Conference on Computer Vision, pages 69–84. Springer, 2016.
|
| 342 |
+
|
| 343 |
+
[46] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 344 |
+
|
| 345 |
+
[47] Christos H Papadimitriou, Prabhakar Raghavan, Hisao Tamaki, and Santosh Vempala. Latent semantic indexing: A probabilistic analysis. Journal of Computer and System Sciences, 2000.
|
| 346 |
+
|
| 347 |
+
[48] Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2536–2544, 2016.
|
| 348 |
+
|
| 349 |
+
[49] Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. URL https://s3-us-west-2. amazonaws. com/openaiassets/researchcovers/languageunsupervised/language understanding paper. pdf, 2018.
|
| 350 |
+
|
| 351 |
+
[50] Michael Reed. Methods of modern mathematical physics: Functional analysis. Elsevier, 2012.
|
| 352 |
+
|
| 353 |
+
[51] Nikunj Saunshi, Sadhika Malladi, and Sanjeev Arora. A mathematical exploration of why language models help solve downstream tasks. arXiv preprint arXiv:2010.03648, 2020.
|
| 354 |
+
|
| 355 |
+
[52] Shai Shalev-Shwartz and Shai Ben-David. Understanding machine learning: From theory to algorithms. Cambridge university press, 2014.
|
| 356 |
+
|
| 357 |
+
[53] Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Y Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language processing, 2013.
|
| 358 |
+
|
| 359 |
+
[54] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. arXiv preprint arXiv:1906.05849, 2019.
|
| 360 |
+
|
| 361 |
+
[55] Yuandong Tian, Lantao Yu, Xinlei Chen, and Surya Ganguli. Understanding self-supervised learning with dual deep networks. arXiv preprint arXiv:2010.00578, 2020.
|
| 362 |
+
|
| 363 |
+
[56] Christopher Tosh, Akshay Krishnamurthy, and Daniel Hsu. Contrastive estimation reveals topic posterior information to linear models. arXiv preprint arXiv:2003.02234, 2020.
|
| 364 |
+
|
| 365 |
+
[57] Christopher Tosh, Akshay Krishnamurthy, and Daniel Hsu. Contrastive learning, multi-view redundancy, and linear models. arXiv preprint arXiv:2008.10150, 2020.
|
| 366 |
+
|
| 367 |
+
[58] Yao-Hung Hubert Tsai, Yue Wu, Ruslan Salakhutdinov, and Louis-Philippe Morency. Demystifying self-supervised learning: An information-theoretical framework. arXiv preprint arXiv:2006.05576, 2020.
|
| 368 |
+
|
| 369 |
+
[59] Michael Tschannen, Josip Djolonga, Paul K Rubenstein, Sylvain Gelly, and Mario Lucic. On mutual information maximization for representation learning. arXiv preprint arXiv:1907.13625, 2019.
|
| 370 |
+
[60] Pascal Vincent. A connection between score matching and denoising autoencoders. Neural computation, 23(7):1661–1674, 2011.
|
| 371 |
+
[61] Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. Extracting and composing robust features with denoising autoencoders. In Proceedings of the 25th international conference on Machine learning, pages 1096–1103, 2008.
|
| 372 |
+
[62] Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. arXiv preprint arXiv:2005.10242, 2020.
|
| 373 |
+
[63] Xiaolong Wang and Abhinav Gupta. Unsupervised learning of visual representations using videos. In Proceedings of the IEEE International Conference on Computer Vision, 2015.
|
| 374 |
+
[64] Donglai Wei, Joseph J Lim, Andrew Zisserman, and William T Freeman. Learning and using the arrow of time. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8052–8060, 2018.
|
| 375 |
+
[65] Han Yang, Xiao Yan, Xinyan Dai, and James Cheng. Self-enhanced gnn: Improving graph neural networks using model outputs. arXiv preprint arXiv:2002.07518, 2020.
|
| 376 |
+
[66] Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In European conference on computer vision, pages 649–666. Springer, 2016.
|
| 377 |
+
[67] Richard Zhang, Phillip Isola, and Alexei A Efros. Split-brain autoencoders: Unsupervised learning by cross-channel prediction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1058–1067, 2017.
|
| 378 |
+
[68] Zaiwei Zhang, Zhenxiao Liang, Lemeng Wu, Xiaowei Zhou, and Qixing Huang. Path-invariant map networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 11084–11094, 2019.
|
| 379 |
+
|
| 380 |
+
# Checklist
|
| 381 |
+
|
| 382 |
+
The checklist follows the references. Please read the checklist guidelines carefully for information on how to answer these questions. For each question, change the default [TODO] to [Yes] , [No] , or [N/A] . You are strongly encouraged to include a justification to your answer, either by referencing the appropriate section of your paper or providing a brief inline description. For example:
|
| 383 |
+
|
| 384 |
+
• Did you include the license to the code and datasets? [Yes] See Section ??.
|
| 385 |
+
• Did you include the license to the code and datasets? [No] The code and the data are proprietary.
|
| 386 |
+
• Did you include the license to the code and datasets? [N/A]
|
| 387 |
+
|
| 388 |
+
Please do not modify the questions and only use the provided macros for your answers. Note that the Checklist section does not count towards the page limit. In your paper, please delete this instructions block and only keep the Checklist section heading above along with the questions/answers below.
|
| 389 |
+
|
| 390 |
+
1. For all authors...
|
| 391 |
+
|
| 392 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] See Section 1, especially the contribution paragraph.
|
| 393 |
+
(b) Did you describe the limitations of your work? [Yes] See the Conclusion section and line 314-326.
|
| 394 |
+
(c) Did you discuss any potential negative societal impacts of your work? [No] This is mainly a theoretical work with simulations and should not cause much social impacts.
|
| 395 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 396 |
+
|
| 397 |
+
2. If you are including theoretical results...
|
| 398 |
+
|
| 399 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] Every assumption is listed as a standalone block. Every theorem or lemma is self-contained.
|
| 400 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] For every theorem, lemma, claim, and some technical remarks, we indicate where their proof is located in the Appendix.
|
| 401 |
+
|
| 402 |
+
3. If you ran experiments...
|
| 403 |
+
|
| 404 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [No] The codes will be made public after this work is accepted for publish.
|
| 405 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] The details are provided in the sections 6 and J
|
| 406 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Figure 1, Figure 5 and Figure 2.
|
| 407 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] The details are provided in the Appendix
|
| 408 |
+
|
| 409 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 410 |
+
|
| 411 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] See Section 6.
|
| 412 |
+
(b) Did you mention the license of the assets? [Yes] The details are provided in the Appendix
|
| 413 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 414 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 415 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] All the portrait in the Yearbook dataset are in public domain. Please find the detailed discussion in Section 3 of the Yearbook dataset paper [23]
|
| 416 |
+
|
| 417 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 418 |
+
|
| 419 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 420 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 421 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/ZIyj0E58vzlo/ZIyj0E58vzlo.md
ADDED
|
@@ -0,0 +1,362 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Fast Policy Extragradient Methods for Competitive Games with Entropy Regularization
|
| 2 |
+
|
| 3 |
+
Shicong Cen Carnegie Mellon University shicongc@andrew.cmu.edu
|
| 4 |
+
|
| 5 |
+
Yuting Wei University of Pennsylvania ytwei@wharton.upenn.edu
|
| 6 |
+
|
| 7 |
+
Yuejie Chi Carnegie Mellon University yuejiechi@cmu.edu
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
This paper investigates the problem of computing the equilibrium of competitive games, which is often modeled as a constrained saddle-point optimization problem with probability simplex constraints. Despite recent efforts in understanding the last-iterate convergence of extragradient methods in the unconstrained setting, the theoretical underpinnings of these methods in the constrained settings, especially those using multiplicative updates, remain highly inadequate, even when the objective function is bilinear. Motivated by the algorithmic role of entropy regularization in single-agent reinforcement learning and game theory, we develop provably efficient extragradient methods to find the quantal response equilibrium (QRE)—which are solutions to zero-sum two-player matrix games with entropy regularization—at a linear rate. The proposed algorithms can be implemented in a decentralized manner, where each player executes symmetric and multiplicative updates iteratively using its own payoff without observing the opponent’s actions directly. In addition, by controlling the knob of entropy regularization, the proposed algorithms can locate an approximate Nash equilibrium of the unregularized matrix game at a sublinear rate without assuming the Nash equilibrium to be unique. Our methods also lead to efficient policy extragradient algorithms for solving entropy-regularized zero-sum Markov games at a linear rate. All of our convergence rates are nearly dimension-free, which are independent of the size of the state and action spaces up to logarithm factors, highlighting the positive role of entropy regularization for accelerating convergence.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Finding the equilibrium of competitive games, which can be viewed as constrained saddle-point optimization problems with probability simplex constraints, lies at the heart of modern machine learning and decision making paradigms such as Generative Adversarial Networks (GANs) (Goodfellow et al., 2014), competitive reinforcement learning (RL) (Littman, 1994), game theory (Shapley, 1953), adversarial training (Mertikopoulos et al., 2018b), to name a few.
|
| 16 |
+
|
| 17 |
+
In this paper, we study one of the most basic forms of competitive games, namely two-player zero-sum games, in both the matrix setting and the Markov setting. Our goal is to find the equilibrium policies of both players in an independent and decentralized manner (Daskalakis et al., 2020; Wei et al., 2021a) with guaranteed last-iterate convergence. Namely, each player will execute symmetric and independent updates iteratively using its own payoff without observing the opponent’s actions directly, and the final policies of the iterative process should be a close approximation to the equilibrium up to any prescribed precision. This kind of algorithms is more advantageous and versatile especially in federated environments, as it requires neither prior coordination between the players like twotimescale algorithms, nor a central controller to collect and disseminate the policies of all the players, which are often unavailable due to privacy constraints.
|
| 18 |
+
|
| 19 |
+
# 1.1 Last-iterate convergence in competitive games
|
| 20 |
+
|
| 21 |
+
In recent years, there have been significant progresses in understanding the last-iterate convergence of simple iterative algorithms for unconstrained saddle-point optimization, where one is interested in bounding the sub-optimality of the last iterate of the algorithm, rather than say, the ergodic iterate — which is the average of all the iterations — that are commonly studied in the earlier literature. This shift of focus is motivated, for example, by the infeasibility of averaging large machine learning models in training GANs (Goodfellow et al., 2014). While vanilla Gradient Descent / Ascent (GDA) may diverge or cycle even for bilinear matrix games (Daskalakis et al., 2018), quite remarkably, small modifications lead to guaranteed last-iterate convergence to the equilibrium in a non-asymptotic fashion. A flurry of algorithms is proposed, including Optimistic Gradient Descent Ascent (OGDA) (Rakhlin and Sridharan, 2013; Daskalakis and Panageas, 2018b; Wei et al., 2021b), predictive updates (Yadav et al., 2017), implicit updates (Liang and Stokes, 2019), and more. Several unified analyses of these algorithms have been carried out (see, e.g. Mokhtari et al. (2020a); Liang and Stokes (2019) and references therein), where these methods in principle all make clever extrapolation of the local curvature in a predictive manner to accelerate convergence. With slight abuse of terminology, in this paper, we refer to this ensemble of algorithms as extragradient methods (Korpelevich, 1976; Tseng, 1995; Mertikopoulos et al., 2018a; Harker and Pang, 1990).
|
| 22 |
+
|
| 23 |
+
However, saddle-point optimization in the constrained setting, which includes competitive games as a special case, remains largely under-explored even for bilinear matrix games. While it is possible to reformulate constrained bilinear games to unconstrained ones using softmax parameterization of the probability simplex, this approach falls short of preserving the bilinear structure and convexconcave properties in the original problem, which are crucial to the convergence of gradient methods. Therefore, there is a strong necessity of understanding and developing improved extragradient methods in the constrained setting. Daskalakis and Panageas (2018a) proposed the optimistic variant of the multiplicative weight updates (MWU) method (Arora et al., 2012) – which is extremely natural and popular for optimizing over probability simplexes – called Optimistic Multiplicative Weight Updates (OMWU), and established the asymptotic last-iterate convergence of OMWU for matrix games. Very recently, Wei et al. (2021b) established non-asymptotic last-iterate convergences of OMWU. However, these last-iterate convergence results require the Nash equilibrium to be unique, and cannot be applied to problems with multiple Nash equilibria.
|
| 24 |
+
|
| 25 |
+
# 1.2 Our contributions
|
| 26 |
+
|
| 27 |
+
Motivated by the algorithmic role of entropy regularization in single-agent RL (Neu et al., 2017; Geist et al., 2019; Cen et al., 2020) as well as its wide use in game theory to account for imperfect and noisy information (McKelvey and Palfrey, 1995; Savas et al., 2019), we initiate the design and analysis of extragradient algorithms using multiplicative updates for finding the quantal response equilibrium (QRE), which are solutions to competitive games with entropy regularization (McKelvey and Palfrey, 1995). While finding QRE is of interest in its own right, by controlling the knob of entropy regularization, the QRE provides a close approximation to the Nash equilibrium (NE), and in turn acts as a smoothing scheme for finding the NE. Our contributions are summarized below.
|
| 28 |
+
|
| 29 |
+
• Near dimension-free last-iterate convergence to QRE of entropy-regularized matrix games. We propose two policy extragradient algorithms to solve entropy-regularized matrix games, namely the Predictive Update (PU) and OMWU methods, where both players execute symmetric and multiplicative updates without knowing the entire payoff matrix nor the opponent’s actions. Encouragingly, we show that the last iterate of the proposed algorithms converges to the unique QRE at a linear rate that is almost independent of the size of the action spaces. Roughly speaking, to find an $\epsilon$ -optimal QRE in terms of Kullback-Leibler (KL) divergence, it takes no more than $\begin{array} { r } { \widetilde O \left( \frac { 1 } { \eta \tau } \log \left( \frac { 1 } { \epsilon } \right) \right) } \end{array}$ iterations, where ${ \widetilde { O } } ( \cdot )$ hides logarithmic dependencies. Here, $\tau$ is the regularization parameter, and $\eta$ is the learning rate of both players. Maximizing the learning rate, the iteration complexity is bounded by $\widetilde { O } \left( ( 1 + \| A \| _ { \infty } / \tau ) \log ( 1 / \epsilon ) \right)$ , where $\left\| A \right\| _ { \infty } = \operatorname* { m a x } _ { i , j } \left| A _ { i , j } \right|$ is the $\ell _ { \infty }$ norm of the payoff matrix $A$ .
|
| 30 |
+
|
| 31 |
+
• Last-iterate convergence to $\epsilon$ -NE of unregularized matrix games without uniqueness assumption. The QRE provides an accurate approximation to the NE by setting the entropy regularization $\tau$ sufficiently small, therefore our result directly translates to finding a NE with last-iterate convergence guarantee. Roughly speaking, to find an $\epsilon$ -NE (Zhang et al., 2020, Definition 2.1), it takes no more than $\begin{array} { r } { \widetilde { O } \left( 1 + \frac { \| A \| _ { \infty } } { \epsilon } \right) } \end{array}$ iterations with optimized learning rates, which is again independent of the size of the action spaces up to logarithmic factors. Unlike prior literature (Daskalakis and Panageas, 2018a; Wei et al., 2021b), our last-iterate convergence guarantee does not require the NE to be unique.
|
| 32 |
+
|
| 33 |
+
Table 1: Comparisons of last-iterate convergence of the proposed entropy-regularized PU and OMWU methods with prior results for finding $\epsilon$ -QRE or $\mathrm { \epsilon - N E }$ of competitive matrix games. We note that the convergence rates of unregularized OMWU established in Wei et al. (2021b) are problemdependent, and scale at least polynomially on the size of the action spaces. Desirable features in the last two columns are highlighted in blue.
|
| 34 |
+
|
| 35 |
+
<table><tr><td rowspan=1 colspan=1>Equilibriumtype</td><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Convergence rate</td><td rowspan=1 colspan=1>Dimension-free</td><td rowspan=1 colspan=1>Requireunique NE</td></tr><tr><td rowspan=1 colspan=1>E-QRE</td><td rowspan=1 colspan=1>PU&OMWU(this work)</td><td rowspan=1 colspan=1>linear</td><td rowspan=1 colspan=1>yes</td><td rowspan=1 colspan=1>n/a</td></tr><tr><td rowspan=3 colspan=1>e-NE</td><td rowspan=1 colspan=1>OMWU(Daskalakis and Panageas, 2018a)</td><td rowspan=1 colspan=1>asymptotic</td><td rowspan=1 colspan=1>no</td><td rowspan=1 colspan=1>yes</td></tr><tr><td rowspan=1 colspan=1>OMWU(Wei et al., 2021b)</td><td rowspan=1 colspan=1>sublinear + linear</td><td rowspan=1 colspan=1>no</td><td rowspan=1 colspan=1>yes</td></tr><tr><td rowspan=1 colspan=1>PU&OMWU(this work)</td><td rowspan=1 colspan=1>sublinear</td><td rowspan=1 colspan=1>yes</td><td rowspan=1 colspan=1>no</td></tr></table>
|
| 36 |
+
|
| 37 |
+
• Extensions to two-player zero-sum Markov games. By connecting value iteration with matrix games, we propose a policy extragradient method for solving infinite-horizon discounted entropyregularized zero-sum Markov games, which finds an $\epsilon$ -optimal minimax soft Q-function—in terms of $\ell _ { \infty }$ error—in at most $\begin{array} { r } { \widetilde O \left( \frac { 1 } { \tau ( 1 - \gamma ) ^ { 2 } } \log ^ { 2 } \left( \frac { 1 } { \epsilon } \right) \right) } \end{array}$ iterations, where $\gamma \in ( 0 , 1 )$ is the discount factor.
|
| 38 |
+
|
| 39 |
+
To the best of our knowledge, our paper is the first that develops policy extragradient algorithms for solving entropy-regularized competitive games with multiplicative updates and dimension-free linear last-iterate convergence, and demonstrates entropy regularization as a smoothing technique to find $\mathrm { \epsilon - N E }$ without the uniqueness assumption. Table 1 provides detailed comparisons of the proposed methods with prior arts for solving matrix games. Our results highlight the positive role of entropy regularization for accelerating convergence and safeguarding against imperfect information in competitive games. We defer the complete proof of our results to Cen et al. (2021).
|
| 40 |
+
|
| 41 |
+
# 1.3 Related works
|
| 42 |
+
|
| 43 |
+
Our work lies at the intersection of saddle-point optimization, game theory, and reinforcement learning. In what follows, we discuss a few topics that are closely related to ours.
|
| 44 |
+
|
| 45 |
+
Unregularized matrix game. Freund and Schapire (1999) showed that many standard methods such as GDA and MWU have a converging average duality gap at the rate of $O ( 1 / \sqrt { T } )$ , which is improved to $O ( 1 / T )$ by considering optimistic variants of these methods, such as OGDA and OMWU (Rakhlin and Sridharan, 2013; Daskalakis et al., 2011; Syrgkanis et al., 2015). However, the last-iterate convergence of these methods are less understood until recently (Daskalakis and Panageas, 2018a; Wei et al., 2021b). In particular, under the assumption that the NE is unique for the unregularized matrix game, Daskalakis and Panageas (2018a) showed the asymptotic convergence of the last iterate of OMWU to the unique equilibrium, and Wei et al. (2021b) showed the last iterate of OMWU achieves a linear rate of convergence after an initial phase of sublinear convergence, however the rates therein can be highly pessimistic in terms of the problem dimension, while our rate for entropy-regularized OMWU is dimension-free up to logarithmic factors.
|
| 46 |
+
|
| 47 |
+
Saddle-point optimization. Considerable progress has been made towards understanding OGDA and extragradient (EG) methods in the unconstrained convex-concave saddle-point optimization with general objective functions (Mokhtari et al., 2020a,b; Nemirovski, 2004; Liang and Stokes, 2019). However, the last-iterate convergence of constrained convex-concave saddle-point optimization still lacks theoretical understanding in general and most works fall short of characterizing a finite-time convergence result. In particular, Mertikopoulos et al. (2018a) demonstrated the asymptotic lastiterate convergence of EG, and Hsieh et al. (2019) investigated similar questions for single-call EG algorithms. Lei et al. (2021) showed that OMWU converges to the equilibrium locally without an explicit rate. Wei et al. (2021b) showed that the last-iterate of OGDA converges linearly for strongly-convex strongly-concave constrained saddle-point optimization with an explicit rate.
|
| 48 |
+
|
| 49 |
+
Entropy regularization in RL and games. In single-agent RL, the role of entropy regularization as an algorithmic mechanism to encourage exploration and accelerate convergence has been investigated extensively (Neu et al., 2017; Geist et al., 2019; Mei et al., 2020; Cen et al., 2020; Lan, 2021; Zhan et al., 2021). Turning to the game setting, entropy regularization is used to account for imperfect information in the seminal work of McKelvey and Palfrey (1995) that introduced the QRE, and a few representative works on entropy and more general regularizations in games include Savas et al. (2019); Hofbauer and Sandholm (2002); Mertikopoulos and Sandholm (2016).
|
| 50 |
+
|
| 51 |
+
Zero-sum Markov games. There have been a significant recent interest in developing provably efficient self-play algorithms for Markov games, including model-based algorithms (Perolat et al., 2015; Zhang et al., 2020), value-based algorithms (Bai and Jin, 2020; Xie et al., 2020), and policybased algorithms (Daskalakis et al., 2020; Wei et al., 2021a; Zhao et al., 2021). The iteration complexities in prior works (Perolat et al., 2015; Daskalakis et al., 2020; Wei et al., 2021a; Zhao et al., 2021) depend on various notions of concentrability coefficient and therefore can scale quite pessimistically with the problem dimension. Our approach can be regarded as a policy-based algorithm to approximate value iteration, which can be implemented in a decentralized manner with symmetric and multiplicative updates from both players, and the iteration complexity is almost independent of the size of the state-action space.
|
| 52 |
+
|
| 53 |
+
Notation. We denote by $\Delta ( \mathcal { A } )$ the probability simplex over the set $\mathcal { A }$ . We overload the functions such as $\log ( \cdot )$ and $\exp ( \cdot )$ to take vector inputs with the understanding that the function is applied in an entrywise manner. For instance, given any vector $z = [ z _ { i } ] _ { 1 \leq i \leq n } \in \mathbb { R } ^ { n }$ , the notation $\exp ( z )$ denotes $\exp ( z ) : = [ \exp ( z _ { i } ) ] _ { 1 \leq i \leq n }$ ; other functions are defined analogously. Given two probability distributions $\mu$ and $\mu ^ { \prime }$ over $\mathcal { A }$ , the KL divergence from $\mu ^ { \prime }$ to $\mu$ is defined by $\begin{array} { r } { \mathsf { K L } ( \mu \parallel \mu ^ { \prime } ) : = \sum _ { a \in \mathcal { A } } \mu ( a ) \log \frac { \mu ( a ) } { \mu ^ { \prime } ( a ) } } \end{array}$ . Given a matrix $A$ , $\| A \| _ { \infty }$ is used to denote entrywise maximum norm, namely, $\left\| A \right\| _ { \infty } = \operatorname* { m a x } _ { i , j } \left| A _ { i , j } \right|$ . The all-one vector is denoted as 1.
|
| 54 |
+
|
| 55 |
+
# 2 Zero-sum matrix games with entropy regularization
|
| 56 |
+
|
| 57 |
+
We first consider a two-player zero-sum game with bilinear objective and probability simplex constraints, and demonstrate the positive role of entropy regularization in solving this problem. Throughout this paper, let $\mathcal { A } = \{ 1 , \dotsc , m \}$ and $\boldsymbol { B } = \{ 1 , \ldots , \bar { n } \}$ be the action spaces of each player.
|
| 58 |
+
|
| 59 |
+
# 2.1 Background and problem formulation
|
| 60 |
+
|
| 61 |
+
Zero-sum two-player matrix game. The focal point of this subsection is a constrained two-player zero-sum matrix game, which can be formulated as the following min-max problem (or saddle point optimization problem):
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\operatorname* { m a x } _ { \mu \in \Delta ( \mathcal { A } ) } \operatorname* { m i n } _ { \nu \in \Delta ( \mathcal { B } ) } f ( \mu , \nu ) : = \mu ^ { \top } A \nu ,
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $\textbf { \textit { A } } \in \mathbb { R } ^ { m \times n }$ denotes the payoff matrix, $\mu ~ \in ~ \Delta ( { \mathcal { A } } )$ and $\nu ~ \in ~ \Delta ( B )$ stand for the mixed/randomized policies of each player, defined respectively as distributions over the probability simplex $\Delta ( \mathcal { A } )$ and $\Delta ( B )$ . A pair of policies $( \mu ^ { \star } , \nu ^ { \star } )$ is said to be a Nash equilibrium (NE) of (1) if $f ( \mu ^ { \star } , \nu ) \geq f ( \mu ^ { \star } , \nu ^ { \star } ) \geq f ( \mu , \nu ^ { \star } )$ for all $( \mu , \nu ) \in \Delta ( \mathcal { A } ) \times \Delta ( \mathcal { B } )$ .
|
| 68 |
+
|
| 69 |
+
Entropy-regularized zero-sum two-player matrix game. There is no shortage of scenarios where the payoff matrix $A$ might not be known perfectly. In an attempt to accommodate imperfect knowledge of $A$ , McKelvey and Palfrey (1995) proposed a seminal extension to the Nash equilibrium called the quantal response equilibrium $( Q R E )$ when the payoffs are perturbed by Gumbel-distributed noise. Formally, this amounts to solving the following matrix game with entropy regularization (Mertikopoulos and Sandholm, 2016):
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\operatorname* { m a x } _ { \mu \in \Delta ( \mathcal { A } ) } \operatorname* { m i n } _ { \nu \in \Delta ( \mathcal { B } ) } f _ { \tau } ( \mu , \nu ) : = \mu ^ { \top } A \nu + \tau \mathcal { H } ( \mu ) - \tau \mathcal { H } ( \nu ) ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $\begin{array} { r } { \mathcal { H } ( \pi ) = - \sum _ { i } \pi _ { i } \log ( \pi _ { i } ) } \end{array}$ denotes the Shannon entropy of a distribution $\pi$ , and $\tau \geq 0$ is the regularization parameter. As is well known, the optimal solution $( \mu _ { \tau } ^ { \star } , \nu _ { \tau } ^ { \star } )$ to (2), dubbed as the QRE,
|
| 76 |
+
|
| 77 |
+
is unique whenever $\tau > 0$ (due to the presence of strong concavity/convexity), which satisfies the following fixed point equations:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { r } { \biggr \{ \mu _ { \tau } ^ { \star } ( a ) = \frac { \exp ( [ A \nu _ { \tau } ^ { \star } ] a / \tau ) } { \sum _ { a = 1 } ^ { m } \exp ( [ A \nu _ { \tau } ^ { \star } ] a / \tau ) } \propto \exp ( [ A \nu _ { \tau } ^ { \star } ] a / \tau ) , \qquad \mathrm { f o r ~ a l l } \ a \in \mathcal { A } , } \\ { \nu _ { \tau } ^ { \star } ( b ) = \frac { \exp ( - [ A ^ { \top } \mu _ { \tau } ^ { \star } ] b / \tau ) } { \sum _ { b = 1 } ^ { n } \exp ( - [ A ^ { \top } \mu _ { \tau } ^ { \star } ] b / \tau ) } \propto \exp ( - [ A ^ { \top } \mu _ { \tau } ^ { \star } ] b / \tau ) , \quad \mathrm { f o r ~ a l l } \ b \in \mathcal { B } . } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Goal. We aim to efficiently compute the QRE of the entropy-regularized matrix game in a decentralized manner, and investigate how an efficient solver of QRE can be leveraged to find a NE of the unregularized matrix game (1). Namely, we only assume access to “first-order information” as opposed to full knowledge of the payoff matrix $A$ or the actions of the opponent. The information received by each player is formally described in the following sampling oracle.
|
| 84 |
+
|
| 85 |
+
Definition 1 (Sampling oracle for matrix games). For any policy pair $( \mu , \nu )$ and payoff matrix $A$ the sampling oracle returns the exact values of $\mu ^ { \top } A$ and $A \nu$ .
|
| 86 |
+
|
| 87 |
+
Additional notation. For notational convenience, we let $\zeta$ represent the concatenation of $\mu \in \mathbb { R } ^ { | \mathcal { A } | }$ and $\nu \in \mathbb { R } ^ { | B | }$ , namely, $\zeta = ( \mu , \nu )$ . The solution to (2), which is specified in (3), is denoted by $\zeta _ { \tau } ^ { \star } = ( \mu _ { \tau } ^ { \star } , \nu _ { \tau } ^ { \star } )$ . For any $\zeta = ( \mu , \nu )$ and $\zeta ^ { \prime } = ( \mu ^ { \prime } , \nu ^ { \prime } )$ , we shall often abuse the notation and let $\mathsf { K L } \big ( \zeta \| \zeta ^ { \prime } \big ) = \mathsf { K L } \big ( \mu \| \mu ^ { \prime } \big ) + \mathsf { K L } \big ( \nu \| \nu ^ { \prime } \big )$ . The duality gap of the entropy-regularized matrix game (2) at $\zeta = ( \mu , \nu )$ is defined as $\begin{array} { r } { \mathsf { D u a l G a p } _ { \tau } ( \zeta ) = \operatorname* { m a x } _ { \mu ^ { \prime } \in \Delta ( A ) } f _ { \tau } ( \mu ^ { \prime } , \nu ) - \operatorname* { m i n } _ { \nu ^ { \prime } \in \Delta ( B ) } f _ { \tau } ( \mu , \nu ^ { \prime } ) } \end{array}$ which is clearly nonnegative and $\mathsf { D u a l G a p } _ { \tau } ( \boldsymbol { \zeta } _ { \tau } ^ { \star } ) = 0$ . Similarly, let the optimality gap of the entropyregularized matrix game (2) at $\zeta = ( \mu , \nu )$ be $\mathsf { O p t G a p } ( \zeta ) = \left| f _ { \tau } ( \mu , \nu ) - f _ { \tau } ( \mu _ { \tau } ^ { \star } , \nu _ { \tau } ^ { \star } ) \right|$ .
|
| 88 |
+
|
| 89 |
+
# 2.2 Proposed extragradient methods: PU and OMWU
|
| 90 |
+
|
| 91 |
+
To begin, assume we are given a pair of policies $z _ { 1 } \in \Delta ( \mathcal { A } )$ , $z _ { 2 } \in \Delta ( B )$ employed by each player respectively. If we proceed with fictitious play, i.e. player 1 (resp. player 2) aims to optimize its own policy by assuming the opponent’s policy is fixed as $z _ { 2 }$ (resp. $z _ { 1 }$ ), the saddle-point optimization problem (2) is then decoupled into two independent min/max optimization problems:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\operatorname* { m a x } _ { \mu \in \Delta ( A ) } \mu ^ { \top } A z _ { 2 } + \tau \mathcal { H } ( \mu ) - \tau \mathcal { H } ( z _ { 2 } ) \qquad \mathrm { a n d } \qquad \operatorname* { m i n } _ { \nu \in \Delta ( B ) } z _ { 1 } ^ { \top } A \nu + \tau \mathcal { H } ( z _ { 1 } ) - \tau \mathcal { H } ( \nu ) ,
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
which are naturally solved via mirror descent / ascent with KL divergence. Specifically, one step of mirror descent / ascent takes the form
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { r } { \left\{ \begin{array} { l l } { \mu ^ { ( t + 1 ) } ( a ) \propto \mu ^ { ( t ) } ( a ) ^ { 1 - \eta \tau } \exp ( \eta [ A z _ { 2 } ] _ { a } ) , } & { \mathrm { f o r ~ a l l ~ } a \in \mathcal { A } , } \\ { \nu ^ { ( t + 1 ) } ( b ) \propto \nu ^ { ( t ) } ( b ) ^ { 1 - \eta \tau } \exp ( - \eta [ A ^ { \top } z _ { 1 } ] _ { b } ) , } & { \mathrm { f o r ~ a l l ~ } b \in \mathcal { B } , } \end{array} \right. } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $\eta$ is the learning rate. The above update rule forms the basis of our algorithm design.
|
| 104 |
+
|
| 105 |
+
Motivation: a form of implicit updates with linear convergence. It turns out, if we could select the policy pair $( z _ { 1 } , z _ { 2 } ) = \hat { \zeta } ^ { ( t + 1 ) } : \stackrel { \bullet } { = } ( \mu ^ { ( t + 1 ) } , \nu ^ { ( t + 1 ) } )$ as the ones to be taken in the future, and call the resulting update rule as the Implicit Update (IU) method:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\begin{array} { r } { \left\{ \mu ^ { ( t + 1 ) } ( a ) \propto \mu ^ { ( t ) } ( a ) ^ { 1 - \eta \tau } \exp ( \eta [ A \nu ^ { ( t + 1 ) } ] _ { a } ) , \right. \left. \mathrm { f o r ~ a l l } \ : a \in \mathcal { A } , \right. } \\ { \nu ^ { ( t + 1 ) } ( b ) \propto \nu ^ { ( t ) } ( b ) ^ { 1 - \eta \tau } \exp ( - \eta [ A ^ { \top } \mu ^ { ( t + 1 ) } ] _ { b } ) , \left. \mathrm { f o r ~ a l l } \ : b \in \mathcal { B } . \right. } \end{array}
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
Though unrealistic — since it uses the future updates — it leads to a one-step convergence to the QRE when $\eta = 1 / \tau$ (see the optimality condition in (3)). Encouragingly, we have the following linear convergence guarantee of IU when adopting a general learning rate.
|
| 112 |
+
|
| 113 |
+
Proposition 1 (Linear convergence of IU). Assume $0 < \eta \leq 1 / \tau$ , then for all $t \geq 0$ , the iterates $\zeta ^ { ( t ) } : = ( \mu ^ { ( t ) } , \nu ^ { ( t ) } )$ of the $I U$ method in (5) satisfy $\mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \parallel \zeta ^ { ( t ) } \big ) \leq ( 1 - \eta \tau ) ^ { t } \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \parallel \zeta ^ { ( 0 ) } \big )$ .
|
| 114 |
+
|
| 115 |
+
In words, the IU method achieves an appealing linear rate of convergence that is independent of the problem dimension. Motivated by this observation, we seek to design algorithms where the policies $( z _ { 1 } , z _ { 2 } )$ employed in (4) serve as good predictions of $( \mu ^ { ( t + 1 ) } , \nu ^ { ( t + \bar { 1 ) } } )$ , such that the resulting algorithms are both practical and retain the appealing convergence rate of IU.
|
| 116 |
+
|
| 117 |
+
Proposed algorithms. We propose two extragradient algorithms for solving the entropy-regularized matrix game, namely the Predictive Update $( P U )$ method and the Optimistic Multiplicative Weights
|
| 118 |
+
|
| 119 |
+
# Algorithm 1: The PU method
|
| 120 |
+
|
| 121 |
+
# Algorithm 2: The OMWU method
|
| 122 |
+
|
| 123 |
+
1 initialization: $\mu ^ { ( 0 ) }$ , $\nu ^ { ( 0 ) }$
|
| 124 |
+
|
| 125 |
+
2 for $t = 0 , 1 , 2 , \cdots$ do
|
| 126 |
+
|
| 127 |
+
2 for $t = 0 , 1 , 2 , \cdots$ do
|
| 128 |
+
|
| 129 |
+
3 Update $\bar { \mu }$ and $\bar { \nu }$ according to
|
| 130 |
+
|
| 131 |
+
3
|
| 132 |
+
|
| 133 |
+
Update $\bar { \mu }$ and $\bar { \nu }$ according to
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\begin{array} { r } { \left\{ \bar { \mu } ^ { ( t + 1 ) } ( a ) \propto { \mu } ^ { ( t ) } ( a ) ^ { 1 - \eta \tau } \exp ( \eta [ A \nu ^ { ( t ) } ] _ { a } ) , \right. \qquad } \\ { \left. \bar { \nu } ^ { ( t + 1 ) } ( b ) \propto \nu ^ { ( t ) } ( b ) ^ { 1 - \eta \tau } \exp ( - \eta [ A ^ { \top } { \mu } ^ { ( t ) } ] _ { b } ) . \right. } \end{array}
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\begin{array} { r } { \left\{ \bar { \mu } ^ { ( t + 1 ) } ( a ) \propto { \mu } ^ { ( t ) } ( a ) ^ { 1 - \eta \tau } \exp ( \eta [ A \bar { \nu } ^ { ( t ) } ] _ { a } ) , \right. \mathrm { ~ } } \\ { \left. \bar { \nu } ^ { ( t + 1 ) } ( b ) \propto \nu ^ { ( t ) } ( b ) ^ { 1 - \eta \tau } \exp ( - \eta [ A ^ { \top } \bar { \mu } ^ { ( t ) } ] _ { b } ) . \right. } \end{array}
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
4 Update $\mu$ and $\nu$ according to
|
| 144 |
+
|
| 145 |
+
Update $\mu$ and $\nu$ according to
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\begin{array} { r } { \left\{ \begin{array} { l l } { \mu ^ { ( t + 1 ) } ( a ) \propto \mu ^ { ( t ) } ( a ) ^ { 1 - \eta \tau } \exp ( \eta [ A \bar { \nu } ^ { ( t + 1 ) } ] _ { a } ) , } \\ { \nu ^ { ( t + 1 ) } ( b ) \propto \nu ^ { ( t ) } ( b ) ^ { 1 - \eta \tau } \exp ( - \eta [ A ^ { \top } \bar { \mu } ^ { ( t + 1 ) } ] _ { b } ) . } \end{array} \right. } \end{array}
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
\begin{array} { r } { \left\{ \begin{array} { l l } { \mu ^ { ( t + 1 ) } ( a ) \propto \mu ^ { ( t ) } ( a ) ^ { 1 - \eta \tau } \exp ( \eta [ A \bar { \nu } ^ { ( t + 1 ) } ] _ { a } ) , } \\ { \nu ^ { ( t + 1 ) } ( b ) \propto \nu ^ { ( t ) } ( b ) ^ { 1 - \eta \tau } \exp ( - \eta [ A ^ { \top } \bar { \mu } ^ { ( t + 1 ) } ] _ { b } ) . } \end{array} \right. } \end{array}
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
Update (OMWU) method, the latter adapted from Rakhlin and Sridharan (2013); Daskalakis et al. (2011). Detailed procedures can be found in Algorithm 1 and Algorithm 2, respectively. On a high level, both algorithms maintain two intertwined sequences $\{ ( \mu ^ { ( \bar { t } ) } , \nu ^ { ( t ) } ) \} _ { t \geq 0 }$ and $\{ ( \bar { \mu } ^ { ( \dot { t } ) } , \bar { \nu } ^ { ( t ) } ) \} _ { t \geq 0 }$ , and in each iteration $t = 0 , 1 , \ldots$ , proceed in two steps:
|
| 156 |
+
|
| 157 |
+
• The midpoint $( \bar { \mu } ^ { ( t + 1 ) } , \bar { \nu } ^ { ( t + 1 ) } )$ serves as a prediction of $( \mu ^ { ( t + 1 ) } , \nu ^ { ( t + 1 ) } )$ by running one step of mirror descent / ascent (cf. (4)) from either $( z _ { 1 } , z _ { 2 } ) = ( \mu ^ { ( t ) } , \nu ^ { ( t ) } )$ (for PU) or $( z _ { 1 } , z _ { 2 } ) = ( \bar { \mu } ^ { ( t ) } , \bar { \nu } ^ { ( t ) } )$ (for OMWU).
|
| 158 |
+
|
| 159 |
+
• The update of $( \boldsymbol { \mu } ^ { ( t + 1 ) } , \boldsymbol { \nu } ^ { ( t + 1 ) } )$ then mimics the implicit update (5) using the prediction $( \bar { \mu } ^ { ( t + 1 ) } , \bar { \nu } ^ { ( t + 1 ) } )$ obtained above.
|
| 160 |
+
|
| 161 |
+
When the proposed algorithms converge, both $( \mu ^ { ( t ) } , \nu ^ { ( t ) } )$ and $( \bar { \mu } ^ { ( t ) } , \bar { \nu } ^ { ( t ) } )$ converge to the same point. The two players are completely symmetric and adopt the same learning rate, and require only first-order information provided by the sampling oracle. While the two algorithms resemble each other in many aspects, a key difference lies in the query and use of the sampling oracle: in each iteration, OMWU makes a single call to the sampling oracle for gradient evaluation, while PU calls the sampling oracle twice. It is worth noting that, when $\tau = 0$ (i.e., no entropy regularization is enforced), the OMWU method in Algorithm 2 reduces to the method analyzed in Rakhlin and Sridharan (2013); Daskalakis and Panageas (2018a); Wei et al. (2021b) without entropy regularization.
|
| 162 |
+
|
| 163 |
+
Remark 1. It is worth highlighting that the proposed algorithms are different from Mertikopoulos et al. (2018a), as the extragradient is only applied to the bilinear term but not the entropy regularization term. This seemingly small, but important, difference leads to a more concise closed-form update rule and a cleaner analysis, as shall be seen momentarily.
|
| 164 |
+
|
| 165 |
+
# 2.3 Performance guarantees
|
| 166 |
+
|
| 167 |
+
We are now positioned to present our main theorem concerning the last-iterate convergence of PU and OMWU for solving (2).
|
| 168 |
+
|
| 169 |
+
Theorem 1 (Last-iterate convergence of PU and OMWU). Suppose that the learning rates $\eta = \eta _ { \mathsf { P U } }$ of $P U$ in Algorithm $I$ and $\eta = \eta$ OMWU of OMWU in Algorithm 2 satisfy
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
0 < \eta _ { \mathsf { P U } } \leq \frac { 1 } { \tau + 2 \left\| A \right\| _ { \infty } } , a n d 0 < \eta _ { \mathsf { O M W U } } \leq \operatorname* { m i n } \left\{ \frac { 1 } { 2 \tau + 2 \left\| A \right\| _ { \infty } } , \frac { 1 } { 4 \left\| A \right\| _ { \infty } } \right\} .
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
Then for any $t \geq 0$ , the iterates $\zeta ^ { ( t ) } = ( \mu ^ { ( t ) } , \nu ^ { ( t ) } )$ and $\bar { \zeta } ^ { ( t ) } = ( \bar { \mu } ^ { ( t ) } , \bar { \nu } ^ { ( t ) } )$ of $P U$ and OMWU achieve
|
| 176 |
+
|
| 177 |
+
# • Linear convergence of policies in KL divergence and entrywise log-ratios:
|
| 178 |
+
|
| 179 |
+
$$
|
| 180 |
+
\begin{array} { r l } & { \operatorname* { m a x } \left\{ \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \| \zeta ^ { ( t ) } \big ) , \frac { 1 } { 2 } \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \| \bar { \zeta } ^ { ( t + 1 ) } \big ) \right\} \leq ( 1 - \eta \tau ) ^ { t } \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \| \zeta ^ { ( 0 ) } \big ) , } \\ & { \left\| \log \frac { \zeta ^ { ( t ) } } { \zeta _ { \tau } ^ { \star } } \right\| _ { \infty } \leq 2 ( 1 - \eta \tau ) ^ { t } \left\| \log \frac { \zeta ^ { ( 0 ) } } { \zeta _ { \tau } ^ { \star } } \right\| _ { \infty } + \frac { 8 \| A \| _ { \infty } } { \tau } ( 1 - \eta \tau ) ^ { t / 2 } \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \| \zeta ^ { ( 0 ) } \big ) ^ { 1 / 2 } . } \end{array}
|
| 181 |
+
$$
|
| 182 |
+
|
| 183 |
+
# • Linear convergence of values in optimality and duality gaps:
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
\begin{array} { r l } & { \mathsf { O p t G a p } _ { \tau } ( \bar { \zeta } ^ { ( t ) } ) \leq \eta ^ { - 1 } \cdot \frac { 1 } { 1 - ( \tau + \| A \| _ { \infty } ) \eta } \cdot \frac { ( 1 - \eta \tau ) ^ { t } } { 1 - ( 1 - \eta \tau ) ^ { t } } \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \| \zeta ^ { ( 0 ) } \big ) , } \\ & { \mathsf { D u a l G a p } _ { \tau } ( \bar { \zeta } ^ { ( t ) } ) \leq \left( \eta ^ { - 1 } + 2 \tau ^ { - 1 } \| A \| _ { \infty } ^ { 2 } \right) ( 1 - \eta \tau ) ^ { t - 1 } \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \| \zeta ^ { ( 0 ) } \big ) . } \end{array}
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
Remark 2. Setting $\mu ^ { ( 0 ) }$ and $\nu ^ { ( 0 ) }$ to be uniform policies leads to a universal bound
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\begin{array} { r } { \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \| \zeta ^ { ( 0 ) } \big ) = \log | \mathcal { A } | + \log | \mathcal { B } | - \mathcal { H } ( \mu _ { \tau } ^ { \star } ) - \mathcal { H } ( \nu _ { \tau } ^ { \star } ) \leq \log | \mathcal { A } | + \log | \mathcal { B } | . } \end{array}
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
Remark 3. Similar results continue to hold even when the two players use different regularization parameters $\tau _ { \mu } , \tau _ { \nu } > 0$ in (2), as long as the regularization parameter $\tau$ is replaced by max $\{ \tau _ { \mu } , \tau _ { \nu } \}$ in the upper bounds of the learning rate, and the contraction parameter is replaced by $1 - \operatorname* { m i n } \{ \tau _ { \mu } , \tau _ { \nu } \} \eta$ .
|
| 196 |
+
|
| 197 |
+
Theorem 1 characterizes the convergence of the last-iterates $\zeta ^ { ( t ) }$ and $\bar { \zeta } ^ { ( t ) }$ of PU and OMWU as long as the learning rate lies within the specified ranges. While PU doubles the number of calls to the sampling oracle, it also allows roughly as large as twice the learning rate compared with OMWU (cf. (6)). Compared with the vast literature analyzing the average-iterate performance of variants of extragradient methods, our results contribute towards characterizing the last-iterate convergence of multiplicative update methods in the presence of entropy regularization and simplex constraints, which to the best of our knowledge, are the first of its kind. Several remarks are in order.
|
| 198 |
+
|
| 199 |
+
Linear convergence to QRE. To achieve an $\epsilon$ -accurate estimate of the QRE in terms of the KL divergence, the bound (7a) tells that it is sufficient to take
|
| 200 |
+
|
| 201 |
+
$$
|
| 202 |
+
\frac { 1 } { \eta \tau } \log \left( \frac { \log | \cal { A } | + \log | \cal { B } | } { \epsilon } \right)
|
| 203 |
+
$$
|
| 204 |
+
|
| 205 |
+
iterations using either PU or OMWU. Notably, this iteration complexity does not depend on any hidden constants and only depends double logarithmically on the cardinality of action spaces, which is almost dimension-free. Maximizing the learning rate, the iteration complexity is bounded by $( 1 + \| A \| _ { \infty } / \tau ) \log ( 1 / \epsilon )$ (modulo log factors), which only depends on the ratio $\| A \| _ { \infty } / \tau$ .
|
| 206 |
+
|
| 207 |
+
Entrywise error of the policy log-ratios. Both PU and OMWU enjoy strong entrywise guarantees in the sense we can guarantee the convergence of the $\ell _ { \infty }$ norm of the log-ratios between the learned policy pair and the QRE at the same dimension-free linear rate (cf. (7b)), which suggests the policy pair converges in a somewhat uniform manner across the entire action space.
|
| 208 |
+
|
| 209 |
+
Linear convergence of optimality and duality gaps. Our theorem also establishes the last-iterate convergence of the game values in terms of the optimality gap (cf. (7c)) and the duality gap (cf. (7d)) for both PU and OMWU. In particular, as will be seen, bounding the optimality gap of matrix games turns out to be the key enabler for generalizing our algorithms to Markov games, and bounding the duality gap allows to directly translate our results to finding a NE of unregularized matrix games.
|
| 210 |
+
|
| 211 |
+
Last-iterate convergence to approximate NE. The entropy-regularized matrix game can be thought as a smooth surrogate of the unregularized matrix game (1); in particular, it is possible to find an $\epsilon$ -NE by setting $\tau$ sufficiently small in (2). According to (Zhang et al., 2020, Definition 2.1), a policy pair $\bar { \zeta } = ( \mu , \bar { \nu } )$ is an $\epsilon$ -NE if it satisfies $\begin{array} { r } { \mathsf { D u a l G a p } ( \zeta ) : = \operatorname* { m a x } _ { \mu ^ { \prime } \in \Delta ( A ) } f ( \mu ^ { \prime } , \nu ) - \operatorname* { m i n } _ { \nu ^ { \prime } \in \Delta ( B ) } f ( \mu , \nu ^ { \prime } ) \leq \epsilon } \end{array}$ .
|
| 212 |
+
|
| 213 |
+
Observe that setting $\begin{array} { r } { \tau = \frac { \epsilon / 4 } { \log | \mathcal { A } | + \log | \mathcal { B } | } } \end{array}$ guarantees that $| f _ { \tau } ( \mu , \nu ) - f ( \mu , \nu ) | < \epsilon / 4$ uniformly over $( \mu , \nu ) \in \Delta ( \mathcal { A } ) \times \Delta ( \mathcal { B } )$ in view of the boundedness of the Shannon entropy $\mathcal { H } ( \cdot )$ . Theorem 7 (cf. (7d)) also ensures that our proposed algorithms find an approximate QRE $\bar { \zeta } ^ { ( T ) }$ such that $\mathsf { D u a l G a p } _ { \tau } \bigl ( \bar { \zeta } ^ { ( T ) } \bigr ) \leq$ $\epsilon / 2$ after taking $\begin{array} { r } { T = \widetilde { O } \left( \frac { 1 } { \eta \epsilon } \right) } \end{array}$ iterations, which is no more than $\begin{array} { r } { \widetilde { O } \left( 1 + \frac { \| A \| _ { \infty } } { \epsilon } \right) } \end{array}$ iterations with optimized learning rates. It follows immediately that
|
| 214 |
+
|
| 215 |
+
[ $\mathtt { \mathtt { M a l G a p } } ( \bar { \zeta } ^ { ( T ) } ) \le \mathtt { D u a l G a p } _ { \tau } ( \bar { \zeta } ^ { ( T ) } ) + \operatorname* { m a x } _ { \mu ^ { \prime } , \nu ^ { \prime } } \Big | f _ { \tau } ( \mu ^ { \prime } , \bar { \nu } ^ { ( T ) } ) - f _ { \tau } \big ( \bar { \mu } ^ { ( T ) } , \nu ^ { \prime } \big ) - \big ( f ( \mu ^ { \prime } , \bar { \nu } ^ { ( T ) } ) - f ( \bar { \mu } ^ { ( T ) } , \nu ^ { \prime } ) \big ) \Big | \le \epsilon ,$ and therefore $\bar { \zeta } ^ { ( T ) }$ is an $\mathrm { \epsilon - N E }$ . Intriguingly, unlike prior work (Daskalakis and Panageas, 2018a; Wei et al., 2021b) that analyzed the last-iterate convergence of OMWU in the unregularized setting $\mathit { \Pi } _ { \mathcal { T } } = 0 \mathit { \Pi } _ { \mathcal { c } }$ ), our last-iterate convergence does not require the NE of (1) to be unique.
|
| 216 |
+
|
| 217 |
+
Rationality. Another attractive feature of the algorithms developed above is being rational (as introduced in Bowling and Veloso (2001)) in the sense that the algorithm returns the best-response policy of one player when the opponent takes any fixed stationary policy. More specially, in terms of matrix games, when player 2 sticks to a stationary policy $\nu$ , the update of player 1 reduces to $\mu ^ { ( t + 1 ) } ( a ) \bar { \propto } \mu ^ { ( t ) } ( a ) ^ { 1 - \bar { \eta tau } } \exp ( \eta [ A \nu ] _ { a } )$ . In this case, Theorem 1 can be established in exactly the same fashion by restricting attention only to the updates of $\mu ^ { ( t ) }$ .
|
| 218 |
+
|
| 219 |
+

|
| 220 |
+
Figure 1: Performance illustration of the PU and OMWU methods for solving entropy-regularized matrix games with $| \mathcal { A } | = | \mathcal { B } | = 1 0 0$ , where the entries of the payoff matrix $A$ is generated independently from the uniform distribution on $[ - 1 , 1 ]$ . The learning rates are fixed as $\eta = 0 . 1$ . The left panel plots various error metrics of convergence w.r.t. the iteration count with $\tau = 0 . 0 1$ , while the right panel plots these error metrics at 1000-th iteration with different choices of $\tau$ .
|
| 221 |
+
|
| 222 |
+
No-regret learning of OMWU. Besides convergence to equilibria, in game-theoretical settings, it is often desirable to design and implement no-regret algorithms, which are capable of providing black-box guarantees over arbitrary sequences played by the opponent (Cesa-Bianchi and Lugosi, 2006; Rakhlin and Sridharan, 2013). Fortunately, it turns out that entropy regularization not only accelerates the convergence, but also enables no-regret learning somewhat “for free”: it encourages exploration by putting a positive mass on every action, therefore guards against adversaries. By using a properly chosen learning rate schedule, the proposed OMWU (Algorithm 2) can be further established as a no-regret algorithm; the details can be found in (Cen et al., 2021).
|
| 223 |
+
|
| 224 |
+
# 3 Zero-sum Markov games with entropy regularization
|
| 225 |
+
|
| 226 |
+
Leveraging the success of PU and OMWU in solving the entropy-regularized matrix games, this section extends our current analysis to solve the zero-sum two-player Markov game with entropy regularization, which is again formulated as finding the equilibrium of a saddle-point optimization problem. We start by introducing its basic setup, which will be followed by the proposed policy extragradient method with its theoretical guarantees.
|
| 227 |
+
|
| 228 |
+
# 3.1 Background and problem formulation
|
| 229 |
+
|
| 230 |
+
We consider a discounted Markov Game (MG) which is defined as $\mathcal { M } = \{ { S , A , B , P , r , \gamma } \}$ , with discrete state space $s$ , action spaces of two players $\mathcal { A }$ and $\boldsymbol { B }$ , transition probability $P$ , reward function $r : \mathcal { S } \times \mathcal { A } \times \mathcal { B } [ 0 , 1 ]$ and discount factor $\gamma \in [ 0 , 1 )$ . A policy $\mu : { \mathcal { S } } \Delta ( { \mathcal { A } } )$ (resp. $\nu : S \to \Delta ( B ) )$ defines how player 1 (resp. player 2) reacts to a given state $s$ , where the probability of taking action $a \in { \mathcal { A } }$ (resp. $b \in B ,$ ) is $\mu ( a | s )$ (resp. $\nu ( b | s ) )$ . The transition probability kernel $P : \mathcal { S } \times \mathcal { A } \times \mathcal { B } \Delta ( \mathcal { S } )$ defines the dynamics of the Markov game, where $P ( s ^ { \prime } | s , a , b )$ specifies the probability of transiting to state $s ^ { \prime }$ from state $s$ when the players take actions $a$ and $b$ respectively.
|
| 231 |
+
|
| 232 |
+
Motivated by entropy regularization in Markov decision processes (MDP) (Geist et al., 2019), we consider an entropy-regularized variant of MG, where the value function is defined as
|
| 233 |
+
|
| 234 |
+
$$
|
| 235 |
+
V _ { \tau } ^ { \mu , \nu } ( s ) : = \mathbb { E } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \left( r ( s _ { t } , a _ { t } , b _ { t } ) - \tau \log \mu ( a _ { t } | s _ { t } ) + \tau \log \nu ( b _ { t } | s _ { t } ) \right) ~ \middle | s _ { 0 } = s \right] ,
|
| 236 |
+
$$
|
| 237 |
+
|
| 238 |
+
where the quantity $\tau \geq 0$ denotes the regularization parameter, and the expectation is evaluated over the randomness of the transition kernel as well as the policies. The regularized Q-function $Q _ { \tau } ^ { \mu , \nu }$ of a
|
| 239 |
+
|
| 240 |
+
policy pair $( \mu , \nu )$ is related to $V _ { \tau } ^ { \mu , \nu }$ as
|
| 241 |
+
|
| 242 |
+
$$
|
| 243 |
+
\begin{array} { r } { Q _ { \tau } ^ { \mu , \nu } ( s , a , b ) = r ( s , a , b ) + \gamma \mathbb { E } _ { s ^ { \prime } \sim P ( \cdot \mid s , a , b ) } \bigl [ V _ { \tau } ^ { \mu , \nu } \bigl ( s ^ { \prime } \bigr ) \bigr ] . } \end{array}
|
| 244 |
+
$$
|
| 245 |
+
|
| 246 |
+
We will call $V _ { \tau } ^ { \mu , \nu }$ and $Q _ { \tau } ^ { \mu , \nu }$ the soft value function and soft $Q$ -function, respectively. A policy pair $( \mu _ { \tau } ^ { \star } , \nu _ { \tau } ^ { \star } )$ is said to be the quantal response equilibrium (QRE) of the entropy-regularized MG, if its value attains the minimax value of the entropy-regularized MG over all states $s \in S$ , i.e.
|
| 247 |
+
|
| 248 |
+
$$
|
| 249 |
+
V _ { \tau } ^ { \star } ( s ) = \operatorname* { m a x } _ { \mu } \operatorname* { m i n } _ { \nu } V _ { \tau } ^ { \mu , \nu } ( s ) = \operatorname* { m i n } _ { \nu } \operatorname* { m a x } _ { \mu } V _ { \tau } ^ { \mu , \nu } ( s ) : = V _ { \tau } ^ { \mu _ { \tau } ^ { \star } , \nu _ { \tau } ^ { \star } } ( s ) ,
|
| 250 |
+
$$
|
| 251 |
+
|
| 252 |
+
where ${ \cal V } _ { \tau } ^ { \star }$ is called the optimal minimax soft value function, and similarly $Q _ { \tau } ^ { \star } : = Q _ { \tau } ^ { \mu _ { \tau } ^ { \star } , \nu _ { \tau } ^ { \star } }$ is called the optimal minimax soft Q-function.
|
| 253 |
+
|
| 254 |
+
Goal. Our goal is to find the QRE of the entropy-regularized MG in a decentralized manner where the players only observe its own reward without accessing the opponent’s actions. By setting the regularization parameter sufficiently small $\tau$ , this also allows us to find an approximate NE of the unregularized MG.
|
| 255 |
+
|
| 256 |
+
# 3.2 From value iteration to policy extragradient methods
|
| 257 |
+
|
| 258 |
+
Entropy-regularized value iteration. It is known that classical dynamic programming approaches such as value iteration can be extended to solve MG (Perolat et al., 2015), where each iteration amounts to solving a series of matrix games for each state. Similar to the single-agent case (Cen et al., 2020), we can extend these approaches to solve the entropy-regularized MG. Setting the stage, let us introduce the per-state $\mathbf { Q }$ -value matrix $Q ( s ) : = Q ( s , \cdot , \cdot ) \bar { \in \mathbb { R } ^ { | \mathcal { A } | \times | \mathcal { B } | } }$ for every $s \in S$ , where the element indexed by the action pair $( a , b )$ is $Q ( s , a , b )$ . Similarly, we define the per-state policies $\mu ( s ) : = \mu ( \cdot | s ) \in \Delta ( { \dot { A } } )$ and $\nu ( s ) : = \nu ( \cdot | s ) \in \Delta ( B )$ for both players.
|
| 259 |
+
|
| 260 |
+
In parallel to the original Bellman operator, we denote the soft Bellman operator $\mathcal { T } _ { \tau }$ as
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
\mathcal { T } _ { \tau } ( Q ) ( s , a , b ) : = r ( s , a , b ) + \gamma \mathbb { E } _ { s ^ { \prime } \sim P ( \cdot \vert s , a , b ) } \left[ \operatorname* { m a x } _ { \mu ( s ^ { \prime } ) \in \Delta ( A ) } \operatorname* { m i n } _ { \nu ( s ^ { \prime } ) \in \Delta ( B ) } f _ { \tau } \left( Q ( s ^ { \prime } ) ; \mu ( s ^ { \prime } ) , \nu ( s ^ { \prime } ) \right) \right] ,
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
where for each per-state Q-value matrix $Q ( s )$ , we introduce an entropy-regularized matrix game in the form of
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\displaystyle \operatorname* { m a x } _ { \mu \in \Delta ( A ) } \operatorname* { m i n } _ { \nu \in \Delta ( B ) } f _ { \tau } \big ( Q ( s ) ; \mu ( s ) , \nu ( s ) \big ) : = \mu ( s ) ^ { \top } Q ( s ) \nu ( s ) - \tau \mathcal { H } ( \mu ( s ) ) + \tau \mathcal { H } ( \nu ( s ) ) .
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
The entropy-regularized value iteration then proceeds as
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
Q ^ { ( t + 1 ) } = T _ { \tau } ( Q ^ { ( t ) } ) ,
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
where $Q ^ { ( 0 ) }$ is an initialization. By definition, the optimal minimax soft Q-function obeys ${ \cal T } _ { \tau } ( Q _ { \tau } ^ { \star } ) =$ $Q _ { \tau } ^ { \star }$ and therefore corresponds to the fix point of the soft Bellman operator. Given the above entropyregularized value iteration, the following lemma states its iterates contract linearly to the optimal minimax soft Q-function at a rate of the discount factor $\gamma$ .
|
| 279 |
+
|
| 280 |
+
Proposition 2. The entropy-regularized value iteration (10) converges at a linear rate, i.e. $\parallel Q ^ { ( t ) } -$
|
| 281 |
+
$Q _ { \tau } ^ { \star } \| _ { \infty } \leq \gamma ^ { t } \| Q ^ { ( 0 ) } - Q _ { \tau } ^ { \star } \| _ { \infty }$ .
|
| 282 |
+
|
| 283 |
+
Approximate value iteration via policy extragradient methods. Proposition 2 suggests that the optimal minimax soft Q-function of the entropy-regularized MG can be found by solving a series of entropy-regularized matrix games induced by $\bar { \{ Q ^ { ( t ) } \} } _ { t \geq 0 }$ in (10), a task that can be accomplished by adopting the fast extragradient methods developed earlier. To proceed, we first define the following sampling oracle, which makes it rigorous that the proposed algorithm does not require access to the Q-function of the entire MG, but only its own single-agent Q-function when playing against the opponent’s policy.
|
| 284 |
+
|
| 285 |
+
Definition 2 (Sampling oracle for Markov games). Given any policy pair $\mu ( s ) , \nu ( s )$ and $Q$ -value matrix $Q ( s )$ for any $s \in S$ , the sampling oracle returns
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
[ Q ( s ) \nu ( s ) ] _ { a } = \mathbb { E } _ { b \sim \nu ( s ) } \left[ Q ( s , a , b ) \right] , \qquad a n d \qquad [ Q ( s ) ^ { \top } \mu ( s ) ] _ { b } = \mathbb { E } _ { a \sim \mu ( s ) } \left[ Q ( s , a , b ) \right]
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
for any $a \in { \mathcal { A } }$ and $b \in B$ .
|
| 292 |
+
|
| 293 |
+
# Algorithm 3: Policy Extragradient Method for Entropy-regularized Markov Game
|
| 294 |
+
|
| 295 |
+
1 initialization: $Q ^ { ( 0 ) } = 0$ .
|
| 296 |
+
2 for $t = 0 , 1 , 2 , \cdots , T _ { \mathrm { m a i n } } \mathrm { { \bf d o } }$
|
| 297 |
+
3 Let $Q ^ { ( t ) }$ denote $\begin{array} { r } { Q ^ { ( t ) } ( s , a , b ) = r ( s , a , b ) + \gamma \mathbb { E } _ { s ^ { \prime } \sim P ( \cdot | s , a , b ) } V ^ { ( t ) } ( s ^ { \prime } ) . } \end{array}$ (11)
|
| 298 |
+
4 Invoke PU (Algorithm 1) or OMWU (Algorithm 2) for $T _ { \mathrm { s u b } }$ iterations to solve the following entropy-regularized matrix game for every state $s$ , where the initialization is set as uniform distributions: $\operatorname* { m a x } _ { \mu ( s ) \in \Delta ( A ) } \operatorname* { m i n } _ { \nu ( s ) \in \Delta ( B ) } f _ { \tau } \big ( Q ^ { ( t ) } ( s ) ; \mu ( s ) , \nu ( s ) \big ) .$ Return the last iterate $\bar { \mu } ^ { ( t , T _ { \mathrm { s u b } } ) } ( s ) , \bar { \nu } ^ { ( t , T _ { \mathrm { s u b } } ) } ( s )$ .
|
| 299 |
+
5 Set $V ^ { ( t + 1 ) } ( s ) = f _ { \tau } \left( Q ^ { ( t ) } ( s ) ; \bar { \mu } ^ { ( t , \bar { T } _ { \mathrm { s u b } } ) } ( s ) , \bar { \nu } ^ { ( t , \bar { T } _ { \mathrm { s u b } } ) } ( s ) \right)$ .
|
| 300 |
+
|
| 301 |
+
Encouragingly, by judiciously setting the number of iterations in both the outer loop (for updating the Q-value matrices) and the inner loop (for updating the QRE of the corresponding Q-value matrix), we are guaranteed to find the QRE of the entropy-regularized MG in a small number of iterations without solving the iteration-varying matrix games exactly, as dictated by the following theorem.
|
| 302 |
+
|
| 303 |
+
Theorem 2. Assume $| { \mathcal { A } } | \geq | { \mathcal { B } } |$ and $\tau \leq 1$ . Setting $\begin{array} { r } { \eta = \frac { 1 - \gamma } { 2 ( 1 + \tau ( \log | \mathcal { A } | + 1 - \gamma ) ) } } \end{array}$ , the total iterations (namely, the product $T _ { \mathrm { m a i n } } \cdot T _ { \mathrm { s u b , } }$ ) required for Algorithm 3 to achieve $\left\| Q ^ { ( { \vec { T } _ { \operatorname* { m i n } } } ) } - Q _ { \tau } ^ { \star } \right\| _ { \infty } \leq \epsilon$ is at most $\begin{array} { r } { O \left( \frac { ( \log | \cal { A } | + 1 / \tau ) } { ( 1 - \gamma ) ^ { 2 } } \left( \log \frac { \log | \cal { A } | } { ( 1 - \gamma ) \epsilon } \right) ^ { 2 } \right) } \end{array}$ .
|
| 304 |
+
|
| 305 |
+
Theorem 2 ensures that within $\begin{array} { r } { \widetilde O \left( \frac { 1 } { \tau ( 1 - \gamma ) ^ { 2 } } \log ^ { 2 } \left( \frac { 1 } { \epsilon } \right) \right) } \end{array}$ iterations, Algorithm 3 finds a pair of policies whose value is close to the optimal minimax soft Q-function $Q _ { \tau } ^ { \star }$ in an entrywise manner to a prescribed accuracy $\epsilon$ . Remarkably, the iteration complexity is independent of the dimensions of the state space and the action space (up to log factors).
|
| 306 |
+
|
| 307 |
+
Remark 4 (Duality gap and solving the unregularized MG). Solving the entropy-regularized MG provides a viable strategy to find an $\epsilon$ -approximate NE of the unregularized MG, where the optimality of a policy pair is typically gauged by the duality gap. Fortunately, this can be achieved similar to the case of matrix games, and we refer interested readers to Cen et al. (2021) for details.
|
| 308 |
+
|
| 309 |
+
# 4 Conclusions
|
| 310 |
+
|
| 311 |
+
This paper develops provably efficient policy extragradient methods (PU and OMWU) for entropyregularized matrix games and Markov games, whose last iterates are guaranteed to converge linearly to the quantal response equilibrium at a linear rate. Encouragingly, the rate of convergence is independent of the dimension of the problem, i.e. the sizes of the space space and the action space. In addition, the last iterates of the proposed algorithms can also be used to locate Nash equilibria for the unregularized competitive games without assuming the uniqueness of the Nash equilibria by judiciously tuning the amount of regularization. This work opens up interesting opportunities for further investigations of policy extragradient methods for solving competitive games. For example, can we develop a two-time-scale policy extragradient algorithms for Markov games where the Qfunction is updated simultaneously with the policy but potentially at a different time scale, using samples, such as in an actor-critic algorithm (Konda and Tsitsiklis, 2000)?
|
| 312 |
+
|
| 313 |
+
# Acknowledgments and Disclosure of Funding
|
| 314 |
+
|
| 315 |
+
S. Cen and Y. Chi are supported in part by the grants ONR N00014-18-1-2142 and N00014-19-1- 2404, ARO W911NF-18-1-0303, NSF CCF-1901199, CCF-2007911 and CCF-2106778. Y. Wei is supported in part by the NSF grants CCF-2007911, DMS-2147546/2015447 and CCF-2106778.
|
| 316 |
+
|
| 317 |
+
References
|
| 318 |
+
Arora, S., Hazan, E., and Kale, S. (2012). The multiplicative weights update method: a meta-algorithm and applications. Theory of Computing, 8(1):121–164.
|
| 319 |
+
Bai, Y. and Jin, C. (2020). Provable self-play algorithms for competitive reinforcement learning. In International Conference on Machine Learning, pages 551–560. PMLR.
|
| 320 |
+
Bowling, M. and Veloso, M. (2001). Rational and convergent learning in stochastic games. In Proceedings of the 17th international joint conference on Artificial intelligence-Volume 2, pages 1021–1026.
|
| 321 |
+
Cen, S., Cheng, C., Chen, Y., Wei, Y., and Chi, Y. (2020). Fast global convergence of natural policy gradient methods with entropy regularization. arXiv preprint arXiv:2007.06558.
|
| 322 |
+
Cen, S., Wei, Y., and Chi, Y. (2021). Fast policy extragradient methods for competitive games with entropy regularization. arXiv preprint arXiv:2105.15186.
|
| 323 |
+
Cesa-Bianchi, N. and Lugosi, G. (2006). Prediction, learning, and games. Cambridge university press.
|
| 324 |
+
Daskalakis, C., Deckelbaum, A., and Kim, A. (2011). Near-optimal no-regret algorithms for zero-sum games. In Proceedings of the twenty-second annual ACM-SIAM symposium on Discrete Algorithms, pages 235–254. SIAM.
|
| 325 |
+
Daskalakis, C., Foster, D. J., and Golowich, N. (2020). Independent policy gradient methods for competitive reinforcement learning. In Advances in Neural Information Processing Systems, volume 33, pages 5527–5540.
|
| 326 |
+
Daskalakis, C., Ilyas, A., Syrgkanis, V., and Zeng, H. (2018). Training GANs with optimism. In International Conference on Learning Representations (ICLR 2018).
|
| 327 |
+
Daskalakis, C. and Panageas, I. (2018a). Last-iterate convergence: Zero-sum games and constrained min-max optimization. arXiv preprint arXiv:1807.04252.
|
| 328 |
+
Daskalakis, C. and Panageas, I. (2018b). The limit points of (optimistic) gradient descent in minmax optimization. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pages 9256–9266.
|
| 329 |
+
Freund, Y. and Schapire, R. E. (1999). Adaptive game playing using multiplicative weights. Games and Economic Behavior, 29(1-2):79–103.
|
| 330 |
+
Geist, M., Scherrer, B., and Pietquin, O. (2019). A theory of regularized Markov decision processes. In International Conference on Machine Learning, pages 2160–2169.
|
| 331 |
+
Goodfellow, I. J., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. (2014). Generative adversarial networks. arXiv preprint arXiv:1406.2661.
|
| 332 |
+
Harker, P. T. and Pang, J.-S. (1990). Finite-dimensional variational inequality and nonlinear complementarity problems: a survey of theory, algorithms and applications. Mathematical programming, 48(1):161–220.
|
| 333 |
+
Hofbauer, J. and Sandholm, W. H. (2002). On the global convergence of stochastic fictitious play. Econometrica, 70(6):2265–2294.
|
| 334 |
+
Hsieh, Y.-G., Iutzeler, F., Malick, J., and Mertikopoulos, P. (2019). On the convergence of single-call stochastic extra-gradient methods. arXiv preprint arXiv:1908.08465.
|
| 335 |
+
Konda, V. R. and Tsitsiklis, J. N. (2000). Actor-critic algorithms. In Advances in neural information processing systems, pages 1008–1014. Citeseer.
|
| 336 |
+
Korpelevich, G. M. (1976). The extragradient method for finding saddle points and other problems. Matecon, 12:747–756.
|
| 337 |
+
Lan, G. (2021). Policy mirror descent for reinforcement learning: Linear convergence, new sampling complexity, and generalized problem classes. arXiv preprint arXiv:2102.00135.
|
| 338 |
+
Lei, Q., Nagarajan, S. G., Panageas, I., and Wang, X. (2021). Last iterate convergence in no-regret learning: constrained min-max optimization for convex-concave landscapes. In International Conference on Artificial Intelligence and Statistics, pages 1441–1449. PMLR.
|
| 339 |
+
Liang, T. and Stokes, J. (2019). Interaction matters: A note on non-asymptotic local convergence of generative adversarial networks. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 907–915. PMLR.
|
| 340 |
+
Littman, M. L. (1994). Markov games as a framework for multi-agent reinforcement learning. In Machine Learning Proceedings, pages 157–163. Elsevier.
|
| 341 |
+
McKelvey, R. D. and Palfrey, T. R. (1995). Quantal response equilibria for normal form games. Games and economic behavior, 10(1):6–38.
|
| 342 |
+
Mei, J., Xiao, C., Szepesvari, C., and Schuurmans, D. (2020). On the global convergence rates of softmax policy gradient methods. arXiv preprint arXiv:2005.06392.
|
| 343 |
+
Mertikopoulos, P., Lecouat, B., Zenati, H., Foo, C.-S., Chandrasekhar, V., and Piliouras, G. (2018a). Optimistic mirror descent in saddle-point problems: Going the extra (gradient) mile. In International Conference on Learning Representations.
|
| 344 |
+
Mertikopoulos, P., Papadimitriou, C., and Piliouras, G. (2018b). Cycles in adversarial regularized learning. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 2703–2717. SIAM.
|
| 345 |
+
Mertikopoulos, P. and Sandholm, W. H. (2016). Learning in games via reinforcement and regularization. Mathematics of Operations Research, 41(4):1297–1324.
|
| 346 |
+
Mokhtari, A., Ozdaglar, A., and Pattathil, S. (2020a). A unified analysis of extra-gradient and optimistic gradient methods for saddle point problems: Proximal point approach. In International Conference on Artificial Intelligence and Statistics, pages 1497–1507. PMLR.
|
| 347 |
+
Mokhtari, A., Ozdaglar, A. E., and Pattathil, S. (2020b). Convergence rate of $O ( 1 / k )$ for optimistic gradient and extragradient methods in smooth convex-concave saddle point problems. SIAM Journal on Optimization, 30(4):3230–3251.
|
| 348 |
+
Nemirovski, A. (2004). Prox-method with rate of convergence $O ( 1 / t )$ for variational inequalities with Lipschitz continuous monotone operators and smooth convex-concave saddle point problems. SIAM Journal on Optimization, 15(1):229–251.
|
| 349 |
+
Neu, G., Jonsson, A., and Gómez, V. (2017). A unified view of entropy-regularized Markov decision processes. arXiv preprint arXiv:1705.07798.
|
| 350 |
+
Perolat, J., Scherrer, B., Piot, B., and Pietquin, O. (2015). Approximate dynamic programming for two-player zero-sum Markov games. In International Conference on Machine Learning, pages 1321–1329. PMLR.
|
| 351 |
+
Rakhlin, A. and Sridharan, K. (2013). Optimization, learning, and games with predictable sequences. arXiv preprint arXiv:1311.1869.
|
| 352 |
+
Savas, Y., Ahmadi, M., Tanaka, T., and Topcu, U. (2019). Entropy-regularized stochastic games. In 2019 IEEE 58th Conference on Decision and Control (CDC), pages 5955–5962. IEEE.
|
| 353 |
+
Shapley, L. S. (1953). Stochastic games. Proceedings of the National Academy of Sciences, 39(10):1095–1100.
|
| 354 |
+
Syrgkanis, V., Agarwal, A., Luo, H., and Schapire, R. E. (2015). Fast convergence of regularized learning in games. In Proceedings of the 28th International Conference on Neural Information Processing Systems-Volume 2, pages 2989–2997.
|
| 355 |
+
Tseng, P. (1995). On linear convergence of iterative methods for the variational inequality problem. Journal of Computational and Applied Mathematics, 60(1-2):237–252.
|
| 356 |
+
Wei, C.-Y., Lee, C.-W., Zhang, M., and Luo, H. (2021a). Last-iterate convergence of decentralized optimistic gradient descent/ascent in infinite-horizon competitive Markov games. arXiv preprint arXiv:2102.04540.
|
| 357 |
+
Wei, C.-Y., Lee, C.-W., Zhang, M., and Luo, H. (2021b). Linear last-iterate convergence in constrained saddle-point optimization. In International Conference on Learning Representations (ICLR).
|
| 358 |
+
Xie, Q., Chen, Y., Wang, Z., and Yang, Z. (2020). Learning zero-sum simultaneous-move Markov games using function approximation and correlated equilibrium. In Conference on Learning Theory, pages 3674–3682. PMLR.
|
| 359 |
+
Yadav, A., Shah, S., Xu, Z., Jacobs, D., and Goldstein, T. (2017). Stabilizing adversarial nets with prediction methods. arXiv preprint arXiv:1705.07364.
|
| 360 |
+
Zhan, W., Cen, S., Huang, B., Chen, Y., Lee, J. D., and Chi, Y. (2021). Policy mirror descent for regularized reinforcement learning: A generalized framework with linear convergence. arXiv preprint arXiv:2105.11066.
|
| 361 |
+
Zhang, K., Kakade, S., Basar, T., and Yang, L. (2020). Model-based multi-agent RL in zero-sum Markov games with near-optimal sample complexity. Advances in Neural Information Processing Systems, 33.
|
| 362 |
+
Zhao, Y., Tian, Y., Lee, J. D., and Du, S. S. (2021). Provably efficient policy gradient methods for two-player zero-sum Markov games. arXiv preprint arXiv:2102.08903.
|
md/train/_WnGcwXLYOE/_WnGcwXLYOE.md
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FLEX: Unifying Evaluation for Few-Shot NLP
|
| 2 |
+
|
| 3 |
+
Jonathan Bragg∗ Arman Cohan∗ Kyle Lo Iz Beltagy
|
| 4 |
+
|
| 5 |
+
Allen Institute for AI, Seattle, WA {jbragg,armanc,kylel,beltagy}@allenai.org
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Few-shot NLP research is highly active, yet conducted in disjoint research threads with evaluation suites that lack challenging-yet-realistic testing setups and fail to employ careful experimental design. Consequently, the community does not know which techniques perform best or even if they outperform simple baselines. In response, we formulate the FLEX Principles, a set of requirements and best practices for unified, rigorous, valid, and cost-sensitive few-shot NLP evaluation. These principles include Sample Size Design, a novel approach to benchmark design that optimizes statistical accuracy and precision while keeping evaluation costs manageable. Following the principles, we release the FLEX benchmark,2 which includes four few-shot transfer settings, zero-shot evaluation, and a public leaderboard that covers diverse NLP tasks. In addition, we present UniFew,3 a prompt-based model for few-shot learning that unifies pretraining and finetuning prompt formats, eschewing complex machinery of recent prompt-based approaches in adapting downstream task formats to language model pretraining objectives. We demonstrate that despite simplicity, UniFew achieves results competitive with both popular meta-learning and prompt-based approaches.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Few-shot learning, the challenge of learning from a small number of examples, is critical for developing efficient, robust NLP techniques [71, 76]. In recent years, separate threads of few-shot NLP research have pursued goals like generalization to new classes [e.g., 5, 25], adaptation to new domains and tasks [e.g., 3, 4, 21], and direct application of pretrained language models (LMs) [e.g., 10, 24, 55, 56]. Unfortunately, despite the shared goal of advancing few-shot NLP techniques, the community does not know which techniques work best or even if they perform better than simple baselines. Evaluation suites across these research threads are disjoint, lack challenging-yet-realistic testing setups (e.g., class imbalance, variable training set sizes, etc.), and do not employ careful experimental design to ensure accurate and precise evaluation estimates and minimal computational burden. Prior work in few-shot learning outside of NLP serves as a stark warning of the consequences of improper measurement: Dhillon et al. [19] showed that techniques from several years of prior work did not make clear progress due to large overlapping accuracy distributions and, moreover, do not outperform a simple, carefully-tuned baseline.
|
| 14 |
+
|
| 15 |
+
Need for systematic benchmark design As such, a high-quality benchmark is urgently needed to enable rigorous comparison of techniques across disjoint, highly-active threads of few-shot NLP research. But what should such an evaluation suite look like? Some best practices for evaluation of few-shot methods have been introduced in the computer vision (CV) literature [19, 67] and should be applied to NLP. However, unifying few-shot NLP work introduces new challenges. For example, the benchmark needs to test all types of transfer studied in separate research threads to measure progress on new techniques that make gains in each of these important generalization settings (§2). Also, given the importance of zero-shot learning and learning from task descriptions [29, 73], the benchmark needs to include zero-shot episodes and textual labels to enable measuring progress for models that do not use conventional supervised training, including methods that leverage the latent knowledge in pretrained LMs [10, 24, 78]. Further, the benchmark must accommodate new, computationally-expensive approaches, without overly reducing the number of evaluation episodes at the expense of statistical accuracy [3, 24, 75].
|
| 16 |
+
|
| 17 |
+
Table 1: Comparison of the FLEX benchmark with closest prior work. Our benchmark consists of episodes with variable number of shots in the range [1-5] and with class imbalance. “No extra test data” refers to excluding validation data from testing tasks, to avoid unfairly advantaging models that use such data [50]. Our benchmark’s number of test episodes is selected to balance statistical accuracy and precision, which suffers in few-episode setups, and compute requirements, which is too costly in many-episode setups (§5).
|
| 18 |
+
|
| 19 |
+
<table><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>CrosSFit[75]LM-BFF[24] GPT-3[10]DS[5]SMLMT[4] FewGlue[56]FLEX(ours)</td><td></td></tr><tr><td>Class Transfer</td><td></td><td></td><td></td><td>√</td><td></td><td></td><td></td></tr><tr><td>Domain Transfer</td><td></td><td></td><td></td><td></td><td>√</td><td></td><td></td></tr><tr><td>Task Transfer</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Pretraining Transfer</td><td></td><td>√</td><td><</td><td></td><td></td><td>√</td><td>>>>></td></tr><tr><td>Shots per class</td><td>{16,32}</td><td>16</td><td>variable</td><td>{1,5}</td><td>{4,8,16,32}</td><td>{total 32}4</td><td>[1-5]</td></tr><tr><td>Variable shots</td><td></td><td>1</td><td>√</td><td></td><td></td><td></td><td></td></tr><tr><td>Unbalanced</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Textual labels</td><td></td><td>√</td><td></td><td></td><td></td><td>√</td><td></td></tr><tr><td>Zero-shot</td><td></td><td>√</td><td>√</td><td></td><td></td><td>-</td><td></td></tr><tr><td>No extra test data</td><td></td><td></td><td></td><td>√</td><td>√</td><td>mixed5</td><td>>>>>>0</td></tr><tr><td># test episodes</td><td>5</td><td>5</td><td>1</td><td>1000</td><td>10</td><td>1</td><td></td></tr><tr><td>Reporting</td><td>avg</td><td>avg,SD</td><td>ag</td><td>avg, SD</td><td>avg,SD</td><td>avg, SD</td><td>al16</td></tr><tr><td>#datasets</td><td>160</td><td>16</td><td></td><td>7</td><td>18</td><td>8</td><td>20</td></tr></table>
|
| 20 |
+
|
| 21 |
+
Need for a robust few-shot model Recent prompt-based models [10] have shown strong results in few-shot learning. These models leverage the power of (often large) pretrained language models and adapt the format of downstream tasks to the underlying pretraining objective (e.g., Masked Language Modeling). This way, given the right natural language prompt (and sometimes verbalizers [55] and additional demonstrative examples), the model can quickly fine-tune on the downstream task [24, 43, 44, 55, 56]. However, adapting task formats to the underlying (masked) language modeling objectives is not straightforward; such models have been shown to be sensitive to varying choices of the prompt/demonstrations, training settings, hyperparameters, and learning algorithms [33, 50, 78], often requiring large held out sets and/or complex methods to overcomes such challenges. Can models eschew complex prompt engineering by unifying pretraining and downstream task formats?
|
| 22 |
+
|
| 23 |
+
In this paper, we tackle these key issues by introducing FLEX—Few-shot Language Evaluation across $\mathbf { \delta } ( \mathbf { X } )$ many transfer types—and contributing the following:
|
| 24 |
+
|
| 25 |
+
• FLEX Principles (§3), a set of requirements and best practices for few-shot NLP evaluation that enables unified, rigorous, valid, and cost-sensitive measurements. – Sample Size Design: In support of valid, cost-sensitive measurement, we introduce a novel approach to few-shot sample size design (§5) that optimizes for a benchmark’s statistical accuracy and precision while keeping computational costs accessible to a broad range of researchers.
|
| 26 |
+
• FLEX benchmark (§4), an implementation of the FLEX Principles. It tests across four few-shot transfer settings,7 and includes a public leaderboard for few-shot NLP that covers 20 datasets across diverse NLP tasks (e.g., NLI, relation classification, entity typing). Table 1 summarizes key differences between FLEX and other few-shot NLP evaluation suites.
|
| 27 |
+
|
| 28 |
+
• UniFew (§6), a prompt-based model for few-shot learning in NLP. While most existing methods leverage pre-trained LMs for few-shot learning, LM pre-training tasks do not closely match natural downstream task formats, requiring complex methods (e.g., extensive prompt-engineering, use of verbalizers, episodic hyperparameter tuning, custom learning algorithms) to make these models work in few-shot setting. Instead, the key idea of our model, UniFew, is to close the gap between pre-training and fine-tuning formats by posing tasks as multiple-choice QA and using an underlying model that is pre-trained on a similar natural QA task format. This eliminates the need for complexities of adapting downstream tasks to the LM objectives, while resulting in competitive performance with both recent few-shot and meta-learning methods.
|
| 29 |
+
|
| 30 |
+
To aid similar efforts, our release of FLEX includes a toolkit for benchmark creation and few-shot NLP model development, which we used to create the FLEX benchmark and train UniFew.
|
| 31 |
+
|
| 32 |
+
# 2 Background and Related Work
|
| 33 |
+
|
| 34 |
+
We first provide background and notation for few-shot learning and evaluation, then discuss related work in NLP and outside NLP that motivated us to create the FLEX Principles and benchmark.
|
| 35 |
+
|
| 36 |
+
Few-shot background and notation Broadly, modern approaches to few-shot learning are evaluated in a three-phase procedure [68]. In the first phase, a general-purpose pretrained model is obtained. In the subsequent “meta-training” phase,8 techniques aim to adapt the model to be well-suited for few-shot generalization. Finally, a “meta-testing” phase evaluates the adapted model in new few-shot prediction settings.
|
| 37 |
+
|
| 38 |
+
Let $\mathcal { D }$ be a dataset of $( x , y )$ examples with full label set $\mathcal { V } _ { D }$ . From it, we construct three sets of episodes, corresponding to meta-training, meta-validation, and meta-testing and denoted by ${ \mathcal { E } } _ { \operatorname* { t r a i n } }$ ${ \mathcal E } _ { \mathrm { v a l } }$ , and ${ \mathcal { E } } _ { \mathrm { t e s t } }$ , respectively. Each episode in each of these sets is a few-shot problem with its own test set and other attributes. Forsampled subset of labels in ly, e and $E$ is a tuplee disjoint $( \mathcal { D } _ { \mathrm { t r a i n } } ^ { E } , \mathcal { D } _ { \mathrm { v a l } } ^ { E } , \dot { \mathcal { D } } _ { \mathrm { t e s t } } ^ { E } , \mathcal { y } _ { \mathcal { D } } ^ { E } )$ wherewith l $y _ { \mathcal { D } } ^ { E }$ is a ls in $\mathcal { V } _ { D }$ $\mathcal { D } _ { \mathrm { t r a i n | v a l | t e s t } } ^ { E }$ $\mathcal { D }$ $y _ { \mathcal { D } } ^ { E }$ . 9 For each episode, the model’s objective is to correctly predict labels for examples $\mathcal { D } _ { \mathrm { t e s t } } ^ { E }$ . To accomplish this, models make use of labeled examples in $\mathcal { D } _ { \mathrm { t r a i n } } ^ { E }$ , which is typically configured such that each label $i$ in $y _ { \mathcal { D } } ^ { E }$ has $K _ { i } ^ { E }$ provided examples; $K _ { i } ^ { E }$ is known as the shot, and the setting when a class has no examples in $\mathcal { D } _ { \mathrm { t r a i n } } ^ { E }$ (i.e., $K _ { i } ^ { E } = 0$ ) is called zero-shot.
|
| 39 |
+
|
| 40 |
+
Few-shot evaluation in NLP Research in few-shot NLP has proceeded in several parallel threads, each focused on a different type of transfer ability [76]. Each thread has separate evaluation practices, and the vast majority of few-shot NLP research has limited evaluation to a single transfer type (see Table 1). Here, we describe these types of transfer and their evaluation practices.
|
| 41 |
+
|
| 42 |
+
Following the CV literature [67, 68], one thread of few-shot NLP focuses on class transfer, the problem of generalizing from a supervised set of classes at meta-train time to a differenfrom the same dataset at meta-test time. Evaluation typically involves splitting classes $\mathcal { V } _ { D }$ of c into $\mathcal { V } _ { \mathrm { t r a i n } } ^ { \mathcal { D } }$ $y _ { \mathrm { v a l } } ^ { \mathcal { D } }$ and $\mathcal { V } _ { \mathrm { t e s t } } ^ { \mathcal { D } }$ disjoint subsets. Class transfer has been studied on many text classification tasks [5], including relation classification [25, 28, 64], intent classification [37, 64], inter alia. In contrast, domain transfer keeps the same classes between meta-training and meta-testing but changes the textual domain (e.g., generalizing from MNLI to science-focused SciTail [4, 21]). Evaluation then requires identifying pairs of datasets with the same classes $\mathcal { \ V } _ { D }$ , where one dataset’s episodes are assigned to ${ \mathcal { E } } _ { \operatorname* { t r a i n } }$ and the other’s to ${ \mathcal { E } } _ { \mathrm { t e s t } }$ . Domain transfer has also been studied on many tasks [3, 4], including dialogue intent detection & slot tagging [31], sentiment classification [77], NLI [21], and machine translation [27, 58].
|
| 43 |
+
|
| 44 |
+
Researchers have also begun to study task transfer, the problem of generalizing from a set of tasks at meta-train time to unseen tasks at meta-test time. Evaluation requires tasks (e.g., NLI) appearing in ${ \mathcal { E } } _ { \mathrm { t e s t } }$ not to appear in ${ \mathcal { E } } _ { \mathrm { t r a i n } }$ or ${ \mathcal E } _ { \mathrm { v a l } }$ . Prior work has used GLUE tasks [70] for meta-training before meta-testing on tasks such as entity typing [3, 4], while other work instead used GLUE for meta-testing [21]. Very recent work has studied task transfer over a large set of datasets [75, 80]. A limited amount of work evaluates both domain and task transfer [3, 4, 21]. An important emerging line of work (not noted by Yin [76]) is pretraining transfer, the problem of whether pretrained language models can perform well at meta-test time without any meta-training. Evaluation in this setting requires ${ \mathcal { E } } _ { \mathrm { t r a i n } }$ , $\bar { \mathcal { E } } _ { \mathrm { v a l } } = \emptyset$ . Prior work has shown that pretrained language models are capable of surprising performance on many few-shot tasks, even without fine-tuning [10]. More recent work, mainly focusing on text classification, has reported further gains with cloze-style formats [55, 56, 65], prompt engineering [24], or calibration [78]. FLEX is designed to exercise all four of these transfer types from previous work.
|
| 45 |
+
|
| 46 |
+
Few-shot evaluation outside NLP The few-shot learning literature has largely focused on image classification, with the introduction of increasingly complex meta-learning algorithms [e.g., 23, 39, 54, 61, 68]. However, more recent work has shown that simple fine-tuning baselines are in fact competitive, and attribute this delayed discovery to problematic evaluation methodology [15, 19]. FLEX adopts recommended methodology [19, 67], and we introduce an analogous baseline (UniFew) to provide a strong measurement foundation for few-shot NLP.
|
| 47 |
+
|
| 48 |
+
# 3 FLEX Principles for Few-Shot NLP Evaluation
|
| 49 |
+
|
| 50 |
+
We now enumerate key desiderata for a few-shot NLP benchmark capable of solving the urgent problems with few-shot NLP evaluation, including separate evaluations for each transfer type and failure to incorporate best measurement practices from other domains (§2).
|
| 51 |
+
|
| 52 |
+
Diversity of transfer types To make NLP models broadly useful, few-shot NLP techniques must be capable of class, domain, and task transfer. Moreover, techniques should make use of the relevant supervision provided during meta-training to increase performance compared to the pretraining transfer setting. The benchmark should measure all four transfer settings to ensure that the community develops techniques that improve on strong pretraining transfer baselines, and enable comparison across these currently separate threads of research.
|
| 53 |
+
|
| 54 |
+
Variable number of shots and classes To better simulate a variety of real-world scenarios, the benchmark should include a variety of training set sizes and numbers of classes [67]. Testing robustness to these factors is crucial; few-shot techniques are often sensitive to changes in these factors [12], yet all prior few-shot NLP evaluations we are aware of used a fixed number of training shots and classes, known in advance during meta-training.
|
| 55 |
+
|
| 56 |
+
Unbalanced training sets The benchmark should also include unbalanced training sets with different training shots per class, another realistic setting adopted by CV benchmarks [67]. Class imbalance has also been observed to degrade performance [11, 47], yet prior few-shot NLP evaluations do not include this setting either.
|
| 57 |
+
|
| 58 |
+
Textual labels While numerical label values are often used in classification tasks, descriptive textual labels are also present for many tasks. Making these textual labels available for use by few-shot techniques enables the development of techniques that can leverage the class name, like in-context learning [10], template generation [24], and meta-learning [45]. Textual labels are crucial in particular for zero-shot evaluation.
|
| 59 |
+
|
| 60 |
+
Zero-shot evaluation We believe zero-shot evaluation is integral to the goals of few-shot evaluation. Similar to the motivation for measuring pretraining transfer, zero-shot evaluation is an important use case and also provides a strong baseline for some tasks. In the absence of training examples, textual class labels or richer task descriptions [73] must be provided. Some recent few-shot NLP work [e.g., 10, 24] evaluated with zero training shots, but most [e.g., 3, 5, 75] did not.
|
| 61 |
+
|
| 62 |
+
No extra meta-testing data We believe the benchmark should not provide validation data $\langle \mathcal { D } _ { \mathrm { v a l } } ^ { E } =$ $\emptyset , \forall E \in { \mathcal { E } } _ { \mathrm { t e s t } } )$ or unlabeled data for meta-testing tasks, since few-shot learning seeks to enable high performance in environments where collecting additional data is costly.10 Variation in these dimensions in prior NLP work makes comparison of results extremely difficult because it is often under-reported and gives unfair advantage to approaches that leverage such data [50]. For example, per-episode hyperparameter tuning on extra data has been shown to greatly inflate evaluation scores [24]. A few researchers [5, 65] follow our suggested approach, but others have used many different settings, from validation sets of various sizes [10, 24, 79] to no validation set but a large set of unlabeled examples [55, 56].
|
| 63 |
+
|
| 64 |
+
Principled sample size design Promising few-shot techniques can incur significant computational cost per episode, e.g., due to fine-tuning model parameters [4], searching for prompts [24], inter alia. To alleviate these costs, related works often evaluate with a limited number of episodes, which precludes statistically accurate or precise performance estimates. We believe the benchmark’s test sample size should be optimized to enable proper performance evaluation for such techniques, while ensuring the computational burden is inclusive toward researchers without large compute resources.
|
| 65 |
+
|
| 66 |
+
Proper reporting of CIs, SDs, and individual results The benchmark should report confidence intervals (CIs) of performance estimates and follow recent guidelines [19] to report standard deviations (SDs) for understanding variability. Moreover, we newly advocate for controlling for the same sampled few-shot episodes across all methods and reporting individual episode results, so that researchers can run higher-powered paired statistical tests when comparing results [22], crucial when the benchmark has been optimized for low evaluation budgets.
|
| 67 |
+
|
| 68 |
+
# 4 FLEX Benchmark
|
| 69 |
+
|
| 70 |
+
The FLEX benchmark is a unifying, rigorous evaluation suite for few-shot learning in NLP, which implements the desiderata outlined in the previous section. In this section, we describe detailed design decisions and our accompanying few-shot NLP toolkit (§4.4), which we are releasing to facilitate easily adding NLP datasets and advanced sampling options to future benchmarks. We also describe the FLEX leaderboard (§4.5).
|
| 71 |
+
|
| 72 |
+
# 4.1 Task and Dataset Selection
|
| 73 |
+
|
| 74 |
+
Following GLUE [70] and other prior work [3, 5, 24, 78], we focus on tasks formatted as classification. Despite recent advances, NLP state-of-the-art models remain significantly worse than human performance on many text classification tasks, particularly in the few-shot setting. Automatic scoring of classification tasks is also more reliable than text generation tasks.
|
| 75 |
+
|
| 76 |
+
We selected datasets across three recent few-shot NLP evaluation suites, which separately studied class transfer [5], domain and task transfer [3, 4], and pretraining transfer [24]. Our benchmark includes a broad mix of tasks (NLI, question classification, entity typing, relation classification, and sentiment analysis) and formats (document, sentence, sentence pair). More complete dataset and license details are available in the following subsection and Appendix A.
|
| 77 |
+
|
| 78 |
+
# 4.2 Meta-Evaluation Protocols
|
| 79 |
+
|
| 80 |
+
As discussed earlier, FLEX evaluates four different types of transfer: Class, Domain, Task, and Pretraining Transfer. To support all types, we report results to the FLEX benchmark both without metatraining (pretraining-only) and with meta-training. This reporting scheme evaluates the performance of the basic pretrained model and the benefit (or lack thereof) of meta-training. A similar reporting scheme was proposed by Triantafillou et al. [67] for CV.
|
| 81 |
+
|
| 82 |
+
Pretraining-Only In this setting, the pretrained model is directly meta-tested on our benchmark without any additional training. This is the Pretraining Transfer setting, and it is the most difficult, but given the recent success of pretrained models in NLP for few-shot learning [10, 24], we believe that comparison to models without any meta-training is important for NLP tasks.
|
| 83 |
+
|
| 84 |
+
Meta-Trained In this setting, the model is meta-trained then meta-tested on our benchmark. We carefully selected and split datasets across meta-train/validation/test in order to enable testing of Class, Domain, and Task transfer with a single meta-training phase (to reduce computational burden). Datasets involved in each transfer setting (detailed split information in Table 4 in Appendix A):
|
| 85 |
+
|
| 86 |
+
• Class Transfer: FewRel [28], HuffPost [46], Amazon [30], 20News [38], and Reuters [41] take part in meta-training and meta-testing but with different classes. • Domain Transfer: MR [49], CR [32], SNLI [9], and SciTail [35] are only in the meta-testing phase, but the corresponding sentiment and NLI datasets exist in the meta-training phase (MNLI [74], QNLI [52], and SST-2 [62]).
|
| 87 |
+
|
| 88 |
+
• Task Transfer: Subj [48], TREC [69], and CoNLL [66] are also for meta-testing only, and they represent tasks that the model does not encounter during meta-training.
|
| 89 |
+
|
| 90 |
+
Instead of per-episode hyperparameter tuning, we provide meta-validation episodes ${ \mathcal E } _ { \mathrm { v a l } }$ for learning (during meta-training) global hyperparameters that work across all episodes. Specifically, the metavalidation dataset splits (see Table 4) consist of CoLa [72] for task transfer, WNLI [40] for domain transfer, and the validation splits used by Bao et al. [5] for all class transfer datasets. Following [3], we also include meta-training datasets MRPC [20], RTE [6, 8, 17, 26], and QQP [70].
|
| 91 |
+
|
| 92 |
+
# 4.3 Episode Sampling
|
| 93 |
+
|
| 94 |
+
We describe how our benchmark samples meta-testing episodes ${ \mathcal { E } } _ { \mathrm { t e s t } }$ . For meta-training, we allow users to sample from ${ \mathcal { E } } _ { \operatorname* { t r a i n } }$ , ${ \mathcal E } _ { \mathrm { v a l } }$ in any way, or directly use the underlying dataset splits.
|
| 95 |
+
|
| 96 |
+
Number of classes For Class Transfer datasets, FLEX evaluates model robustness to variable number of new classes. When constructing episode $E$ from one of these datasets $\mathcal { D }$ , our benchmark samples an episode-specific number of classes from dataset $D$ , the sampler picks a random number from the range $\mathcal { V } _ { D } ^ { E } \sim \mathrm { \bar { U n i f } } ( 5 , \operatorname* { m i n } ( | \mathcal { V } _ { D } | , 1 0 ) )$ . 11 For Domain and Task Transfer, the number of classes is fixed to the maximum number of classes in each dataset because Class Transfer is not being evaluated.
|
| 97 |
+
|
| 98 |
+
Number of shots Following prior work outside NLP [47, 67], our benchmark samples the training shot independently for each episode $E$ and class $i$ , as $K _ { i } ^ { E } \sim \mathrm { U n i f } ( K _ { \operatorname* { m i n } } , K _ { \operatorname* { m a x } } )$ , where $K _ { \operatorname* { m i n } } = 1$ Given strong performance of NLP models with few or even zero examples [10, 73] and following prior work [5], we set the limit $K _ { \operatorname* { m a x } } = 5$ . Separately, we allocate an equal number of episodes as zero-shot, where we instead set $\mathcal { D } _ { \mathrm { t r a i n } } ^ { E } = \varnothing$ (equivalently, $K _ { i } ^ { E } = 0 , \forall i )$ . In each episode, examples are sampled uniformly at random without replacement (but can be reused across episodes).12 Following Triantafillou et al. [67], we select a testing shot that is balanced across classes and leaves roughly half of examples for sampling the training examples. The total number of episodes for each reported configuration (pair of dataset and either zero- or few-shot) is set to 90 using Sample Size Design (§5).
|
| 99 |
+
|
| 100 |
+
# 4.4 Extensible Toolkit for Benchmark Creation and Model Training & Evaluation
|
| 101 |
+
|
| 102 |
+
Alongside the FLEX benchmark, we release an extensible, highly-configurable Python toolkit, which we used to generate the benchmark, and train and evaluate our models. Unlike existing meta-learning frameworks (e.g., Torchmeta [18], learn2learn [2]), our framework makes available a wide range of community-contributed NLP datasets and utilities via HuggingFace Datasets [42].13 Our code also provides advanced sampling utilities (e.g., for class imbalance), ensures reproducibility by checksumming generated episodes, and reports all recommended statistics.
|
| 103 |
+
|
| 104 |
+
# 4.5 Public Leaderboard
|
| 105 |
+
|
| 106 |
+
We provide public leaderboards for each of the meta-evaluation protocols: Pretraining-Only14 and Meta-Trained.15 Submissions take the form of a text label predictions file, which is produced by our toolkit. Results are reported with confidence intervals, standard deviations, and individual predictions on request. See Appendix G for a screenshot of the results interface.
|
| 107 |
+
|
| 108 |
+
# 5 Sample Size Design: Balancing Statistical Measurement & Compute Cost
|
| 109 |
+
|
| 110 |
+
We demonstrate a principled approach to determining the optimal sample size configuration in our few-shot benchmark. A proper benchmark should produce performance estimates that are accurate, close to the true value, and precise, low variance. A large (test) sample size can achieve this, yet must be considered alongside computational cost so that a broad community of researchers with differing amounts of compute resources can participate. This decision is further complicated in the few-shot setting, where sample size refers to both the number of test episodes $| \mathcal { E } _ { \mathrm { t e s t } } |$ and the number of test examples $| \mathcal { D } _ { \mathrm { t e s t } } ^ { E } |$ per episode $E \in \mathcal { E } _ { \mathrm { t e s t } }$ . For practicality, we consider $\overline { { | \mathcal { D } _ { \mathrm { t e s t } } | } }$ , the mean $| \mathcal { D } _ { \mathrm { t e s t } } ^ { E } |$ across all episodes, rather than every $| \mathcal { D } _ { \mathrm { t e s t } } ^ { E } |$ . It remains unknown how one should best distribute test examples between $| \mathcal { E } _ { \mathrm { t e s t } } |$ and $\overline { { | \mathcal { D } _ { \mathrm { t e s t } } | } }$ : More episodes each with fewer examples, or fewer episodes each with many examples? Prior work has been inconsistent in this regard. For example, Gao et al. [24] used $| \mathcal { E } _ { \mathrm { t e s t } } | = 5$ and large $\overline { { | \mathcal { D } _ { \mathrm { t e s t } } | } }$ , while Bao et al. [5] used $| \mathcal { E } _ { \mathrm { t e s t } } | = 1 0 0 0$ and much smaller $\overline { { | \mathcal { D } _ { \mathrm { t e s t } } | } }$ .
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 1: Results of simulation study described in $\ S 5$ . Each curve corresponds to a compute budget constraint $C$ (GPU-hours). Each point on a curve is an allocation of test data between the number of test episodes $| \mathcal { E } _ { \mathrm { t e s t } } |$ or mean number of examples per episode $\overline { { | \mathcal { D } _ { \mathrm { t e s t } } | } }$ such that evaluation can be completed within given budget. Per curve, lower values of $| \mathcal { E } _ { \mathrm { t e s t } } |$ correspond linearly to larger values of $\overline { { | \mathcal { D } _ { \mathrm { t e s t } } | } }$ , which are shown as numerical text annotations in (b). Error bars represent the $1 0 ^ { t h }$ and $9 0 ^ { t h }$ percentile values from repeated simulations across $\mu _ { a c c } \in \{ 0 . 3 , 0 . 3 5 , \ldots , 0 . 9 5 \}$ .
|
| 114 |
+
|
| 115 |
+
Inspired by simulation techniques for informing statistically-powered experimental design [13], we study how different configurations of $| \mathcal { E } _ { \mathrm { t e s t } } |$ and $\overline { { | \mathcal { D } _ { \mathrm { t e s t } } | } }$ across different compute budgets $C$ impact the accuracy and precision of our estimated CIs, specifically with respect to coverage probability [53] and width. First, we estimate per-episode and per-test-example costs of our few-shot model (§6) to obtain valid $( C , \vert \mathcal { E } _ { \mathrm { t e s t } } \vert , \vert \overline { { \mathcal { D } _ { \mathrm { t e s t } } } } \vert )$ configurations s.t. the full benchmark completes within given $C$ (GPU-hours).16 Then, for each $( C , \vert \mathcal { E } _ { \mathrm { t e s t } } \vert , \vert \overline { { \mathcal { D } _ { \mathrm { t e s t } } } } \vert )$ , we perform 1000 simulation runs, in which each run samples predictions under a true model accuracy $\mu _ { a c c }$ and computes a single $9 5 \%$ CI, its width, and whether it correctly covers $\mu _ { a c c }$ . Averaging over simulation runs gives us estimates for the coverage probability and width of our benchmark’s CI for a single $( C , \vert \mathcal { E } _ { \mathrm { t e s t } } \vert , \vert \overline { { \mathcal { D } _ { \mathrm { t e s t } } } } \vert )$ . We repeat this whole procedure for different $\mu _ { a c c } \in \{ 0 . 3 , 0 . 3 5 , \ldots , 0 . 9 5 \}$ to cover a wide range of possible model performances observed across many datasets (see Table 3).
|
| 116 |
+
|
| 117 |
+
Figure 1 shows CI coverage probability and width for many $( C , \vert \mathcal { E } _ { \mathrm { t e s t } } \vert , \overline { { \vert D _ { \mathrm { t e s t } } \vert } } )$ configurations. First, we find in Figure 1a that sufficiently-many test episodes (i.e., $\vert \mathcal { E } _ { \mathrm { t e s t } } \vert > 6 0 )$ is needed to guarantee coverage probability of our CIs is within one percentage point of the target $9 5 \%$ , a trend that holds regardless of compute budget. Small $| \mathcal { E } _ { \mathrm { t e s t } } |$ also corresponds to large CI widths across all considered budgets in Figure 1b. This suggests that the choices of $| \mathcal { E } _ { \mathrm { t e s t } } | = 1 , 5 , 1 0$ in prior work [4, 24, 56, 75] can mean inaccurate and wide CIs, while choices of $| \mathcal { E } _ { \mathrm { t e s t } } | = 1 0 0 0$ [5] can be prohibitively costly for methods with high training cost.
|
| 118 |
+
|
| 119 |
+
Next, Figure 1b reveals (i) diminishing returns in $\mathrm { C I }$ width (decrease in $y$ -axis) as compute increases, and (ii) existence of an optimal balance between $| \mathcal { E } _ { \mathrm { t e s t } } |$ and $\overline { { | \mathcal { D } _ { \mathrm { t e s t } } | } }$ for each budget. Restricting our consideration to budgets with optima satisfying sufficient coverage probability $\lvert \mathcal { E } _ { \mathrm { t e s t } } \rvert > 6 0 )$ , the minimum viable budget is 36 GPU-hours. Then, assessing the marginal benefit of each 12 GPU-hour budget increase in terms of marginal reduction in CI width between optima, we arrive at our FLEX configuration of $| \mathcal { E } _ { \mathrm { t e s t } } | = 9 0$ and $\overline { { | \mathscr { D } _ { \mathrm { t e s t } } | } } \approx 4 7 0$ under a budget of $C = 4 8$ GPU-hours.17 Further details are in Appendix B.
|
| 120 |
+
|
| 121 |
+
# 6 UniFew: A Few-Shot Learning Model by Unifying Pre-training and Downstream Task Formats
|
| 122 |
+
|
| 123 |
+
Despite their encouraging results, existing works on few-shot learning in NLP are based on either customized and often complex meta-learning algorithms [3, 4, 5, 60], heavy manual/automated engineering of textual descriptions or prompts [24, 55, 59, 78], ordering of training examples [44, 56], extensive hyperparameter tuning on held-out sets [24, 44, 55], or custom learning algorithms [55, 65]. We present UniFew, a strong few-shot learning model across all transfer settings and datasets tested, that eschews the need for incorporating the above-mentioned complexities and challenges.
|
| 124 |
+
|
| 125 |
+
UniFew is a prompt-based model [56], a class of models that tailor the input/output format of their data to match the format used during pretraining. While this technique allows them to perform a task without the need for additional classification layers, prompt-based models are typically sensitive to the choice of the prompts, which can require extensive search, trial-and-error, and even additional models to get right [24, 78]. To avoid this issue while still leveraging the strong capabilities of pretrained models, UniFew (1) converts examples into multiple-choice question-answer (QA) format, and (2) uses UnifiedQA [34], a T5 [51] model further pretrained on a large collection of QA pairs.18,19
|
| 126 |
+
|
| 127 |
+
Compared to other prompt-based models, UniFew has two main strengths. First, the prompt design problem is much simpler because UnifiedQA questions had well-defined formats. For example, we only need four general prompt templates which cover all 20 datasets in the FLEX benchmark, while prior works have needed specialized prompts for each dataset. Second, UnifiedQA’s multiple-choice format ensures the model outputs a valid class label, without the need for learned or manually-defined mappings or verbalizers required for other prompt-based methods [24, 55].20 In concurrent work, Zhong et al. [80] also show the benefit of performing meta-tuning on a variety of datasets; while their task setup as Q/A is similar to UniFew, they focus exclusively on binary zero-shot classification tasks and, unlike UniFew, do not handle multi-class or few-shot problems.
|
| 128 |
+
|
| 129 |
+
We experiment with UniFew both without and with meta-training on the FLEX benchmark’s metatraining data, following the FLEX protocol (§4.2). We call the meta-trained variant $\mathrm { U n i F e w } _ { \mathrm { m e t a } }$ . We use simple prompts in the format of question followed by choices followed by the answer (according to the UnifiedQA original format). The exact prompts used are provided in Appendix C.
|
| 130 |
+
|
| 131 |
+
Training details For meta-training and meta-validation of UniFew, we sampled ${ \mathcal { E } } _ { \operatorname* { t r a i n } }$ and ${ \mathcal E } _ { \mathrm { v a l } }$ with 5-class, 5-training-shot sampling with the same number of shots per class.21 We trained the model for total number of 30K steps, using a linear learning rate scheduler with peak rate of $3 e { - 5 }$ , 200 warmup steps, and batch size of 4; we selected the best checkpoint based on ${ \mathcal E } _ { \mathrm { v a l } }$ performance. At meta-test time, for each episode, we trained the model on the episode’s training examples (if they exist) and predicted the outputs on test examples. For training at meta-test time, we used constant learning rate of $3 e { \mathrm { - } } 5$ and batch size of 4, and trained the model for 400 steps.22 We used NVidia RTX8000 GPUs, which take about 7 GPU-hours for meta-training and 48 GPU-hours for meta-testing. For meta-testing we split the episodes among 8 GPUs to speed up evaluations.
|
| 132 |
+
|
| 133 |
+
# 7 Experiments
|
| 134 |
+
|
| 135 |
+
Comparing UniFew with prior work To demonstrate the efficacy of UniFew, we evaluate it against state-of-the-art approaches for few-shot and meta-learning in NLP: LM-BFF [24], a language
|
| 136 |
+
|
| 137 |
+
(a) H-SMLMT (Bansal et al. [4])
|
| 138 |
+
|
| 139 |
+
Table 2: Comparing UniFew with prior methods on their respective test suites, reporting mean accuracy (and standard deviation). For each test suite, for each result set on same number of shots, we indicate with $\vartriangleright$ when results are directly comparable: (i) either both use meta-training (H-SMLMT & DS with $\mathrm { U n i F e w } _ { \mathrm { m e t a } } )$ or neither do (LM-BFF with UniFew). We bold the better of the two.
|
| 140 |
+
(b) LM-BFF (Gao et al. [24])
|
| 141 |
+
|
| 142 |
+
<table><tr><td>Model</td><td></td><td>Shots</td><td>CR</td><td>MR</td><td>SNLI</td><td>Subj</td><td>TREC</td></tr><tr><td>□</td><td>LM-BFFman 23</td><td>024</td><td>79.5</td><td>80.8</td><td>49.5</td><td>51.4</td><td>32.0</td></tr><tr><td>□</td><td>UniFew</td><td>0</td><td>78.8</td><td>74.8</td><td>54.4</td><td>50.3</td><td>15.0</td></tr><tr><td></td><td>UniFeWmeta.</td><td>0.</td><td>92.1</td><td>90.5.</td><td>83.8</td><td>56.8</td><td>39.1</td></tr><tr><td>□</td><td>LM-BFF</td><td>16/1625</td><td>91.0 ±0.9</td><td>87.7 ±1.4</td><td>77.5 ±3.5</td><td>91.4 ±1.8</td><td>89.4 ±1.7</td></tr><tr><td>□</td><td>UniFew</td><td>16/16</td><td>92.2 ±0.8</td><td>87.2 ±0.1</td><td>75.6 ±1.5</td><td>84.6 ±5.4</td><td>86.7 ±0.3</td></tr><tr><td></td><td>UniFeWmeta</td><td>16/16</td><td>92.7 ±0.4</td><td>90.2 ±0.8</td><td>84.9 ±0.5</td><td>87.6 ±2.0</td><td>86.1 ±0.4</td></tr><tr><td colspan="8">(c) Distributional Signature (Bao et al. [5])</td></tr><tr><td>Model □ DS</td><td></td><td>Shots 1</td><td>Amznt 62.7</td><td>FRelt 67.1</td><td>HuffP+ 43.1</td><td>20N+ 52.2</td><td>Reut+ 81.8</td></tr><tr><td></td><td>UniFew</td><td>1</td><td>±0.7 82.1</td><td>±0.9 75.7</td><td>±0.2 65.9</td><td>±0.7 58.4</td><td>±1.6 92.0</td></tr><tr><td>□</td><td>UniFeWmeta</td><td>1</td><td>±8.5 84.3</td><td>±13.2 90.6</td><td>±13.4 78.6</td><td>±11.6 70.3</td><td>±8.3 96.9</td></tr><tr><td></td><td></td><td></td><td>±8.9</td><td>±6.2</td><td>±6.9</td><td>±9.1</td><td>±2.5</td></tr><tr><td colspan="8"></td></tr><tr><td>□</td><td>DS</td><td>5</td><td>81.2 ±0.3</td><td>83.5 ±0.3</td><td>63.5 ±0.1</td><td>68.3 ±0.2</td><td>96.0 ±0.3</td></tr><tr><td></td><td>UniFew</td><td>5</td><td>88.5 ±7.4</td><td>88.8 ±6.5</td><td>77.1 ±6.0</td><td>72.2 ±8.4</td><td>97.0 ±2.8</td></tr><tr><td>□</td><td>UniFeWmeta</td><td>5</td><td>90.5 ±5.9</td><td>93.1 ±4.4</td><td>81.7 ±5.2</td><td>76.2 ±7.1</td><td>98.0 ±2.0</td></tr></table>
|
| 143 |
+
|
| 144 |
+
<table><tr><td>Model</td><td>Shots</td><td>CNLL</td><td>SciT</td></tr><tr><td>H-SMLMT</td><td>4</td><td>57.6 ±7.1</td><td>76.8 ±3.4</td></tr><tr><td>UniFew</td><td>4</td><td>76.6 ±2.6</td><td>65.1 ±9.9</td></tr><tr><td>UniFeWmeta</td><td>4</td><td>79.7 ±2.8</td><td>85.4 ±2.5</td></tr><tr><td> H-SMLMT</td><td>8</td><td>70.2 ±3.0</td><td>79.1 ±1.1</td></tr><tr><td>UniFew</td><td>8</td><td>80.6 ±3.7</td><td>70.9 ±5.2</td></tr><tr><td>V UniFeWmeta</td><td>8</td><td>81.2 ±3.8</td><td>86.8 ±1.4</td></tr><tr><td>> H-SMLMT</td><td>16</td><td>80.6 ±2.8</td><td>80.4 ±1.4</td></tr><tr><td>UniFew</td><td>16</td><td>85.8 ±1.9</td><td>76.7 ±4.6</td></tr><tr><td>V UniFeWmeta</td><td>16</td><td>87.9 ±1.9</td><td>85.4 ±2.5</td></tr></table>
|
| 145 |
+
|
| 146 |
+
model prompt-based fine-tuning method, as well as Distributional Signatures (DS) [5] and H-SMLMT [4], two state-of-the-art meta-learning techniques. Refer to Appendix D for details on these methods.
|
| 147 |
+
|
| 148 |
+
We compare to these methods using the datasets in the FLEX benchmark to establish the quality of our model. Since we constructed our benchmark from disjoint subsets of datasets evaluated in each of these prior works (§4.1), we compare each method with its corresponding subset of datasets. Each of these prior works evaluates their methods using different experimental setups (classes, number of episodes, shots) than our benchmark and was not designed to handle FLEX’s challenging episode characteristics like class imbalance. To enable fair comparison, we test UniFew on the exact data splits released by the authors when available (H-SMLMT and LM-BFF). For DS, we sample (balanced) episodes using our framework after matching their test settings (number of shots and classes, class splits, etc.) and reproduce their reported results to within $1 \%$ absolute difference using their model code; we use these episodes for our experiments. The results in Table 2 show that UniFewmeta outperforms both H-SMLMT and DS meta-learning approaches by relatively large margins, while achieving competitive results compared with LM-BFF. Note that UniFew’s strong results are without meta-learning approaches, extensive prompt-engineering, or per-episode hyperparameter search.
|
| 149 |
+
|
| 150 |
+
Evaluating UniFew on the FLEX benchmark Having established UniFew as a strong model comparable to recent, state-of-the art techniques, we present its results on the final version of our benchmark (with class imbalance, etc.). From Table 3, we observe three findings. First, pretraining is an effective technique for infusing an NLP model with the ability to perform few-shot generalization even without any meta-training, as UniFew is able to score $\Delta _ { \mathrm { f e w } } = + 1 2 . 8$ higher when provided few rather than zero examples. Second, by comparing UniFew $\mathrm { \ m e t a }$ and UniFew, we see that metatraining has a substantial impact on zero-shot performance $\Delta _ { \mathrm { m e t a } } = + 1 4 . 5 )$ , but its benefit, while still substantial, is less in the few-shot setting $\Delta _ { \mathrm { m e t a } } = + 8 . 6 )$ . Third, while meta-training adds roughly the same benefit to zero and few-shot performance for both domain and task transfer settings, meta-training disproportionately benefits zero-shot class transfer $\langle \Delta _ { \mathrm { m e t a } } = + 1 6 . 2 \rangle$ over few-shot class transfer $\Delta _ { \mathrm { { m e t a } } } = + 4 . 3 )$ . Such observations are made possible through unified evaluation and comparison across different transfer types. The full FLEX benchmark results broken down by individual datasets are in Appendix E.
|
| 151 |
+
|
| 152 |
+
Table 3: Mean accuracy of UniFew and UniFew $\mathrm { \ m e t a }$ on FLEX benchmark in zero and few-shot setups.
|
| 153 |
+
|
| 154 |
+
<table><tr><td></td><td colspan="3">Zero-shot</td><td></td><td colspan="3">Few-shot</td><td></td><td></td></tr><tr><td></td><td>Class</td><td>Domain</td><td>Task</td><td>Overall</td><td>Class</td><td>Domain</td><td>Task</td><td>Overall</td><td>△few (Overall)</td></tr><tr><td>UniFew</td><td>59.5</td><td>67.9</td><td>36.6</td><td>56.5</td><td>75.8</td><td>72.4</td><td>54.3</td><td>69.3</td><td>+12.8</td></tr><tr><td>UniFeWmeta</td><td>75.6</td><td>87.6</td><td>41.1</td><td>71.0</td><td>80.2</td><td>86.8</td><td>62.4</td><td>77.9</td><td>+6.9</td></tr><tr><td>△meta</td><td>+16.2</td><td>+19.7</td><td>+4.5</td><td>+14.5</td><td>+4.3</td><td>+14.4</td><td>+8.1</td><td>+8.6</td><td></td></tr></table>
|
| 155 |
+
|
| 156 |
+
# 8 Limitations and Future Work
|
| 157 |
+
|
| 158 |
+
While the initial FLEX benchmark is focused on classification tasks, we aim to use our benchmark creation toolkit (§4.4) to incorporate additional task formats like span selection or text generation. Furthermore, the benchmark currently only supports English language tasks; to study language transfer, we aim to incorporate new datasets using our toolkit. Adding diverse datasets has its own challenges; while we’ve selected datasets for our benchmark based on prior work adoption and have attempted to verify their licensing for research use, we were unable to find license details for some datasets (Appendix A). We believe it is crucial to continually evolve the suite of datasets to remain challenging for the best models [36] and to tackle real-world challenges [1].
|
| 159 |
+
|
| 160 |
+
In addition, Sample Size Design (§5) simulations currently rely on our own available training estimates. We plan to gather a more representative sample from community leaderboard submissions.
|
| 161 |
+
|
| 162 |
+
Our public leaderboard could benefit from extended support for detailed comparisons between submissions based on properties of techniques. For example, approaches may vary in terms of model characteristics (e.g., number of parameters), data and supervision used during pretraining, amount of compute, etc. We encourage reporting all these factors to enable the community to analyze and make progress on important sub-spaces in the overall few-shot technique design space.
|
| 163 |
+
|
| 164 |
+
Finally, we believe the benefits of improving few-shot NLP techniques outweigh potential risks, but we acknowledge potential harms associated with language models [7, 14, 57, 63]. Few-shot models learn a task from a few examples but rely heavily on knowledge encoded in the pretrained model. Thus, few-shot models are more likely to inherit the biases of the pretrained models, compared to more fully supervised models; as the community focuses more on few-shot learning, it is more important than ever for future pretrained models to be careful about biases in the underlying pretraining corpora.
|
| 165 |
+
|
| 166 |
+
# 9 Conclusion
|
| 167 |
+
|
| 168 |
+
In this work, we unify and bring rigor to few-shot NLP evaluation. We formulate the FLEX Principles, a set of requirements and best practices that enables unified, rigorous, valid, and cost-sensitive measurement. We advance the principles with new Sample Size Design methodology for optimizing statistical accuracy and precision while keeping costs low. The FLEX benchmark is our instantiation of the FLEX Principles; it employs Sample Size Design and includes four few-shot transfer settings, zero-shot evaluation, and a public leaderboard with diverse NLP tasks. We present UniFew, a promptbased model that aligns pretraining and downstream task formats, achieving results competitive with recent few-shot methods despite using trivial prompt engineering. Finally, we release an extensible, open-source toolkit (used to train UniFew and generate the FLEX benchmark) to support future benchmark creation and few-shot NLP model training.
|
| 169 |
+
|
| 170 |
+
# Acknowledgments and Disclosure of Funding
|
| 171 |
+
|
| 172 |
+
We would like to thank Chandra Bhagavatula, Matt Gardner, Matt Peters, Doug Downey, Dan Weld, and the four anonymous reviewers for helpful comments, suggestions and feedback. We would also like to acknowledge the large community effort involved in the creation of the datasets and open-source tools we utilize.
|
| 173 |
+
|
| 174 |
+
# References
|
| 175 |
+
|
| 176 |
+
[1] Neel Alex, Eli Lifland, Lewis Tunstall, Abhishek Thakur, Pegah Maham, C. Jess Riedel, Emmie Hine, Carolyn Ashurst, Paul Sedille, Alexis Carlier, Michael Noetel, and Andreas Stuhlmüller. 2021. RAFT: A real-world few-shot text classification benchmark. CoRR, abs/2109.14076.
|
| 177 |
+
[2] Sébastien M R Arnold, Praateek Mahajan, Debajyoti Datta, Ian Bunner, and Konstantinos Saitas Zarkias. 2020. learn2learn: A library for Meta-Learning research.
|
| 178 |
+
[3] Trapit Bansal, Rishikesh Jha, and Andrew McCallum. 2020. Learning to Few-Shot Learn Across Diverse Natural Language Classification Tasks. In COLING.
|
| 179 |
+
[4] Trapit Bansal, Rishikesh Jha, Tsendsuren Munkhdalai, and Andrew McCallum. 2020. SelfSupervised Meta-Learning for Few-Shot Natural Language Classification Tasks. In EMNLP.
|
| 180 |
+
[5] Yujia Bao, Menghua Wu, Shiyu Chang, and Regina Barzilay. 2020. Few-shot Text Classification with Distributional Signatures. In ICLR.
|
| 181 |
+
[6] Roy Bar-Haim, Ido Dagan, Bill Dolan, L. Ferro, Danilo Giampiccolo, and B. Magnini. 2006. The second PASCAL recognising textual entailment challenge.
|
| 182 |
+
[7] Emily M. Bender, Timnit Gebru, Angelina McMillan-Major, and Shmargaret Shmitchell. 2021. On the dangers of stochastic parrots: Can language models be too big? FAccT.
|
| 183 |
+
[8] Luisa Bentivogli, Peter Clark, Ido Dagan, and Danilo Giampiccolo. 2009. The fifth PASCAL recognizing textual entailment challenge. In TAC.
|
| 184 |
+
[9] Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. 2015. A large annotated corpus for learning natural language inference. In EMNLP.
|
| 185 |
+
[10] Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language models are few-shot learners. In NeurIPS.
|
| 186 |
+
[11] Mateusz Buda, Atsuto Maki, and Maciej A. Mazurowski. 2018. A systematic study of the class imbalance problem in convolutional neural networks. Neural Networks, 106:249–259.
|
| 187 |
+
[12] Tianshi Cao, Marc T. Law, and Sanja Fidler. 2020. A Theoretical Analysis of the Number of Shots in Few-Shot Learning. In ICLR.
|
| 188 |
+
[13] Dallas Card, Peter Henderson, Urvashi Khandelwal, Robin Jia, Kyle Mahowald, and Dan Jurafsky. 2020. With little power comes great responsibility. In EMNLP.
|
| 189 |
+
[14] Nicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski, Ariel Herbert-Voss, Katherine Lee, Adam Roberts, Tom B. Brown, Dawn Song, Úlfar Erlingsson, Alina Oprea, and Colin Raffel. 2020. Extracting training data from large language models. CoRR, abs/2012.07805.
|
| 190 |
+
[15] Wei-Yu Chen, Yen-Cheng Liu, Zsolt Kira, Yu-Chiang Frank Wang, and Jia-Bin Huang. 2019. A closer look at few-shot classification. In ICLR.
|
| 191 |
+
[16] Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins, and Kristina Toutanova. 2019. BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questions. In NAACL.
|
| 192 |
+
[17] Ido Dagan, Oren Glickman, and Bernardo Magnini. 2005. The PASCAL recognising textual entailment challenge. In International Conference on Machine Learning Challenges.
|
| 193 |
+
[18] Tristan Deleu, Tobias Würfl, Mandana Samiei, Joseph Paul Cohen, and Yoshua Bengio. 2019. Torchmeta: A Meta-Learning library for PyTorch. Available at: https://github.com/tristandeleu/pytorch-meta.
|
| 194 |
+
[19] Guneet S. Dhillon, Pratik Chaudhari, Avinash Ravichandran, and Stefano Soatto. 2020. A Baseline for Few-Shot Image Classification. In ICLR.
|
| 195 |
+
[20] William B. Dolan and Chris Brockett. 2005. Automatically Constructing a Corpus of Sentential Paraphrases. In Proceedings of the Third International Workshop on Paraphrasing (IWP2005).
|
| 196 |
+
[21] Zi-Yi Dou, Keyi Yu, and Antonios Anastasopoulos. 2019. Investigating Meta-Learning Algorithms for Low-Resource Natural Language Understanding Tasks. In EMNLP.
|
| 197 |
+
[22] Rotem Dror, Gili Baumer, Segev Shlomov, and Roi Reichart. 2018. The Hitchhiker’s Guide to Testing Statistical Significance in Natural Language Processing. In ACL.
|
| 198 |
+
[23] Chelsea Finn, Pieter Abbeel, and Sergey Levine. 2017. Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks. In ICML.
|
| 199 |
+
[24] Tianyu Gao, Adam Fisch, and Danqi Chen. 2021. Making pre-trained language models better few-shot learners. In ACL.
|
| 200 |
+
[25] Tianyu Gao, Xu Han, Zhiyuan Liu, and Maosong Sun. 2019. Hybrid Attention-Based Prototypical Networks for Noisy Few-Shot Relation Classification. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 6407–6414.
|
| 201 |
+
[26] Danilo Giampiccolo, Bernardo Magnini, Ido Dagan, and Bill Dolan. 2007. The Third PASCAL Recognizing Textual Entailment Challenge. In Proceedings of the ACL-PASCAL Workshop on Textual Entailment and Paraphrasing, pages 1–9, Prague. Association for Computational Linguistics.
|
| 202 |
+
[27] Jiatao Gu, Yong Wang, Yun Chen, Victor O. K. Li, and Kyunghyun Cho. 2018. Meta-Learning for Low-Resource Neural Machine Translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3622–3631, Brussels, Belgium. Association for Computational Linguistics.
|
| 203 |
+
[28] Xu Han, Hao Zhu, Pengfei Yu, Ziyun Wang, Yuan Yao, Zhiyuan Liu, and Maosong Sun. 2018. FewRel: A Large-Scale Supervised Few-Shot Relation Classification Dataset with State-of-the-Art Evaluation. In EMNLP.
|
| 204 |
+
[29] Peter Hase and Mohit Bansal. 2021. When can models learn from explanations? A formal framework for understanding the roles of explanation data. CoRR, abs/2102.02201.
|
| 205 |
+
[30] Ruining He and Julian McAuley. 2016. Ups and Downs: Modeling the Visual Evolution of Fashion Trends with One-Class Collaborative Filtering. In WWW, pages 507–517.
|
| 206 |
+
[31] Yutai Hou, Jiafeng Mao, Yongkui Lai, Cheng Chen, Wanxiang Che, Zhigang Chen, and Ting Liu. 2020. FewJoint: A few-shot learning benchmark for joint language understanding. CoRR, abs/2009.08138.
|
| 207 |
+
[32] Minqing Hu and Bing Liu. 2004. Mining and summarizing customer reviews. In KDD.
|
| 208 |
+
[33] Robert L. Logan IV, Ivana Balazevic, Eric Wallace, Fabio Petroni, Sameer Singh, and Sebastian Riedel. 2021. Cutting down on prompts and parameters: Simple few-shot learning with language models. CoRR, abs/2106.13353.
|
| 209 |
+
[34] Daniel Khashabi, Sewon Min, Tushar Khot, Ashish Sabharwal, Oyvind Tafjord, P. Clark, and Hannaneh Hajishirzi. 2020. UnifiedQA: Crossing Format Boundaries With a Single QA System. In EMNLP.
|
| 210 |
+
[35] Tushar Khot, Ashish Sabharwal, and Peter Clark. 2018. SciTaiL: A Textual Entailment Dataset from Science Question Answering. In AAAI.
|
| 211 |
+
[36] Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Wei hua Hu, Michihiro Yasunaga, Richard L. Phillips, Sara Beery, Jure Leskovec, Anshul Kundaje, Emma Pierson, Sergey Levine, Chelsea Finn, and Percy Liang. 2021. Wilds: A benchmark of in-the-wild distribution shifts. In ICML.
|
| 212 |
+
[37] Jason Krone, Yi Zhang, and Mona Diab. 2020. Learning to classify intents and slot labels given a handful of examples. In Workshop on Natural Language Processing for Conversational AI.
|
| 213 |
+
[38] Ken Lang. 1995. NewsWeeder: Learning to Filter Netnews. In ICML.
|
| 214 |
+
[39] Kwonjoon Lee, Subhransu Maji, Avinash Ravichandran, and Stefano Soatto. 2019. Metalearning with differentiable convex optimization. In CVPR.
|
| 215 |
+
[40] Hector Levesque, Ernest Davis, and Leora Morgenstern. 2011. The Winograd schema challenge. AAAI Spring Symposium: Logical Formalizations of Commonsense Reasoning, 46:47.
|
| 216 |
+
[41] David D. Lewis. 1997. Reuters-21578 text categorization test collection, distribution 1.0.
|
| 217 |
+
[42] Quentin Lhoest, Patrick von Platen, Thomas Wolf, Albert Villanova del Moral, Yacine Jernite, Abhishek Thakur, Suraj Patil, Lewis Tunstall, Mariama Drame, Julien Chaumond, Julien Plu, Joe Davison, Simon Brandeis, Victor Sanh, Teven Le Scao, Kevin Canwen Xu, Nicolas Patry, Angelina McMillan-Major, Philipp Schmid, Sylvain Gugger, Clément Delangue, Théo Matussière, Lysandre Debut, Stas Bekman, and François Lagunas. 2021. huggingface/datasets: 1.9.0.
|
| 218 |
+
[43] Xiaodong Liu, Pengcheng He, Weizhu Chen, and Jianfeng Gao. 2019. Multi-Task Deep Neural Networks for Natural Language Understanding. In ACL.
|
| 219 |
+
[44] Yao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel, and Pontus Stenetorp. 2021. Fantastically ordered prompts and where to find them: Overcoming few-shot prompt order sensitivity. CoRR, abs/2104.08786.
|
| 220 |
+
[45] Qiaoyang Luo, Lingqiao Liu, Yuhao Lin, and Wei Zhang. 2021. Don’t miss the labels: Labelsemantic augmented meta-learner for few-shot text classification. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021.
|
| 221 |
+
[46] Rishabh Misra. 2018. News category dataset.
|
| 222 |
+
[47] Mateusz Ochal, Massimiliano Patacchiola, Amos Storkey, Jose Vazquez, and Sen Wang. 2021. Few-Shot Learning with Class Imbalance.
|
| 223 |
+
[48] Bo Pang and Lillian Lee. 2004. A Sentimental Education: Sentiment Analysis Using Subjectivity Summarization Based on Minimum Cuts. In ACL.
|
| 224 |
+
[49] Bo Pang and Lillian Lee. 2005. Seeing Stars: Exploiting Class Relationships for Sentiment Categorization with Respect to Rating Scales. In ACL.
|
| 225 |
+
[50] Ethan Perez, Douwe Kiela, and Kyunghyun Cho. 2021. True few-shot learning with language models. CoRR, abs/2105.11447.
|
| 226 |
+
[51] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, W. Li, and Peter J. Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21:140:1–140:67.
|
| 227 |
+
[52] Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: $^ { 1 0 0 , 0 0 0 + }$ Questions for Machine Comprehension of Text. In EMNLP.
|
| 228 |
+
[53] D. B. Rubin and N. Schenker. 1986. Efficiently simulating the coverage properties of interval estimates. Journal of the Royal Statistical Society: Series $C$ (Applied Statistics), 35(2):159–167.
|
| 229 |
+
[54] Andrei A. Rusu, Dushyant Rao, Jakub Sygnowski, Oriol Vinyals, Razvan Pascanu, Simon Osindero, and Raia Hadsell. 2019. Meta-learning with latent embedding optimization. In ICLR.
|
| 230 |
+
[55] Timo Schick and Hinrich Schütze. 2021. Exploiting cloze-questions for few-shot text classification and natural language inference. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, EACL.
|
| 231 |
+
[56] Timo Schick and Hinrich Schütze. 2021. It’s not just size that matters: Small language models are also few-shot learners. In NAACL.
|
| 232 |
+
[57] Roy Schwartz, Jesse Dodge, Noah A. Smith, and Oren Etzioni. 2020. Green AI. Communications of the ACM, 63:54 – 63.
|
| 233 |
+
[58] Amr Sharaf, Hany Hassan, and Hal Daumé III. 2020. Meta-Learning for Few-Shot NMT Adaptation. In Proceedings of the Fourth Workshop on Neural Generation and Translation, pages 43–53, Online. Association for Computational Linguistics.
|
| 234 |
+
[59] Taylor Shin, Yasaman Razeghi, Robert L. Logan IV, Eric Wallace, and Sameer Singh. 2020. AutoPrompt: Eliciting knowledge from language models with automatically generated prompts. In EMNLP.
|
| 235 |
+
[60] Xujie Si, Yuan Yang, Hanjun Dai, Mayur Naik, and Le Song. 2019. Learning a meta-solver for syntax-guided program synthesis. In ICLR.
|
| 236 |
+
[61] Jake Snell, Kevin Swersky, and Richard Zemel. 2017. Prototypical networks for few-shot learning. In NeurIPS.
|
| 237 |
+
[62] Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew $\mathrm { N g }$ , and Christopher Potts. 2013. Recursive Deep Models for Semantic Compositionality Over a Sentiment Treebank. In EMNLP.
|
| 238 |
+
[63] Irene Solaiman, Miles Brundage, Jack Clark, Amanda Askell, Ariel Herbert-Voss, Jeff Wu, Alec Radford, and Jasmine Wang. 2019. Release strategies and the social impacts of language models. CoRR, abs/1908.09203.
|
| 239 |
+
[64] Shengli Sun, Qingfeng Sun, Kevin Zhou, and Tengchao Lv. 2019. Hierarchical Attention Prototypical Networks for Few-Shot Text Classification. In EMNLP.
|
| 240 |
+
[65] Derek Tam, Rakesh R. Menon, Mohit Bansal, Shashank Srivastava, and Colin Raffel. 2021. Improving and simplifying pattern exploiting training. CoRR, abs/2103.11955.
|
| 241 |
+
[66] Erik F. Tjong Kim Sang and Fien De Meulder. 2003. Introduction to the CoNLL-2003 Shared Task: Language-Independent Named Entity Recognition. In Proceedings of the Seventh Conference on Natural Language Learning at HLT-NAACL 2003, pages 142–147.
|
| 242 |
+
[67] Eleni Triantafillou, Tyler Zhu, Vincent Dumoulin, Pascal Lamblin, Utku Evci, Kelvin Xu, Ross Goroshin, Carles Gelada, Kevin Swersky, Pierre-Antoine Manzagol, and Hugo Larochelle. 2020. Meta-Dataset: A Dataset of Datasets for Learning to Learn from Few Examples. In ICLR.
|
| 243 |
+
[68] Oriol Vinyals, Charles Blundell, Tim Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. 2016. Matching networks for one shot learning. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016.
|
| 244 |
+
[69] Ellen M. Voorhees and Dawn M. Tice. 2000. Building a question answering test collection. In SIGIR.
|
| 245 |
+
[70] Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2018. GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding. In ICLR.
|
| 246 |
+
[71] Yaqing Wang, Quanming Yao, James T. Kwok, and Lionel M. Ni. 2020. Generalizing from a Few Examples: A Survey on Few-shot Learning. ACM Computing Surveys, 53(3):63:1–63:34.
|
| 247 |
+
[72] Alex Warstadt, Amanpreet Singh, and Samuel R. Bowman. 2019. Neural Network Acceptability Judgments. TACL, 7:625–641.
|
| 248 |
+
[73] Orion Weller, Nicholas Lourie, Matt Gardner, and Matthew Peters. 2020. Learning from Task Descriptions. In EMNLP.
|
| 249 |
+
[74] Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A Broad-Coverage Challenge Corpus for Sentence Understanding through Inference. In NAACL.
|
| 250 |
+
[75] Qinyuan Ye, Bill Yuchen Lin, and Xiang Ren. 2021. CrossFit: A few-shot learning challenge for cross-task generalization in NLP. CoRR, abs/2104.08835.
|
| 251 |
+
[76] Wenpeng Yin. 2020. Meta-learning for few-shot natural language processing: A survey. CoRR, abs/2007.09604.
|
| 252 |
+
[77] Mo Yu, Xiaoxiao Guo, Jinfeng Yi, Shiyu Chang, Saloni Potdar, Yu Cheng, Gerald Tesauro, Haoyu Wang, and Bowen Zhou. 2018. Diverse Few-Shot Text Classification with Multiple Metrics. In NAACL.
|
| 253 |
+
[78] Tony Z. Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. 2021. Calibrate before use: Improving few-shot performance of language models. CoRR, abs/2102.09690.
|
| 254 |
+
[79] Yanan Zheng, Jing Zhou, Yujie Qian, Ming Ding, Jian Li, Ruslan Salakhutdinov, Jie Tang, Sebastian Ruder, and Zhilin Yang. 2021. FewNLU: Benchmarking state-of-the-art methods for few-shot natural language understanding. CoRR, abs/2109.12742.
|
| 255 |
+
[80] Ruiqi Zhong, Kristy Lee, Zheng Zhang, and Dan Klein. 2021. Adapting language models for zero-shot learning by meta-tuning on dataset and prompt collections. CoRR, abs/2104.04670.
|
md/train/c5QbJ1zob73/c5QbJ1zob73.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/gjBz22V93a/gjBz22V93a.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Fast Multi-Resolution Transformer Fine-tuning for Extreme Multi-label Text Classification
|
| 2 |
+
|
| 3 |
+
Jiong Zhang
|
| 4 |
+
Amazon
|
| 5 |
+
jiongz@amazon.com
|
| 6 |
+
|
| 7 |
+
Wei-cheng Chang Amazon chanweic@amazon.com
|
| 8 |
+
|
| 9 |
+
Hsiang-fu Yu
|
| 10 |
+
Amazon
|
| 11 |
+
rofu.yu@gmail.com
|
| 12 |
+
|
| 13 |
+
Inderjit S. Dhillon UT Austin & Amazon inderjit@cs.utexas.edu
|
| 14 |
+
|
| 15 |
+
# Abstract
|
| 16 |
+
|
| 17 |
+
Extreme multi-label text classification (XMC) seeks to find relevant labels from an extreme large label collection for a given text input. Many real-world applications can be formulated as XMC problems, such as recommendation systems, document tagging and semantic search. Recently, transformer based XMC methods, such as XTransformer and LightXML, have shown significant improvement over other XMC methods. Despite leveraging pre-trained transformer models for text representation, the fine-tuning procedure of transformer models on large label space still has lengthy computational time even with powerful GPUs. In this paper, we propose a novel recursive approach, XR-Transformer to accelerate the procedure through recursively fine-tuning transformer models on a series of multi-resolution objectives related to the original XMC objective function. Empirical results show that XRTransformer takes significantly less training time compared to other transformerbased XMC models while yielding better state-of-the-art results. In particular, on the public Amazon-3M dataset with 3 million labels, XR-Transformer is not only 20x faster than X-Transformer but also improves the Precision $@ 1$ from $5 1 \%$ to $5 4 \%$ . Our code is publicly available at https://github.com/amzn/pecos.
|
| 18 |
+
|
| 19 |
+
# 1 Introduction
|
| 20 |
+
|
| 21 |
+
Many real-world applications such as open-domain question answering [1, 2], e-commerce dynamic search advertising [3, 4], and semantic matching [5], can be formulated as an extreme multi-label text classification (XMC) problem: given a text input, predict relevant labels from an enormous label collection of size $L$ . In these applications, $L$ ranges from tens of thousands to millions, which makes it very challenging to design XMC models that are both accurate and efficient to train. Recent works such as Parabel [3], Bonsai [6], XR-Linear [7] and AttentionXML [8], exploit the correlations among the labels to generate label partitions or hierarchical label trees (HLTs) which can be used to shortlist candidate labels to be considered during training and inference. While these methods are scalable in terms of the size of the label collection, most of them rely only on statistical representations (such as bag-of-words) or pooling from pre-generated token embeddings (such as word2vec) to vectorize text inputs.
|
| 22 |
+
|
| 23 |
+
In light of the recent success of deep pretrained transformers models such as BERT [9], XLNet [10] and RoBerta [11] in various NLP applications, X-Transformer [12] and LightXML [13] propose to fine-tune pre-trained transformer models on XMC tasks to obtain new state-of-the-art results over the aforementioned approaches. Although transformers are able to better capture semantic meaning of textual inputs than statistical representations, text truncation is often needed in practice to reduce GPU memory footprint and maintain model efficiency. For example, X-Transformer truncates input texts to contain the first 128 tokens before feeding it into transformer models. Efficiency of transformer fine-tuning poses another challenge for XMC applications. Directly fine-tuning transformer models on the original XMC task with a very large label collection is infeasible as both the training time and the memory consumption are linear in $L$ . In order to alleviate this, both $\mathbf { X }$ -Transformer and LightXML adopt a similar approach to group $L$ labels into $K$ clusters of roughly equal size denoted by $B$ and fine-tune transformers on the task to identify relevant label clusters (instead of labels themselves). If $B \approx { \sqrt { L } }$ and $K \approx { \sqrt { L } }$ , then both the training time and the memory requirement of the fine-tuning can be reduced to $O ( \sqrt { L } )$ from $O ( L )$ . However, as pointed out in [8], the model performance would deteriorate due to the information loss from label aggregation. Thus, both XTransformer and LightXML still choose a small constant $B$ $( \leq 1 0 0 )$ as the size of the label clusters. As a result, transformers are still fine-tuned on a task with around $L / 1 0 0$ clusters, which leads to a much longer training time compared with non-transformer based models. For example, it takes X-Transformer 23 and 25 days respectively to train on Amazon-3M and Wiki- $5 0 0 \mathsf { K }$ even with 8 Nvidia V100 GPUs.
|
| 24 |
+
|
| 25 |
+
To address these issues, we propose XR-Transformer, an XMC architecture that leverages pre-trained transformer models and has much smaller training cost compared to other transformer-based XMC methods. Motivated by the multi-resolution learning in image generation [14–16] and curriculum learning [17], we formulate the XMC problem as a series of sub-problems with multi-resolution label signals and recursively fine-tune the pre-trained transformer on the coarse-to-fine objectives. In this paper, our contributions are as follows:
|
| 26 |
+
|
| 27 |
+
• We propose XR-Transformer, a transformer based framework for extreme multi-label text classification where the pre-trained transformer is recursively fine-tuned on a series of easyto-hard training objectives defined by a hierarchical label tree. This allows the transformers to be quickly fine-tuned for a XMC problem with a very large number label collection progressively. To get better text representation and mitigate the information loss in text truncation for transformers, we take into account statistical text features in addition to the transformer text embeddings in our model. Also, a cost sensitive learning scheme by label aggregation is proposed to introduce richer information on the coarsified labels.
|
| 28 |
+
We conduct experiments on 6 public XMC benchmarking datasets and our model takes significantly lower training time compared to other transformer-based XMC models to yield better state-of-the-art results. For example, we improve the state-of-the-art Prec $@ 1$ result on Amazon-3M established by X-Transformer from $5 1 . 2 0 \%$ to $5 4 . 0 4 \%$ while reducing the required training time from 23 days to 29 hours using the same hardware.
|
| 29 |
+
|
| 30 |
+
# 2 Related Works
|
| 31 |
+
|
| 32 |
+
Sparse Linear Models with Partitioning Techniques. Conventional XMC methods consider fixed input representations such as sparse TF-IDF features and study different partitioning techniques or surrogate loss functions on the large output spaces to reduce complexity. For example, sparse linear one-versus-all (OVA) methods such as DiSMEC [18], PPD-Sparse [19, 20], ProXML [21] explore parallelism to solve OVA losses and reduce the model size by weight truncations.
|
| 33 |
+
|
| 34 |
+
The inference time complexity of OVA models is linear in the output space, which can be greatly improved by partitioning methods or approximate nearest neighbor (ANN) indexing on the label spaces. Initial works on tree-based methods [22, 23] reduce the OVA problem to one-versus-some (OVS) with logarithmic depth trees. Down that path, recent works on sparse linear models including Parabel [3], eXtremeText [24], Bonsai [6], XReg [25], NAPKINXC [26, 27] and XR-Linear [7] partition labels with $B$ -array hierarchical label trees (HLT), leading to inference time complexity that is logarithmic in the output space. On the other hand, low-dimensional embedding-based models often leverage ANN methods to speed up the inference procedure. For example, AnnexML [28] and SLICE [29] consider graph-based methods such as HNSW [30] while GLaS [31] considers product quantization variants such as ScaNN [32].
|
| 35 |
+
|
| 36 |
+
Shallow Embedding-based Methods. Neural-based XMC models employ various network architectures to learn semantic embeddings of the input text. XML-CNN [33] applies one-dimensional CNN on the input sequence and use the BCE loss without sampling, which is not scalable to XMC problems. AttentionXML [8] employs BiLSTMs and label-aware attention as scoring functions. For better scalability to large output spaces, only a small number of positive and hard negative labels are used in model GPU training. Shallow embedding-based methods [34–38] use word embedding lookup followed by shallow MLP layers to obtain input embeddings. For instance, MACH [34] learns MLP layers on several smaller XMC sub-problems induced by hashing tricks on the large label space. Similarly, DeepXML [35] and its variant (i.e., DECAF [36], GalaXC [37], ECLARE [38]) pre-train MLP encoders on XMC sub-problems induced by label clusters. They freeze the pre-trained word embedding and learn another MLP layer followed by a linear ranker with sampled hard negative labels from HNSW [30]. Importantly, shallow embedding-based methods only show competitive performance on short-text XMC problems where the number of input tokens is small [34, 35].
|
| 37 |
+
|
| 38 |
+
Deep Transformer Models. Recently, pre-trained Transformer models [9–11] have been applied to XMC problems with promising results [12, 13, 39]. X-Transformer [12] considers a two-stage approach where the first stage transformer-based encoders are learned on XMC sub-problems induced by balanced label clusters, and the second stage sparse TF-IDF is combined with the learned neural embeddings as the input to linear OVA models. APLC-XLNet [39] fine-tunes XLNet encoder on adaptive imbalanced label clusters based on label frequency similar to Adaptive Softmax [40]. LightXML [13] fine-tunes Transformer encoders with the OVA loss function end-to-end via dynamic negative sampling from the matching network trained on label cluster signals. Nonetheless, Transformer-based XMC models have larger model size and require longer training time, which hinders its practical usage on different downstream XMC problems.
|
| 39 |
+
|
| 40 |
+
# 3 Background Material
|
| 41 |
+
|
| 42 |
+
We assume we are given a training set $\{ \mathbf { x } _ { i } , \mathbf { y } _ { i } \} _ { i = 1 } ^ { N }$ where $\mathbf { x } _ { i } \in \mathcal { D }$ is the ith input document and $\mathbf { y } _ { i } \in \{ 0 , 1 \} ^ { L }$ is the one hot label vector with $y _ { i , \ell } = 1$ indicating that label $\ell$ is relevant to instance $i$ The goal of eXtreme Multi-label Text Classification (XMC) is to learn a function $f : \mathcal { D } \times \left[ L \right] \mapsto \mathbb { R }$ , such that $f ( \mathbf { x } , \boldsymbol { \ell } )$ denotes the relevance between the input $\mathbf { x }$ and the label $\ell$ . In practice, labels with the largest $k$ values are retrieved as the predicted relevant labels for a given input $\mathbf { x }$ . The most straightforward model is one-versus-all (OVA) model:
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
f ( \mathbf { x } , \boldsymbol { \ell } ) = \mathbf { w } _ { \boldsymbol { \ell } } ^ { \top } \boldsymbol { \Phi } ( \mathbf { x } ) ; \boldsymbol { \ell } \in [ L ] ,
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
where $\mathbf { W } = [ \mathbf { w } _ { 1 } , \hdots , \mathbf { w } _ { L } ] \in \mathbb { R } ^ { d \times L }$ are the weight vectors and $\Phi : \mathcal { D } \mapsto \mathbb { R } ^ { d }$ is the text vectorizer that maps $\mathbf { x }$ to $d$ -dimensional feature vector. $\Phi ( \cdot )$ could be a deterministic text vectorizer, such as the bag-of-words (BOW) model or Term Frequency-Inverse Document Frequency (TFIDF) model, or a vectorizer with learnable parameters. With the recent development in deep learning, using pre-trained transformer as the text vectorizer has shown promising results in many XMC applications [12, 13, 39]. When $L$ is large, however, training and inference of OVA model without sampling would be prohibitive due to the $O ( L )$ time complexity.
|
| 49 |
+
|
| 50 |
+
To handle the extremely large output space, recent approaches partition the label space to shortlist the labels considered during training and inference. In particular, [7, 12, 13, 34, 35, 39] follow a three stage framework: partitioning, shortlisting, and ranking. First, label features are constructed to group labels into $K$ clusters $\mathbf { C } \in \overline { { \{ 0 , 1 \} } } ^ { L \times K }$ where $C _ { \ell , k } = 1$ denotes that label $\ell$ is included in the $k$ -th cluster. Then a shortlisting model is learned to match input $\mathbf { x }$ to relevant clusters in an OVA setting:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
g ( \mathbf { x } , k ) = \hat { \mathbf { w } } _ { k } ^ { \top } \Phi _ { g } ( \mathbf { x } ) ; k \in [ K ] .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
Finally, a classification model with output size $L$ is trained on the shortlisted labels:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
f ( \mathbf { x } , \boldsymbol { \ell } ) = \mathbf { w } _ { \boldsymbol { \ell } } ^ { \top } \boldsymbol { \Phi } ( \mathbf { x } ) ; \boldsymbol { \ell } \in S _ { g } ( \mathbf { x } ) ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $S _ { g } ( \mathbf { x } ) \subset [ L ]$ is the label set shortlisted by $g ( \mathbf { x } , \cdot )$ . In the extreme case where only one label cluster is determined to be relevant to a input $\mathbf { x }$ , the training and inference cost on √ √ $\mathbf { x }$ would be $\begin{array} { r } { O ( K + \frac { L } { K } ) } \end{array}$ , which in the best case scenario is $O ( \sqrt { L } )$ when $\bar { K } = \sqrt { L }$ .
|
| 63 |
+
|
| 64 |
+
For transformer based methods, the dominant time is the evaluation of $\Phi ( \mathbf { x } )$ . But $K$ being too big or too small could still be problematic. Empirical results show that the model performance deteriorates when clusters are too big [8]. This is because that the signals coming from $B$ labels within the same cluster will be aggregated and not distinguishable, where $B$ is the cluster size. Therefore, $B$ cannot be too big to ensure a reasonable label resolution for fine-tuning. Also, as pointed out in [12], fine-tuning transformer models on large output spaces can be prohibitive. As a result, the label clusters need to be constructed in a way to balance the model performance and fine-tuning efficiency. In practice, both the transformer-based XMC models, such as X-Transformer and LightXML, adopt a small fixed constant as the cluster size $B$ $3 ( \leq 1 0 0 )$ , which means that training the shortlisting model $g ( \mathbf { x } , k )$ is still very time consuming as the number of clusters $K \approx L / B$ .
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 1: Illustration of fine-tuning on XMC tasks of different label resolutions. For an XMC task with a low label resolution, fine-tuning can be fast but model performance might deteriorate due to large deviation from the original XMC task. In practice, X-Transformer and LightXML adopt a XMC task with a relatively higher label resolution to ensure reasonable model performance at the cost of longer training time. The proposed XR-Transformer leverages multi-resolution learning and model bootstrapping that achieves both fast fine-tuning and good model performance.
|
| 68 |
+
|
| 69 |
+
# 4 Proposed Method: XR-Transformer
|
| 70 |
+
|
| 71 |
+
As noted above, the shortlisting problem (2) is itself an XMC problem with slightly smaller output size $\frac { L } { B }$ where $B$ is the cluster size. In XR-Transformer, we apply the same three stage framework recursively on the shortlisting problem until a reasonably small output size is reached $\frac { L } { B _ { - } ^ { D } }$ We can therefore follow the curriculum learning scheme and fine-tune the pre-trained transformers progressively on the sub-XMC problems with increasing output space $\Big \{ \frac { \dot { \bf \Phi } _ { L } } { B ^ { D } } , \frac { L } { B ^ { D - 1 } } , \ldots \Big \}$ . At each fine-tuning task, the candidate label set is shortlisted by the final model at the previous task. The recursive shortlisting ensures that for any input, the number of candidate labels to include in training and inference is $O ( B )$ and therefore the total number of considered labels is $O ( B \log _ { B } ( L ) )$ . Also, we leverage the multi-step fine-tuning and use the embedding generated at the previous task to bootstrap the non pre-trained part for the current task. We now describe the model design in detail.
|
| 72 |
+
|
| 73 |
+
Hierarchical Label Tree (HLT). Recursively generating label clusters $D$ times is equivalent to building a HLT [41] of depth $D$ . We first construct label features $\mathbf { Z } \in \mathbb { R } ^ { L \times \hat { d } }$ . This could be done by applying text vectorizers on label text or from Positive Instance Feature Aggregation (PIFA):
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\mathbf { Z } _ { \ell } = { \frac { \mathbf { v } _ { \ell } } { \| \mathbf { v } _ { \ell } \| } } ; { \mathrm { w h e r e ~ } } \mathbf { v } _ { \ell } = \sum _ { i : y _ { i , \ell } = 1 } \Phi ( \mathbf { x } _ { i } ) , \forall \ell \in [ L ] ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $\Phi : \mathcal { D } \mapsto \mathbb { R } ^ { d }$ it the text vectorizer. Then we follow similar procedures as [8] and [13] and use balanced $\mathbf { k }$ -means ( $k = B ,$ ) to recursively partition label sets and generate the HLT in a top-down fashion. The HLT is represented with a series of indexing matrices $\{ \mathbf { C } ^ { ( t ) } \} _ { t = 1 } ^ { D }$ )}Dt=1, such that $\mathbf { C } ^ { ( t ) } \in \{ 0 , 1 \} ^ { K _ { t } \times K _ { t - 1 } }$ where $K _ { 0 } = 1$ and $K _ { D } = L$ . Equivalently, once $\mathbf { C } ^ { ( D ) }$ is constructed, the HLT can be built from bottom up through joining $B$ adjacent clusters together.
|
| 80 |
+
|
| 81 |
+
Multi-resolution Output Space. Multi-resolution learning has been explored in different contexts such as computer vision [14, 42]. For instance, using an output scheme with coarse-to-fine resolutions results in better image quality for generative adversarial networks [15, 16]. As an another example in meta learning, [43] learns multiclass models via auxiliary meta classes by collapsing existing classes. Nevertheless, multi-resolution learning has not been well-explored in the XMC literature. In XR-Transformer, we leverage the label hierarchy defined by the HLT and train the transformer model on multi-resolution objectives.
|
| 82 |
+
|
| 83 |
+
The XMC task can be viewed as generating an 1-D image $\mathbf { y } \in \{ 0 , 1 \} ^ { L }$ with binary values based on input text x. Just like a coarsified image could be obtained by a max or mean pooling of nearby pixels, the coarse label vector can be obtained by max-pooling of labels which are nearby in the label feature space. Once the HLT is constructed using label features, the true labels at layer $\mathbf { \bar { Y } } ^ { ( t ) } \in \{ 0 , 1 \} ^ { N \times K _ { t } }$ can be determined by the true labels of the child clusters at $t + 1$ through a max-pooling like operation:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mathbf { Y } ^ { ( t ) } = \mathrm { b i n a r i z e } ( \mathbf { Y } ^ { ( t + 1 ) } \mathbf { C } ^ { ( t + 1 ) } ) ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
and Y (D)i,\` $Y _ { i , \ell } ^ { ( D ) } = y _ { i , \ell }$ is the original label matrix. This forms a series of learning signals with coarse-to-fine resolution and can be used to generate learning tasks with easy-to-hard objectives.
|
| 90 |
+
|
| 91 |
+
Direct use of the binarized $\mathbf { Y } ^ { ( t ) } \in \{ 0 , 1 \} ^ { N \times K _ { t } }$ in Eq (5) results in information loss when merging several positive labels into one cluster. Ideally, a cluster containing several positive children is more relevant than a cluster with only one positive child. To add this lower level information to higher level learning objectives, we introduce the relevance matrix ${ \bf R } ^ { ( t ) } \in \mathbb { R } _ { \pm } ^ { N \times K _ { t } }$ for layer $t$ of the XMC sub-problem where $R _ { i , \ell }$ defines the non-negative important weight for ith instance to \`th cluster. Different from cost-sensitive learning [44] for MLC (CSMLC) setting [45–47] where there is only one cost matrix explicitly derived by evaluation metrics such as F1 score, in XR-Transformer, we consider the usage of cost-sensitive learning where the relevance matrices are recursively induced by the HLT structure. Specifically, given an HLT, we recursively construct relevance matrices for $t = 1 , \ldots , D$ :
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\mathbf { R } ^ { ( t ) } = \mathbf { R } ^ { ( t + 1 ) } \mathbf { C } ^ { ( t + 1 ) } ,
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
and $\mathbf { R } ^ { ( D ) } = \mathbf { Y } ^ { ( D ) }$ . Motivated by [48], we adopts the row-wise $\ell _ { 1 }$ normalized relevance matrix:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { r } { \hat { R } _ { i , j } ^ { ( t ) } = \left\{ \begin{array} { l l } { \frac { R _ { i , j } ^ { ( t ) } } { \| \mathbf { R } _ { i } ^ { ( t ) } \| _ { 1 } } } & { \mathrm { ~ i f ~ } Y _ { i , j } ^ { ( t ) } = 1 , } \\ { \alpha } & { \mathrm { o t h e r w i s e } , } \end{array} \right. } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $\alpha$ is the hyper parameter to balance positive and negative weights.
|
| 104 |
+
|
| 105 |
+
Label Shortlisting. During training, XR-Transformer only focuses on discriminating the labels or clusters that have high chance of being positive. A necessary condition for a label at layer $t$ to be positive is that its parent label at level $t - 1$ is positive. Therefore, an intuitive approach would be to only train on the output space shortlisted by positive clusters of the parent layer. However, in practice we found this approach sometimes leads to sub-optimal result during inference with beam search. As an effort to balance explore and exploit, we further include the top- $k$ relevant clusters determined by the model learned on the parent layer to mimic the beam search during inference. Thus at layer $t$ , the labels considered during training are shortlisted by the parent layer $t - 1$ :
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\begin{array} { r } { \begin{array} { r l } & { \mathbf { P } ^ { ( t - 1 ) } = \mathrm { T o p } ( \mathbf { W } ^ { ( t - 1 ) \top } \Phi ( \mathbf { X } , \Theta ^ { ( t - 1 ) } ) , k ) , } \\ & { \mathbf { M } ^ { ( t ) } = \mathrm { b i n a r i z e } ( \mathbf { P } ^ { ( t - 1 ) } \mathbf { C } ^ { ( t ) \top } ) + \mathrm { b i n a r i z e } ( \mathbf { Y } ^ { ( t - 1 ) } \mathbf { C } ^ { ( t ) \top } ) , } \end{array} } \end{array}
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
where the $\mathrm { T o p } ( \cdot , k )$ operator zeros out elements in a matrix except the top- $k$ largest values in each row. For each instance $\mathbf { x } _ { i }$ , only non-zero indices of $\mathbf { M } _ { i }$ will be included into the training objective. We can therefore define a series of learning objectives for level $t \in \{ 1 , 2 , \dots , D \}$ as:
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\operatorname* { m i n } _ { \mathbf { W } ^ { ( t ) } , \Theta } \sum _ { i = 1 } ^ { N } \sum _ { \ell : \mathbf { M } _ { i , \ell } ^ { ( t ) } \neq 0 } \hat { R } _ { i , \ell } ^ { ( t ) } \mathcal { L } ( Y _ { i , \ell } ^ { ( t ) } , \mathbf { W } _ { \ell } ^ { ( t ) \top } \Phi ( \mathbf { x } _ { i } , \Theta ) ) + \lambda \| \mathbf { W } ^ { ( t ) } \| ^ { 2 } ,
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
where $\mathcal { L }$ is a point-wise loss such as hinge loss, squared hinge loss or BCE loss, $\mathbf { W } ^ { ( t ) }$ , $\Theta$ are the model weights to be learned.
|
| 118 |
+
|
| 119 |
+
Text Representation. Most previous works on XMC construct text feature representation in one of two ways: statistical feature representations and semantic feature representations. Although the latter, in particular transformer models, have shown promising results on various NLP benchmarks, the self-attention mechanism makes transformers unscalable w.r.t. sequence length. To ensure efficiency, input texts are usually truncated [12, 13] which result in loss of information. On the other hand, the statistical features, such as TFIDF, are fast to construct with the whole input taken into consideration. In XR-Transformer, we use a combination of these two feature representations and each component is a complement of lost information for the other one:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\Phi _ { c a t } ( \mathbf { x } , \Theta ) : = \Big [ \frac { \Phi _ { t f i d f } ( \mathbf { x } ) } { \lVert \Phi _ { t f i d f } ( \mathbf { x } ) \rVert } , \frac { \Phi _ { d n n } ( \mathbf { x } , \Theta ) } { \lVert \Phi _ { d n n } ( \mathbf { x } , \Theta ) \rVert } \Big ] ,
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\perp \theta ^ { * } \theta
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\begin{array} { r l } & { \quad \lfloor \mathbf { \delta v } ^ { \star } \gets \boldsymbol { \sigma } } \\ & { \mathbf { W } ^ { * } \gets \operatorname * { a r g m i n } _ { \mathbf { W } } \sum _ { i = 1 } ^ { N } \sum _ { \ell = 1 } ^ { m } \hat { R } _ { i , \ell } ^ { ( t ) } \mathcal { L } ( Y _ { i , \ell } , \mathbf { W } _ { \ell } ^ { \top } \Phi _ { c a t } ( \mathbf { x } _ { i } , \boldsymbol { \Theta } ) ) + \lambda \| \mathbf { W } \| ^ { 2 } } \end{array}
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\begin{array} { r l } & { \quad \bigcup \mathbf { \phi } \in \mathbf { \phi } \theta } \\ & { \mathbf { W } ^ { * } \operatorname { a r g m i n } _ { \mathbf { W } } \sum _ { i = 1 } ^ { N } \sum _ { \ell : \mathbf { M } _ { i , \ell } \neq 0 } \hat { R } _ { i , \ell } ^ { ( t ) } \mathcal { L } ( Y _ { i , \ell } , \mathbf { W } _ { \ell } ^ { \top } \Phi _ { c a t } ( \mathbf { x } _ { i } , \theta ^ { * } ) ) + \lambda \Vert \mathbf { W } \Vert ^ { 2 } } \end{array}
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
# Algorithm 2: XR-Transformer training
|
| 138 |
+
|
| 139 |
+
Input :X, $\mathbf { Y }$ , pre-trained transformer $\Phi _ { d n n } ( \cdot , \pmb { \theta } _ { 0 } )$
|
| 140 |
+
$\hat { \mathbf { Z } } _ { \ell } = \mathbf { v } _ { \ell } / \| \mathbf { v } _ { \ell } \|$ ; where $\begin{array} { r } { \mathbf { v } _ { \ell } = \sum _ { i : y _ { i , \ell } = 1 } \Phi _ { t f i d f } ( \mathbf { x } _ { i } ) , \forall \ell \in [ L ] } \end{array}$
|
| 141 |
+
$\{ \hat { \mathbf { C } } ^ { ( t ) } \} _ { t = 1 } ^ { \hat { D } } \mathbf { k }$ -means-clustering $( \hat { \mathbf { Z } } )$
|
| 142 |
+
Generate label hierarchy {Yˆ (t)}Dˆt= using 5
|
| 143 |
+
${ \pmb \theta } ^ { * } = { \pmb \theta } _ { 0 }$ , ${ \bf P } = N o n e$
|
| 144 |
+
for $t$ in $1 , 2 , 3 , \cdots , \hat { D } $ do $\hat { \mathbf { W } } , \pmb { \theta } ^ { * } \gets$ Iterative_Learn(X, Yˆ (t), Cˆ (t), θ∗, P) $\mathbf { P } \gets \mathrm { T o p } ( \hat { \mathbf { W } } ^ { \top } \Phi _ { c a t } ( \mathbf { X } , \pmb { \theta } ^ { * } ) , k )$
|
| 145 |
+
$\mathbf { Z } _ { \ell } = \mathbf { v } _ { \ell } / \| \mathbf { v } _ { \ell } \|$ ; where $\begin{array} { r } { \mathbf { v } _ { \ell } = \sum _ { i : y _ { i , \ell } = 1 } \Phi _ { c a t } ( \mathbf { x } _ { i } ) , \forall \ell \in [ L ] } \end{array}$
|
| 146 |
+
$\{ \mathbf { C } ^ { ( t ) } \} _ { t = 1 } ^ { D } \mathbf { k }$ -means-clustering $( \mathbf { Z } )$
|
| 147 |
+
Generate label hierarchy $\{ \mathbf { Y } ^ { ( t ) } \} _ { t = 1 } ^ { \hat { D } }$ using 5
|
| 148 |
+
Fix $\pmb { \theta } ^ { * }$ , ${ \bf P } = N o n e$
|
| 149 |
+
for $t$ in $1 , 2 , 3 , \cdots , D$ do
|
| 150 |
+
R $\begin{array} { r l } & { \mathbf { W } ^ { ( t ) } , \ldots \mathrm { I t e r a t i v e \_ L e a r n } ( \mathbf { X } , \mathbf { Y } ^ { ( t ) } , \mathbf { C } ^ { ( t ) } , \pmb { \theta } ^ { * } , \mathbf { P } ) } \\ & { \mathbf { P } \mathrm { T o p } ( \mathbf { W } ^ { ( t ) \top } \Phi _ { c a t } ( \mathbf { X } , \pmb { \theta } ^ { * } ) , k ) } \\ & { \mathbf { e t u r n } : \Phi _ { c a t } ( \cdot , \pmb { \theta } ^ { * } ) , \{ \mathbf { C } ^ { ( t ) } \} _ { t = 1 } ^ { D } , \{ \mathbf { W } ^ { ( t ) } \} _ { t = 1 } ^ { D } } \end{array}$
|
| 151 |
+
|
| 152 |
+
where $\Phi _ { d n n } ( \cdot , \Theta )$ is the transformer parametrized by $\Theta$ . Once the text representation is constructed, predictions can be made by simply applying a linear projection on top of the text representation through (1).
|
| 153 |
+
|
| 154 |
+
Training with bootstrapping. The training of XR-Transformer consists of three steps. At first, a preliminary HLT is constructed using raw statistical features. Then a pre-trained transformer model is fine-tuned recursively from low resolution output to high resolution. At each layer $t$ , fine-tuning objective (9) is optimized with initialization $\Theta = \pmb \theta ^ { ( t - 1 ) * }$ the best transformer weights of layer $t - 1$ ${ \pmb \theta } ^ { ( 0 ) * }$ denotes the pre-trained transformer weights.
|
| 155 |
+
|
| 156 |
+
Unlike the transformer warmed-up with pre-trained weights, the projection weights $\mathbf { W } ^ { ( t ) }$ is trained from scratch without good initialization. At the beginning of fine-tuning, gradient flow through these cold-start (usually randomly initialized) weights will usually worsen the pre-trained components.
|
| 157 |
+
|
| 158 |
+
We leverage the recursive learning structure to tackle this issue by model bootstrapping. Concretely, $\mathbf { W } ^ { ( t ) }$ is initialized as:
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\mathbf { W } _ { i n i t } ^ { ( t ) } : = \underset { \mathbf { W } ^ { ( t ) } } { \operatorname { a r g m i n } } \sum _ { i = 1 } ^ { N } \sum _ { \ell : \mathbf { M } _ { i , \ell } ^ { ( t ) } \neq 0 } \hat { R } _ { i , \ell } ^ { ( t ) } \mathcal { L } ( Y _ { i , \ell } ^ { ( t ) } , \mathbf { W } _ { \ell } ^ { ( t ) \top } \Phi _ { d n n } ( \mathbf { x } _ { i } , \pmb { \theta } ^ { ( t - 1 ) * } ) ) + \lambda \| \mathbf { W } ^ { ( t ) } \| ^ { 2 } ,
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
In practice, (11) is fast to compute since the semantic text feature for the previous layer $\Phi _ { c a t } ( \mathbf { X } , \pmb { \theta } ^ { ( t - 1 ) * } )$ is already computed and thus (11) can be solved very quickly on CPUs with a variety of parallel linear solvers, such as LIBLINEAR [49].
|
| 165 |
+
|
| 166 |
+
Once the fine-tuning is complete, the refined HLT is constructed with the text representation that combines statistical text feature and fine-tuned semantic text embeddings. Then the ranking models are trained on top of the combined text features for the final prediction. The detailed training procedure is described in Algorithm 1 and 2.
|
| 167 |
+
|
| 168 |
+
Inference. The inference cost of XR-Transformer consists mainly of two parts: cost to compute transformer embedding and to retrieve relevant labels through beam search. Therefore, the inference time complexity is $O ( T _ { d n n } + k d \log ( L ) )$ , where $k$ is the beam size, $d$ is the concatenated feature dimension and $T _ { d n n }$ is the time to compute $\Phi _ { d n n } ( \mathbf { x } )$ for a given input. Note that even the inference is done with beam search through the refined HLT, the transformer text embedding only need to be computed once per instance.
|
| 169 |
+
|
| 170 |
+
Connections with other tree based methods. Although methods such as AttentionXML [8] also train on supervisions induced by label trees, the final model is a chain of sub-models which each on is learned on single-resolution. In particular, given a hierarchical label tree with depth $D$ , AttentionXML will train $D$ different text encoders on each layer of the tree where as XR-Transformer trains the same transformer encoder progressively on all layers of the tree. This difference leads to a longer inference time for AttentionXML than XR-Transformer since multiple text encoders need to be queried during inference, as shown in the comparison in the inference time in Appendix A.4.2.
|
| 171 |
+
|
| 172 |
+
# 5 Experimental Results
|
| 173 |
+
|
| 174 |
+
We evaluate XR-Transformer on 6 public XMC benchmarking datasets: Eurlex-4K, Wiki10-31K, AmazonCat-13K, Wiki-500K, Amazon-670K, Amazon-3M. Data statistics are given in Table 1. For fair comparison, we use the same raw text input, sparse feature representations and same train-test split as AttentionXML [8] and other latest works [12, 13]. The evaluation metric is Precision $@ \mathbf { k }$ $( \mathrm { P } @ \mathrm { k } )$ , which is widely-used in XMC literature [3, 8, 12, 13, 18, 28]. The results of Propensity-score Precision $@ \mathbf { k }$ $( { \mathrm { P S P } } @ \mathbf { k } )$ are defer to Appendix A.4.3, which focus more on tail labels’ performance.
|
| 175 |
+
|
| 176 |
+
Table 1: Data statistics. $N _ { t r a i n } , N _ { t e s t }$ refer to the number of instances in the training and test sets, respectively. $L$ : the number of labels. $\bar { L }$ : the average number of positive labels per instance. $\bar { n }$ : average number of instances per label. $d _ { t f i d f }$ : the sparse feature dimension of $\bar { \Phi } _ { t f i d f } ( \cdot )$ . These six publicly available benchmark datasets, including the sparse TF-IDF features are downloaded from https://github.com/yourh/AttentionXML which are the same as AttentionXML [8] XTransformer [12] and LightXML [13] for fair comparison.
|
| 177 |
+
|
| 178 |
+
<table><tr><td>Dataset</td><td>Ntrain</td><td>Ntest</td><td>L</td><td>L</td><td>n</td><td>dtfidf</td></tr><tr><td>Eurlex-4K</td><td>15,449</td><td>3,865</td><td>3,956</td><td>5.30</td><td>20.79</td><td>186,104</td></tr><tr><td>Wiki10-31K</td><td>14,146</td><td>6,616</td><td>30.938</td><td>18.64</td><td>8.52</td><td>101,938</td></tr><tr><td>AmazonCat-13K</td><td>1,186,239</td><td>306,782</td><td>13,330</td><td>5.04</td><td>448.57</td><td>203,882</td></tr><tr><td>Wiki-500K</td><td>1,779,881</td><td>769,421</td><td>501,070</td><td>4.75</td><td>16.86</td><td>2,381,304</td></tr><tr><td>Amazon-670K</td><td>490,449</td><td>153,025</td><td>670.091</td><td>5.45</td><td>3.99</td><td>135,909</td></tr><tr><td>Amazon-3M</td><td>1,717,899</td><td>742,507</td><td>2,812,281</td><td>36.04</td><td>22.02</td><td>337,067</td></tr></table>
|
| 179 |
+
|
| 180 |
+
Baseline Methods. We compare XR-Transformer with state-of-the-art (SOTA) XMC methods: AnnexML [28], DiSMEC [18], PfastreXML [41], Parabel [3], eXtremeText [24], Bonsai [50], XMLCNN [33], XR-Linear [7], AttentionXML [8], X-Transformer [12] and LightXML [13]. We obtain most baseline results from [8, Table 3] and [7, Table 3] except for the latest deep learning based algorithms [8, 12, 13]. To have fair comparison on training time, we use the same hardware (i.e., AWS p3.16xlarge) and the same inputs (i.e., raw text, vectorized features, data split) to obtain the results of AttentionXML, X-Transformer and LightXML. The hyper-parameter of XR-Transformer and more empirical results are included in Appendix A.3.
|
| 181 |
+
|
| 182 |
+
Table 2: Comparison of XR-Transformer with recent XMC methods on six public datasets. Results with a trailing reference are taken from [8, Table 3] and [7, Table 3]. We obtain the results of AttentionXML∗, LightXML∗, X-Transformer∗ and XR-Transformer∗ on the same vectorized feature matrix provided in [8]. Due to GPU memory constraint, LightXML is not able to run on Amazon-3M. The $\mathrm { P S P } @ \mathrm { k }$ results are available in Appendix A.4.3.
|
| 183 |
+
|
| 184 |
+
<table><tr><td>Methods</td><td>P@1 P@3</td><td>P@5</td><td>P@1</td><td>P@3</td><td>P@5</td><td>P@1</td><td>P@3</td><td>P@5</td></tr><tr><td></td><td colspan="6">Eurlex-4K Wiki10-31K</td><td>AmazonCat-13K</td><td></td></tr><tr><td>AnnexML [28] DiSMEC[18]</td><td>79.66 83.21</td><td>64.94 70.39</td><td>53.52 58.73</td><td>86.46 84.13 83.57</td><td>74.28 74.72 68.61</td><td>64.20 65.94 59.10</td><td>93.54 78.36 93.81 79.08</td><td>63.30 64.06</td></tr><tr><td>PfastreXML [41] Parabel [3]</td><td>73.14 82.12</td><td>60.16 68.91</td><td>50.54 57.89</td><td>84.19</td><td>72.46 63.37</td><td>91.75 93.02</td><td>77.97 79.14</td><td>63.68 64.51</td></tr><tr><td>eXtremeText [24]</td><td>79.17</td><td>66.80</td><td>56.09</td><td>83.66 73.28</td><td>64.51</td><td>92.50</td><td>78.12</td><td>63.51</td></tr><tr><td>Bonsai [50]</td><td>82.30</td><td>69.55</td><td>58.35</td><td>84.52 73.76</td><td>64.69</td><td>92.98</td><td></td><td>64.46</td></tr><tr><td>XML-CNN [33]</td><td>75.32</td><td>60.14</td><td>49.21</td><td>81.41 66.23</td><td>56.11</td><td></td><td>79.13</td><td></td></tr><tr><td>XR-Linear [7]</td><td>84.14</td><td>72.05 60.67</td><td>85.75</td><td>75.79</td><td>66.69</td><td>93.26</td><td>77.06</td><td>61.40</td></tr><tr><td>AttentionXML*</td><td></td><td></td><td></td><td></td><td></td><td>94.64</td><td>79.98</td><td>64.79</td></tr><tr><td>X-Transformer*</td><td>86.93</td><td>74.12</td><td>62.16</td><td>87.34</td><td>78.18</td><td>69.07 95.84</td><td>82.39</td><td>67.32</td></tr><tr><td></td><td>87.61</td><td>75.39 75.95</td><td>63.05 63.45</td><td>88.26</td><td>78.51</td><td>69.68 96.48</td><td>83.41</td><td>68.19</td></tr><tr><td>LightXML*</td><td>87.15</td><td></td><td></td><td>89.67 79.06</td><td>69.87</td><td>96.77</td><td>83.98</td><td>68.63</td></tr><tr><td>XR-Transformer*</td><td>88.41 75.97</td><td>63.18</td><td>88.69</td><td>80.17</td><td>70.91</td><td>96.79</td><td>83.66</td><td>68.04</td></tr><tr><td>AnnexML [28]</td><td>Wiki-500K</td><td></td><td></td><td></td><td>Amazon-670K</td><td></td><td>Amazon-3M</td><td></td></tr><tr><td>DiSMEC[18]</td><td>64.22 70.21</td><td>43.15 50.57</td><td>32.79 39.68</td><td>42.09 44.78 36.84</td><td>36.61 39.72</td><td>32.75 36.17</td><td>49.30 45.55 47.34 44.96</td><td>43.11 42.80</td></tr><tr><td>PfastreXML [41] Parabel [3]</td><td>56.25</td><td>37.32 49.57</td><td>28.16</td><td>34.23</td><td>32.09</td><td>43.83</td><td>41.81</td><td>40.09</td></tr><tr><td>eXtremeText [24]</td><td>68.70</td><td></td><td>38.64</td><td>44.91 39.77</td><td>35.98</td><td>47.42</td><td>44.66</td><td>42.55</td></tr><tr><td></td><td>65.17</td><td>46.32</td><td>36.15</td><td>42.54 37.93</td><td>34.63</td><td>42.20</td><td>39.28</td><td>37.24</td></tr><tr><td>Bonsai [50]</td><td>69.26</td><td>49.80</td><td>38.83</td><td>45.58 40.39</td><td>36.60</td><td>48.45</td><td>45.65</td><td>43.49</td></tr><tr><td>XML-CNN [33]</td><td>1</td><td>1</td><td>1</td><td>33.41</td><td>30.00 27.42</td><td>1</td><td>-</td><td>1</td></tr><tr><td>XR-Linear [7]</td><td>65.59</td><td>46.72</td><td>36.46</td><td>43.38</td><td>38.40 34.77</td><td>47.40</td><td>44.15</td><td>41.87</td></tr><tr><td>AttentionXML*</td><td>76.74</td><td>58.18</td><td>45.95</td><td>47.68</td><td></td><td>50.86</td><td></td><td></td></tr><tr><td>X-Transformer*</td><td>77.09</td><td>57.51</td><td>45.28</td><td>48.07</td><td>42.70</td><td>38.99</td><td>48.00</td><td>45.82</td></tr><tr><td></td><td></td><td></td><td></td><td>42.96</td><td>39.12</td><td>51.20</td><td>47.81</td><td>45.07</td></tr><tr><td>LightXML* XR-Transformer*</td><td>77.89 79.40</td><td>58.98 59.02</td><td>45.71 46.25</td><td>49.32 44.17 50.11 44.56</td><td>40.25 40.64</td><td>= 54.20</td><td>= 50.81</td><td>48.26</td></tr></table>
|
| 185 |
+
|
| 186 |
+
Table 3: Comparing training time (in hours) of DNN-based methods that produce the SOTA results in Table 2. The number following the model indicates the number of ensemble models used.
|
| 187 |
+
|
| 188 |
+
<table><tr><td>Dataset</td><td>AttentionXML-3</td><td>X-Transformer-9</td><td>LightXML-3</td><td>XR-Transformer-3</td></tr><tr><td>Eurlex-4K</td><td>0.9</td><td>7.5</td><td>16.9</td><td>0.8</td></tr><tr><td>Wiki10-31K</td><td>1.5</td><td>14.1</td><td>26.9</td><td>1.5</td></tr><tr><td>AmazonCat-13K</td><td>24.3</td><td>147.6</td><td>310.6</td><td>13.2</td></tr><tr><td>Wiki-500K</td><td>37.6</td><td>557.1</td><td>271.3</td><td>38.0</td></tr><tr><td>Amazon-670K</td><td>24.2</td><td>514.8</td><td>159.0</td><td>10.5</td></tr><tr><td>Amazon-3M</td><td>54.8</td><td>542.0</td><td>1</td><td>29.3</td></tr></table>
|
| 189 |
+
|
| 190 |
+
Model Performance. The comparisons of Precision $@ \mathbf { k }$ $( \mathrm { P } @ \mathrm { k } )$ and training time are shown in Table 2 and Table 8, respectively. The proposed XR-Transformer follows AttentionXML and LightXML to use an ensemble of 3 models, while X-Transformer uses an ensemble of 9 models [12]. More details about the ensemble setting can be found in Appendix A.3. The proposed XR-Transformer framework achieves new SOTA results in 14 out of 18 evaluation columns (combination of datasets and $\mathrm { P } @ \mathrm { k } ,$ ), and outperforms competitive methods on the large datasets. Next, we show the training time of XR-Transformer is significantly less than other DNN-based models.
|
| 191 |
+
|
| 192 |
+
Table 4: Single model comparison of DNN based XMC models. Training time on p3.16xlarge with 8 Nvidia V100 GPUs whereas time on singl $T _ { t r a i n } ^ { 8 }$ are reported ia V100 GPU entionXML, X-Transformer and XR-Transformer,is reported for LightXML and XR-Transformer. $T _ { t r a i n } ^ { 1 }$
|
| 193 |
+
|
| 194 |
+
<table><tr><td>Dataset</td><td>Method</td><td>P@1</td><td>P@3</td><td>P@5</td><td></td><td></td></tr><tr><td rowspan="4">Wiki10-31K</td><td>AttentionXML-1</td><td>87.1</td><td>77.8</td><td>68.8</td><td>1</td><td>0.5</td></tr><tr><td>X-Transformer-1</td><td>87.5</td><td>77.2</td><td>67.1</td><td>-</td><td>3.5</td></tr><tr><td>LightXML-1</td><td>87.8</td><td>77.3</td><td>68.0</td><td>6.7</td><td>-</td></tr><tr><td>XR-Transformer-1</td><td>88.0</td><td>78.7</td><td>69.1</td><td>1.3</td><td>0.5</td></tr><tr><td rowspan="4">Wiki-500K</td><td>AttentionXML-1</td><td>75.1</td><td>56.5</td><td>44.4</td><td>-</td><td>12.5</td></tr><tr><td>X-Transformer-1</td><td>44.8</td><td>40.1</td><td>34.6</td><td>-</td><td>56.0</td></tr><tr><td>LightXML-1</td><td>76.3</td><td>57.3</td><td>44.2</td><td>89.6</td><td>1</td></tr><tr><td>XR-Transformer-1</td><td>78.1</td><td>57.6</td><td>45.0</td><td>29.2</td><td>12.5</td></tr><tr><td rowspan="4">Amazon-670K</td><td>AttentionXML-1</td><td>45.7</td><td>40.7</td><td>36.9</td><td>-</td><td>8.1</td></tr><tr><td>X-Transformer-1</td><td>44.8</td><td>40.1</td><td>34.6</td><td>、</td><td>56.0</td></tr><tr><td>LightXML-1</td><td>47.3</td><td>42.2</td><td>38.5</td><td>53.0</td><td>-</td></tr><tr><td>XR-Transformer-1</td><td>49.1</td><td>43.8</td><td>40.0</td><td>8.1</td><td>3.4</td></tr></table>
|
| 195 |
+
|
| 196 |
+
Training Cost. Table 8 shows the training time for these DNN-based models. To have fair comparison, all the experiments are conducted with float32 precision on AWS p3.16xlarge instance with 8 Nvidia V100 GPUs except for LightXML, which was run on single V100 GPU since multi-GPU training is not implemented. XR-Transformer consumes significantly less training time compared with other transformer based models and the shallow BiLSTM model AttentionXML. On Amazon3M, XR-Transformer has $2 0 x$ speedup over X-Transformer while achieving even better $\mathrm { P @ { k } }$ . Finally, in table 4, we compare XR-Transformer with LightXML under the single model setup (no ensemble), where XR-Transformer still consistently outperforms LightXML in $\mathbf { P } @ \mathbf { k }$ and training time.
|
| 197 |
+
|
| 198 |
+
Table 5: Comparing XR-Transformer with Pre-Trained and word2vec embeddings concatenated with TF-IDF features.
|
| 199 |
+
|
| 200 |
+
<table><tr><td>Methods</td><td>P@1 P@3</td><td>P@5</td><td>P@1</td><td>P@3</td><td>P@5</td><td>P@1</td><td>P@3</td><td>P@5</td></tr><tr><td></td><td colspan="6">Eurlex-4K</td><td>AmazonCat-13K</td><td></td></tr><tr><td>TF-IDF</td><td>84.14 72.05</td><td>60.97</td><td>85.75</td><td>75.79</td><td>66.69</td><td>94.64</td><td>79.98</td><td>64.79</td></tr><tr><td>word2vec +TF-IDF</td><td>84.35 71.27</td><td>59.10</td><td>86.11</td><td>76.92</td><td>66.45</td><td>94.53</td><td>79.44</td><td>63.94</td></tr><tr><td>Pre-Trained +TF-IDF</td><td>84.92 71.40</td><td>59.36</td><td>85.78</td><td>78.30</td><td>68.33</td><td>95.05</td><td>80.12</td><td>64.53</td></tr><tr><td>XR-Transformer</td><td>88.41 75.97</td><td>63.18</td><td>88.69</td><td>80.17</td><td>70.91</td><td>96.79</td><td>83.66</td><td>68.04</td></tr><tr><td></td><td colspan="6">Wiki-500K Amazon-670K</td><td>Amazon-3M</td><td></td></tr><tr><td>TF-IDF</td><td>65.59</td><td>46.72 36.46</td><td>43.38</td><td>38.40</td><td>34.77</td><td>47.40</td><td>44.15</td><td>41.87</td></tr><tr><td>word2vec +TF-IDF</td><td>68.21</td><td>48.16 37.54</td><td>44.04</td><td>39.07</td><td>35.35</td><td>47.51</td><td>44.49</td><td>42.19</td></tr><tr><td>Pre-Trained +TF-IDF</td><td>70.18</td><td>49.82 38.75</td><td>44.55</td><td>38.91</td><td>34.77</td><td>49.66</td><td>46.41</td><td>43.96</td></tr><tr><td>XR-Transformer</td><td>79.40</td><td>59.02 46.25</td><td>50.11</td><td>44.56</td><td>40.64</td><td>54.20</td><td>50.81</td><td>48.26</td></tr></table>
|
| 201 |
+
|
| 202 |
+
Comparison of Different Semantic Embeddings. To provide more empirical justifications, that the improvement in performance comes from better semantic embedding rather than the introducing of TF-IDF features, we further tested models using Pre-Trained Transformer and word2vec embeddings concatenated with the same TF-IDF features.
|
| 203 |
+
|
| 204 |
+
Table 5 summarizes the performance of these models on all 6 datasets. In particular, word2vec is using token embedding from word2vec-google-news-300 and for Pre-Trained we use the same setting as XR-Transformer (3-model ensemble). On large datasets such as Wiki-500K/Amazon670K/Amazon-3M, Pre-Trained $+ \mathrm { T F }$ -IDF has marginal improvement compared to the baseline TF-IDF features. Nevertheless, our proposed XR-Transformer still enjoy significant gain compared to Pre-Trained $+ \mathrm { T F }$ -IDF. This suggests the major improvement is from learning more powerful neural semantic embeddings, rather than the use of TF-IDF.
|
| 205 |
+
|
| 206 |
+
Effect of Cost-Sensitive Learning. In Table 6, we analyze the effect of cost sensitive learning on four XMC datasets with the largest output spaces. On most datasets, cost sensitive learning via aggregated labels yields better performance than those without. We also show that cost-sensitive learning is not only beneficial to XR-Transformer, but also useful to its linear counterpart XRLinear [7]. See Appendix A.4.1 for more results.
|
| 207 |
+
|
| 208 |
+
Table 6: Ablation of cost-sensitive learning on the single XR-Transformer model with or without Cost Sensitive (CS). Precision $\boldsymbol { \ @ 1 , 3 , 5 } \ : \mathrm { P } ( \boldsymbol { \ @ } \mathrm { k } )$ and Recall $^ { ( a ) 1 , 3 , 5 }$ $( \mathbb { R } ^ { \circledcirc \mathrm { k } ) }$ are reported.
|
| 209 |
+
|
| 210 |
+
<table><tr><td>Dataset</td><td>Method</td><td>P@1</td><td>P@3</td><td>P@5</td><td>R@1</td><td>R@3</td><td>R@5</td></tr><tr><td>Wiki10-31K</td><td>XR-Transformer-1(w/o CS) XR-Transformer-1</td><td>86.8 88.0</td><td>77.6 78.7</td><td>68.8 69.1</td><td>5.2 5.3</td><td>13.6 13.8</td><td>19.8 19.9</td></tr><tr><td>Wiki-500K</td><td>XR-Transformer-1(w/o CS) XR-Transformer-1</td><td>77.6 78.1</td><td>57.4 57.6</td><td>44.9 45.0</td><td>25.8 26.1</td><td>48.1 48.5</td><td>57.8 58.1</td></tr><tr><td>Amazon-670K</td><td>XR-Transformer-1(w/o CS) XR-Transformer-1</td><td>49.1 49.0</td><td>43.8 43.7</td><td>40.0 39.9</td><td>10.3 10.4</td><td>25.6 25.7</td><td>37.7 37.7</td></tr><tr><td>Amazon-3M</td><td>XR-Transformer-1(w/o CS) XR-Transformer-1</td><td>50.2 52.6</td><td>47.6 49.4</td><td>45.4 46.9</td><td>3.4 3.8</td><td>8.4 9.3</td><td>12.4 13.6</td></tr></table>
|
| 211 |
+
|
| 212 |
+
Effect of Label Resolution and Text Representation. Next, we compare the effect of label resolution on the quality of the finetuned transformer embeddings. We finetune transformer models in a non-recursive manner on a two layer HLT with different leaf cluster size. Then the fine-tuned transformer embeddings are used along or in combination with TF-IDF features to produce the predictions with refined HLT. From Figure 2 we can observe that a larger cluster size will result in worse semantic features. Figure 2 also shows that combining semantic features $\Phi _ { d n n }$ with statistical features $\Phi _ { t f i d f }$ could in general improve the model performance.
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
Figure 2: Comparison of BERT model fine-tuned with different label resolution. Larger cluster size means lower label resolution. Note that $\Phi _ { c a t }$ is the normalized concatenation of $\Phi _ { t f i d f }$ and $\Phi _ { d n n }$ .
|
| 216 |
+
|
| 217 |
+
# 6 Conclusion and Future work
|
| 218 |
+
|
| 219 |
+
In this paper, we have presented XR-Transformer approach, which is an XMC architecture that leverages multi-resolution objectives and cost sensitive learning to accelerate the fine-tuning of pre-trained transformer models. Experiments show that the proposed method establishes new stateof-the-art results on public XMC datasets while taking significantly less training time compared with earlier transformer based methods. Although the proposed architecture is designed for XMC, the ideas can be applied to other areas such as information retrieval or other DNN models such as CNNs/ResNets. Also, more extensive study is required to understand why the coarse-to-fine scheme would lead to not only faster training but better overall quality. A hypothesis is that the problem is being solved at multiple scales hence leading to more robust learning of deep transformer models.
|
| 220 |
+
|
| 221 |
+
References
|
| 222 |
+
[1] Wei-Cheng Chang, Felix X. Yu, Yin-Wen Chang, Yiming Yang, and Sanjiv Kumar. Pre-training tasks for embedding-based large-scale retrieval. In International Conference on Learning Representations, 2020.
|
| 223 |
+
[2] Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. Latent retrieval for weakly supervised open domain question answering. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics (ACL), 2019.
|
| 224 |
+
[3] Yashoteja Prabhu, Anil Kag, Shrutendra Harsola, Rahul Agrawal, and Manik Varma. Parabel: Partitioned label trees for extreme classification with application to dynamic search advertising. In WWW, 2018.
|
| 225 |
+
[4] Yashoteja Prabhu and Manik Varma. Fastxml: A fast, accurate and stable tree-classifier for extreme multi-label learning. In KDD, 2014.
|
| 226 |
+
[5] Wei-Cheng Chang, Daniel Jiang, Hsiang-Fu Yu, Choon-Hui Teo, Jiong Zhang, Kai Zhong, Kedarnath Kolluri, Qie Hu, Nikhil Shandilya, Vyacheslav Ievgrafov, Japinder Singh, and Inderjit S Dhillon. Extreme multi-label learning for semantic matching in product search. In KDD. ACM, 2021.
|
| 227 |
+
[6] Sujay Khandagale, Han Xiao, and Rohit Babbar. Bonsai: diverse and shallow trees for extreme multi-label classification. Machine Learning, 109(11):2099–2119, 2020.
|
| 228 |
+
[7] Hsiang-Fu Yu, Kai Zhong, and Inderjit S Dhillon. PECOS: Prediction for enormous and correlated output spaces. arXiv preprint arXiv:2010.05878, 2020.
|
| 229 |
+
[8] Ronghui You, Zihan Zhang, Ziye Wang, Suyang Dai, Hiroshi Mamitsuka, and Shanfeng Zhu. AttentionXML: Label tree-based attention-aware deep model for high-performance extreme multi-label text classification. In Advances in Neural Information Processing Systems, pages 5812–5822, 2019.
|
| 230 |
+
[9] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (NAACL), 2019.
|
| 231 |
+
[10] Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Ruslan Salakhutdinov, and Quoc V Le. XLNet: Generalized autoregressive pretraining for language understanding. In NIPS, 2019.
|
| 232 |
+
[11] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. RoBERTa: A robustly optimized BERT pretraining approach. arXiv preprint arXiv:1907.11692, 2019.
|
| 233 |
+
[12] Wei-Cheng Chang, Hsiang-Fu Yu, Kai Zhong, Yiming Yang, and Inderjit S Dhillon. Taming pretrained transformers for extreme multi-label text classification. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 3163–3171, 2020.
|
| 234 |
+
[13] Ting Jiang, Deqing Wang, Leilei Sun, Huayi Yang, Zhengyang Zhao, and Fuzhen Zhuang. LightXML: Transformer with dynamic negative sampling for high-performance extreme multilabel text classification. In AAAI, 2021.
|
| 235 |
+
[14] Wei-Sheng Lai, Jia-Bin Huang, Narendra Ahuja, and Ming-Hsuan Yang. Deep laplacian pyramid networks for fast and accurate super-resolution. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
|
| 236 |
+
[15] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In ICLR, 2018.
|
| 237 |
+
[16] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4401–4410, 2019.
|
| 238 |
+
|
| 239 |
+
[17] Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pages 41–48, 2009.
|
| 240 |
+
|
| 241 |
+
[18] Rohit Babbar and Bernhard Schölkopf. DiSMEC: distributed sparse machines for extreme multi-label classification. In WSDM, 2017.
|
| 242 |
+
|
| 243 |
+
[19] Ian EH Yen, Xiangru Huang, Kai Zhong, Pradeep Ravikumar, and Inderjit S Dhillon. PDSparse: A primal and dual sparse approach to extreme multiclass and multilabel classification. In International Conference on Machine Learning (ICML), 2016.
|
| 244 |
+
|
| 245 |
+
[20] Ian EH Yen, Xiangru Huang, Wei Dai, Pradeep Ravikumar, Inderjit Dhillon, and Eric Xing. PPDsparse: A parallel primal-dual sparse method for extreme classification. In KDD. ACM, 2017.
|
| 246 |
+
|
| 247 |
+
[21] Rohit Babbar and Bernhard Schölkopf. Data scarcity, robustness and extreme multi-label classification. Machine Learning, pages 1–23, 2019.
|
| 248 |
+
|
| 249 |
+
[22] Anna E Choromanska and John Langford. Logarithmic time online multiclass prediction. Advances in Neural Information Processing Systems, 28:55–63, 2015.
|
| 250 |
+
|
| 251 |
+
[23] Hal Daumé III, Nikos Karampatziakis, John Langford, and Paul Mineiro. Logarithmic time one-against-some. In International Conference on Machine Learning, pages 923–932. PMLR, 2017.
|
| 252 |
+
|
| 253 |
+
[24] Marek Wydmuch, Kalina Jasinska, Mikhail Kuznetsov, Róbert Busa-Fekete, and Krzysztof Dembczynski. A no-regret generalization of hierarchical softmax to extreme multi-label classification. In NIPS, 2018.
|
| 254 |
+
|
| 255 |
+
[25] Yashoteja Prabhu, Aditya Kusupati, Nilesh Gupta, and Manik Varma. Extreme regression for dynamic search advertising. In Proceedings of the 13th International Conference on Web Search and Data Mining, pages 456–464, 2020.
|
| 256 |
+
|
| 257 |
+
[26] Kalina Jasinska-Kobus, Marek Wydmuch, Krzysztof Dembczynski, Mikhail Kuznetsov, and Robert Busa-Fekete. Probabilistic label trees for extreme multi-label classification. arXiv preprint arXiv:2009.11218, 2020.
|
| 258 |
+
|
| 259 |
+
[27] Kalina Jasinska-Kobus, Marek Wydmuch, Devanathan Thiruvenkatachari, and Krzysztof Dembczynski. Online probabilistic label trees. In International Conference on Artificial Intelligence and Statistics, pages 1801–1809. PMLR, 2021.
|
| 260 |
+
|
| 261 |
+
[28] Yukihiro Tagami. AnnexML: Approximate nearest neighbor search for extreme multi-label classification. In Proceedings of the 23rd ACM SIGKDD international conference on knowledge discovery and data mining, pages 455–464, 2017.
|
| 262 |
+
|
| 263 |
+
[29] Himanshu Jain, Venkatesh Balasubramanian, Bhanu Chunduri, and Manik Varma. SLICE: Scalable linear extreme classifiers trained on 100 million labels for related searches. In Proceedings of the Twelfth ACM International Conference on Web Search and Data Mining, pages 528–536. ACM, 2019.
|
| 264 |
+
|
| 265 |
+
[30] Y. A. Malkov and D. A. Yashunin. Efficient and robust approximate nearest neighbor search using hierarchical navigable small world graphs. IEEE Transactions on Pattern Analysis and Machine Intelligence, 42(4):824–836, 2020.
|
| 266 |
+
|
| 267 |
+
[31] Chuan Guo, Ali Mousavi, Xiang Wu, Daniel N Holtmann-Rice, Satyen Kale, Sashank Reddi, and Sanjiv Kumar. Breaking the glass ceiling for embedding-based classifiers for large output spaces. In Advances in Neural Information Processing Systems, pages 4944–4954, 2019.
|
| 268 |
+
|
| 269 |
+
[32] Ruiqi Guo, Philip Sun, Erik Lindgren, Quan Geng, David Simcha, Felix Chern, and Sanjiv Kumar. Accelerating large-scale inference with anisotropic vector quantization. In International Conference on Machine Learning, pages 3887–3896. PMLR, 2020.
|
| 270 |
+
|
| 271 |
+
[33] Jingzhou Liu, Wei-Cheng Chang, Yuexin Wu, and Yiming Yang. Deep learning for extreme multi-label text classification. In Proceedings of the 40th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 115–124. ACM, 2017.
|
| 272 |
+
|
| 273 |
+
[34] Tharun Kumar Reddy Medini, Qixuan Huang, Yiqiu Wang, Vijai Mohan, and Anshumali Shrivastava. Extreme classification in log memory using count-min sketch: A case study of amazon search with $5 0 \mathrm { m }$ products. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché- Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019.
|
| 274 |
+
[35] Kunal Dahiya, Deepak Saini, Anshul Mittal, Ankush Shaw, Kushal Dave, Akshay Soni, Himanshu Jain, Sumeet Agarwal, and Manik Varma. DeepXML: A deep extreme multi-label learning framework applied to short text documents. In Proceedings of the 14th ACM International Conference on Web Search and Data Mining, pages 31–39, 2021.
|
| 275 |
+
[36] Anshul Mittal, Kunal Dahiya, Sheshansh Agrawal, Deepak Saini, Sumeet Agarwal, Purushottam Kar, and Manik Varma. DECAF: Deep extreme classification with label features. In Proceedings of the 14th ACM International Conference on Web Search and Data Mining, pages 49–57, 2021.
|
| 276 |
+
[37] D. Saini, A.K. Jain, K. Dave, J. Jiao, A. Singh, R. Zhang, and M. Varma. GalaXC: Graph neural networks with labelwise attention for extreme classification. In Proceedings of The Web Conference, April 2021.
|
| 277 |
+
[38] A. Mittal, N. Sachdeva, S. Agrawal, S. Agarwal, P. Kar, and M. Varma. ECLARE: Extreme classification with label graph correlations. In Proceedings of The ACM International World Wide Web Conference, April 2021.
|
| 278 |
+
[39] Hui Ye, Zhiyu Chen, Da-Han Wang, and Brian Davison. Pretrained generalized autoregressive model with adaptive probabilistic label clusters for extreme multi-label text classification. In International Conference on Machine Learning, pages 10809–10819. PMLR, 2020.
|
| 279 |
+
[40] Armand Joulin, Moustapha Cissé, David Grangier, Hervé Jégou, et al. Efficient softmax approximation for gpus. In International Conference on Machine Learning, pages 1302–1310. PMLR, 2017.
|
| 280 |
+
[41] Himanshu Jain, Yashoteja Prabhu, and Manik Varma. Extreme multi-label loss functions for recommendation, tagging, ranking & other missing label applications. In KDD, 2016.
|
| 281 |
+
[42] Marco Pedersoli, Andrea Vedaldi, Jordi Gonzalez, and Xavier Roca. A coarse-to-fine approach for fast deformable object detection. Pattern Recognition, 48(5):1844–1853, 2015.
|
| 282 |
+
[43] Shikun Liu, Andrew J Davison, and Edward Johns. Self-Supervised generalisation with meta auxiliary learning. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019.
|
| 283 |
+
[44] Charles Elkan. The foundations of cost-sensitive learning. In International joint conference on artificial intelligence, volume 17, pages 973–978. Lawrence Erlbaum Associates Ltd, 2001.
|
| 284 |
+
[45] Chun-Liang Li and Hsuan-Tien Lin. Condensed filter tree for cost-sensitive multi-label classification. In International Conference on Machine Learning, pages 423–431. PMLR, 2014.
|
| 285 |
+
[46] Kuan-Hao Huang and Hsuan-Tien Lin. Cost-sensitive label embedding for multi-label classification. Machine Learning, 106(9):1725–1746, 2017.
|
| 286 |
+
[47] Hsuan-Tien Lin. Advances in cost-sensitive multiclass and multilabel classification. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 3187–3188, 2019.
|
| 287 |
+
[48] Aditya K Menon, Ankit Singh Rawat, Sashank Reddi, and Sanjiv Kumar. Multilabel reductions: what is my loss optimising? In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019.
|
| 288 |
+
[49] Rong-En Fan, Kai-Wei Chang, Cho-Jui Hsieh, Xiang-Rui Wang, and Chih-Jen Lin. LIBLINEAR: a library for large linear classification. Journal of machine learning research, 9(Aug):1871–1874, 2008.
|
md/train/jDdzh5ul-d/jDdzh5ul-d.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/k-0oq5eNjh/k-0oq5eNjh.md
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A Shading-Guided Generative Implicit Model for Shape-Accurate 3D-Aware Image Synthesis
|
| 2 |
+
|
| 3 |
+
Xingang Pan1 Xudong Xu2 Chen Change Loy3 Christian Theobalt1 Bo Dai3
|
| 4 |
+
|
| 5 |
+
1Max Planck Institute for Informatics 2The Chinese University of Hong Kong {xpan,theobalt}@mpi-inf.mpg.de xx018@ie.cuhk.edu.hk 3S-Lab, Nanyang Technological University {ccloy, bo.dai}@ntu.edu.sg
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
The advancement of generative radiance fields has pushed the boundary of 3Daware image synthesis. Motivated by the observation that a 3D object should look realistic from multiple viewpoints, these methods introduce a multi-view constraint as regularization to learn valid 3D radiance fields from 2D images. Despite the progress, they often fall short of capturing accurate 3D shapes due to the shapecolor ambiguity, limiting their applicability in downstream tasks. In this work, we address this ambiguity by proposing a novel shading-guided generative implicit model that is able to learn a starkly improved shape representation. Our key insight is that an accurate 3D shape should also yield a realistic rendering under different lighting conditions. This multi-lighting constraint is realized by modeling illumination explicitly and performing shading with various lighting conditions. Gradients are derived by feeding the synthesized images to a discriminator. To compensate for the additional computational burden of calculating surface normals, we further devise an efficient volume rendering strategy via surface tracking, reducing the training and inference time by $24 \%$ and $48 \%$ , respectively. Our experiments on multiple datasets show that the proposed approach achieves photorealistic 3D-aware image synthesis while capturing accurate underlying 3D shapes. We demonstrate improved performance of our approach on 3D shape reconstruction against existing methods, and show its applicability on image relighting. Our code will be released at https://github.com/XingangPan/ShadeGAN.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Advanced deep generative models, e.g., StyleGAN [1, 2] and BigGAN [3], have achieved great successes in natural image synthesis. While producing impressive results, these 2D representationbased models cannot synthesize novel views of an instance in a 3D-consistent manner. They also fall short of representing an explicit 3D object shape. To overcome such limitations, researchers have proposed new deep generative models that represent 3D scenes as neural radiance fields [4, 5]. Such 3D-aware generative models allow explicit control of viewpoint while preserving 3D consistency during image synthesis. Perhaps a more fascinating merit is that they have shown the great potential of learning 3D shapes in an unsupervised manner from just a collection of unconstrained 2D images. If we could train a 3D-aware generative model that learns accurate 3D object shapes, it would broaden various downstream applications such as 3D shape reconstruction and image relighting.
|
| 14 |
+
|
| 15 |
+
Existing attempts for 3D-aware image synthesis [4, 5] tend to learn coarse 3D shapes that are inaccurate and noisy, as shown in Fig.1 (a). We found that such inaccuracy arises from an inevitable ambiguity inherent in the training strategy adopted by these methods. In particular, a form of regularization, which we refer to as "multi-view constraint", is used to enforce the 3D representation to look realistic from different viewpoints. The constraint is commonly implemented by first projecting the generator’s outputs (e.g., radiance fields [6]) to randomly sampled viewpoints, and then feeding them to a discriminator as fake images for training. While such a constraint enables these models to synthesize images in a 3D-aware manner, it suffers from the shape-color ambiguity, i.e., small variations of shape could lead to similar RGB images that look equally plausible to the discriminator, as the color of many objects is locally smooth. Consequently, inaccurate shapes are concealed under this constraint.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Motivation. (a) Previous methods like pi-GAN [4] resort to the "multi-view constraint", where the 3D representation is projected to different viewpoints as fake images to the discriminator. The extracted 3D meshes are often inaccurate due to the shape-color ambiguity. (b) The proposed approach ShadeGAN further adopts a "multi-lighting constraint", which motivates the 3D representation to look realistic under different lighting conditions. This constraint effectively addresses the ambiguity, giving rise to more natural and precise 3D shapes.
|
| 19 |
+
|
| 20 |
+
In this work, we propose a novel shading-guided generative implicit model (ShadeGAN) to address the aforementioned ambiguity. In particular, ShadeGAN learns more accurate 3D shapes by explicitly modeling shading, i.e., the interaction of illumination and shape. We believe that an accurate 3D shape should look realistic not only from different viewpoints, but also under different lighting conditions, i.e., satisfying the "multi-lighting constraint". This idea shares similar intuition with photometric stereo [7], which shows that accurate surface normal could be recovered from images taken under different lighting conditions. Note that the multi-lighting constraint is feasible as real-world images used for training are often taken under various lighting conditions. To fulfill this constraint, ShadeGAN takes a relightable color field as the intermediate representation, which approximates the albedo but does not necessarily satisfy viewpoint independence. The color field is shaded under a randomly sampled lighting condition during rendering. Since image appearance via such a shading process is strongly dependent on surface normals, inaccurate 3D shape representations will be much more clearly revealed than in earlier shading-agnostic generative models. Hence, by satisfying the multi-lighting constraint, ShadeGAN is encouraged to infer more accurate 3D shapes as shown in Fig.1 (b).
|
| 21 |
+
|
| 22 |
+
The above shading process requires the calculation of the normal direction via back-propagation through the generator, and such calculation needs to be repeated dozens of times for a pixel in volume rendering [4, 5], introducing additional computational overhead. Existing efficient volume rendering techniques [8, 9, 10, 11, 12] mainly target static scenes, and could not be directly applied to generative models due to their dynamic nature. Therefore, to improve the rendering speed of ShadeGAN, we formulate an efficient surface tracking network to estimate the rendered object surface conditioned on the latent code. This enables us to save rendering computations by just querying points near the predicted surface, leading to $24 \%$ and $48 \%$ reduction of training and inference time without affecting the quality of rendered images.
|
| 23 |
+
|
| 24 |
+
Comprehensive experiments are conducted across multiple datasets to verify the effectiveness of ShadeGAN. The results show that our approach is capable of synthesizing photorealistic images while capturing more accurate underlying 3D shapes than previous generative methods. The learned distribution of 3D shapes enables various downstream tasks like 3D shape reconstruction, where our approach significantly outperforms other baselines on the BFM dataset [13]. Besides, modeling the shading process enables explicit control over lighting conditions, achieving image relighting effect. Our contributions can be summarized as follows: 1) We address the shape-color ambiguity in existing 3D-aware image synthesis methods with a shading-guided generative model that satisfies the proposed multi-lighting constraint. In this way, ShadeGAN is able to learn more accurate 3D shapes for better image synthesis. 2) We devise an efficient rendering technique via surface tracking, which significantly saves training and inference time for volume rendering-based generative models. 3) We show that ShadeGAN learns to disentangle shading and color that well approximates the albedo, achieving natural relighting effects in image synthesis.
|
| 25 |
+
|
| 26 |
+
# 2 Related Work
|
| 27 |
+
|
| 28 |
+
Neural volume rendering. Starting from the seminal work of neural radiance fields (NeRF) [6], neural volume rendering has gained much popularity in representing 3D scenes and synthesizing novel views. By integrating coordinate-based neural networks with volume rendering, NeRF performs high-fidelity view synthesis in a 3D consistent manner. Several attempts have been proposed to extend or improve NeRF. For instance, [14, 15, 16] further model illumination, and learn to disentangle reflectance with shading given well-aligned multi-view and multi-lighting images. Besides, many studies accelerate the rendering of static scenes from the perspective of spatial sparsity [8, 9], architectural design [10, 11], or efficient rendering [17, 12]. However, it is not trivial to apply these illumination and acceleration techniques to volume rendering-based generative models [5, 4], as they typically learn from unposed and unpaired images, and represent dynamic scenes that change with respect to the input latent codes.
|
| 29 |
+
|
| 30 |
+
In this work, we take the first attempt to model illumination in volume rendering-based generative models, which serves as a regularization for accurate 3D shape learning. We further devise an efficient rendering technique for our approach, which shares similar insight with [12], but does not rely on ground truth depth for training and it is not limited to a small viewpoint range.
|
| 31 |
+
|
| 32 |
+
Generative 3D-aware image synthesis. Generative adversarial networks (GANs) [18] are capable of generating photorealistic images of high-resolution, but lack explicit control over camera viewpoint. In order to enable them to synthesis images in a 3D-aware manner, many recent approaches investigate how 3D representations could be incorporated into GANs [19, 20, 21, 22, 23, 24, 25, 26, 27, 5, 4, 28, 29, 30]. While some works directly learn from 3D data [19, 20, 21, 22, 30], in this work we focus on approaches that only have access to unconstrained 2D images, which is a more practical setting. Several attempts [23, 24, 25] adopt 3D voxel features with learned neural rendering. These methods produce realistic 3D-aware synthesis, but the 3D voxels are not interpretable, i.e., they cannot be transferred to 3D shapes. By leveraging differentiable renderer, [26] and [27] learn interpretable 3D voxels and meshes respectively, but [26] suffers from limited visual quality due to low voxel resolution while the learned 3D shapes of [27] exhibit noticeable distortions. The success of NeRF has motivated researchers to use radiance fields as the intermediate 3D representation in GANs [5, 4, 28]. While achieving impressive 3D-aware image synthesis with multi-view consistency, the extracted 3D shapes of these approaches are often imprecise and noisy. Our main goal in this work is to address the inaccurate shape by explicitly modeling illumination in the rendering process. This innovation helps achieve better 3D-aware image synthesis with broader applications.
|
| 33 |
+
|
| 34 |
+
Unsupervised 3D shape learning from 2D images. Our work is also related to unsupervised approaches that learn 3D object shapes from unconstrained, monocular view 2D images. While several approaches use external 3D shape templates or 2D key-points as weak supervisions to facilitate learning [31, 32, 33, 34, 35, 36, 37], in this work we consider the harder setting where only 2D images are available. To tackle this problem, most approaches adopt an “analysis-by-synthesis” paradigm [38, 39, 40]. Specifically, they design photo-geometric autoencoders to infer the 3D shape and viewpoint of each image with a reconstruction loss. While succeed in learning the 3D shapes for some object categories, these approaches typically rely on certain regularization to prevent trivial solutions, like the commonly used symmetry assumption on object shapes [39, 40, 31, 32]. Such assumption tends to produce symmetric results that may overlook the asymmetric aspects of objects. Recently, GAN2Shape [41] shows that it is possible to recover 3D shapes for images generated by 2D GANs. This method, however, requires inefficient instance-specific training, and recovers depth maps instead of full 3D representations.
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 2: Method overview. Our generator $g _ { \theta }$ models a relightable color field conditioned on a latent code $z \sim p _ { z }$ . To synthesis an image, it performs volume rendering under a random camera pose $\xi \sim p _ { \xi }$ . The rendering process also performs shading with a randomly sampled lighting condition $\mu \sim p _ { \mu }$ . The discriminator learns to distinguish the synthesized images with real images from the training dataset, and the whole model is trained with a GAN loss. Although our model is trained from unconstrained 2D images, it allows explicit control over camera pose and lighting condition during inference.
|
| 38 |
+
|
| 39 |
+
The proposed 3D-aware generative model also serves as a powerful approach for unsupervised 3D shape learning. Compared with aforementioned autoencoder-based methods, our GAN-based approach avoids the need to infer the viewpoint of each image, and does not rely on strong regularizations. In experiments, we demonstrate superior performance over recent state-of-the-art approaches Unsup3d [39] and GAN2Shape [41].
|
| 40 |
+
|
| 41 |
+
# 3 Methodology
|
| 42 |
+
|
| 43 |
+
We consider the problem of 3D-aware image synthesis by learning from a collection of unconstrained and unlabeled 2D images. We argue that modeling shading, i.e., the interaction of illumination and shape, in a generative implicit model enables unsupervised learning of more accurate 3D object shapes. In the following, we first provide some preliminaries on neural radiance fields (NeRF) [6], and then introduce our shading-guided generative implicit model.
|
| 44 |
+
|
| 45 |
+
# 3.1 Preliminaries on Neural Radiance Fields
|
| 46 |
+
|
| 47 |
+
As a deep implicit model, NeRF [6] uses an MLP network to represent a 3D scene as a radiance field. The MLP $f _ { \theta } : ( x , d ) ( \sigma , c )$ takes a 3D coordinate $\pmb { x } \in \mathbb { R } ^ { 3 }$ and a viewing direction $\ b { d } \in \mathbb { S } ^ { 2 }$ as inputs, and outputs a volume density $\sigma \in \mathbb { R } ^ { + }$ and a color $c \in \mathbb { R } ^ { 3 }$ . To render an image under a given camera pose, each pixel color $C$ of the image is obtained via volume rendering along its corresponding camera ray $\bar { \boldsymbol { r } ( t ) } = \boldsymbol { o } + t \boldsymbol { d }$ with near and far bounds $t _ { n }$ and $t _ { f }$ as below:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
C ( r ) = \int _ { t _ { n } } ^ { t _ { f } } T ( t ) \sigma ( r ( t ) ) c ( r ( t ) , d ) d t , { \mathrm { ~ w h e r e ~ } } T ( t ) = \exp ( - \int _ { t _ { n } } ^ { t } \sigma ( r ( s ) ) d s ) .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
In practice, this volume rendering is implemented with a discretized form using stratified and hierarchical sampling. As this rendering process is differentiable, NeRF could be directly optimized via posed images of a static scene. After training, NeRF allows the rendering of images under new camera poses, achieving high-quality novel view synthesis.
|
| 54 |
+
|
| 55 |
+
# 3.2 Shading-Guided Generative Implicit Model
|
| 56 |
+
|
| 57 |
+
In this work, we are interested in developing a generative implicit model that explicitly models the shading process for 3D-aware image synthesis. To achieve this, we make two extensions to the MLP network in NeRF. First, similar to most deep generative models, it is further conditioned on a latent code $_ z$ sampled from a prior distribution $\bar { \mathcal { N } ( 0 , I ) } ^ { d }$ . Second, instead of directly outputting the color $^ c$ , it outputs a relightable pre-cosine color term $\pmb { a } \in \mathbb { R } ^ { 3 }$ , which is conceptually similar to albedo in the way that it could be shaded under a given lighting condition. While albedo is viewpoint-independent, in this work we do not strictly enforce such independence for $\textbf { \em a }$ in order to account for dataset bias. Thus, our generator $g _ { \theta } : ( x , \dot { d } , z ) ( \sigma , \pmb { a } )$ takes a coordinate $_ { \textbf { \em x } }$ , a viewing direction $^ d$ , and a latent code $_ z$ as inputs, and outputs a volume density $\sigma$ and a pre-cosine color $\textbf { \em a }$ . Note that here $\sigma$ is independent of $^ d$ , while the dependence of $\textbf { \em a }$ on $^ d$ is optional. To obtain the color $C$ of a camera ray $\mathbf { \boldsymbol { r } } ( t ) \mathbf { \dot { \alpha } } = \mathbf { \boldsymbol { o } } + t \mathbf { \dot { \alpha } }$ with near and far bounds $t _ { n }$ and $t _ { f }$ , we calculate the final pre-cosine color $\pmb { A }$ via:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
A ( r , z ) = \int _ { t _ { n } } ^ { t _ { f } } T ( t , z ) \sigma ( r ( t ) , z ) a ( r ( t ) , d , z ) d t , { \mathrm { ~ w h e r e ~ } } T ( t , z ) = \exp ( - \int _ { t _ { n } } ^ { t } \sigma ( r ( s ) , z ) d s ) .
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
We also calculate the normal direction $\textbf { \em n }$ with:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
n ( r , z ) = \hat { n } ( r , z ) / \| \hat { n } ( r , z ) \| _ { 2 } , \mathrm { ~ w h e r e ~ } \hat { n } ( r , z ) = - \int _ { t _ { n } } ^ { t _ { f } } T ( t , z ) \sigma ( r ( t ) , z ) \nabla _ { r ( t ) } \sigma ( r ( t ) , z ) d t ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\nabla _ { \pmb { r } ( t ) } \sigma ( \pmb { r } ( t ) , \pmb { z } )$ is the derivative of volume density $\sigma$ with respect to its input coordinate, which naturally captures the local normal direction, and could be calculated via back-propagation. Then the final color $C$ is obtained via Lambertian shading as:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
C ( \boldsymbol { r } , z ) = A ( r , z ) ( k _ { a } + k _ { d } \mathrm { m a x } ( 0 , \boldsymbol { l } \cdot \boldsymbol { n } ( r , z ) ) ) ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $\ b { l } \in \mathbb S ^ { 2 }$ is the lighting direction, $k _ { a }$ and $k _ { d }$ are the ambient and diffuse coefficients. We provide more discussions on this shading formulation at the end of this subsection.
|
| 76 |
+
|
| 77 |
+
Camera and Lighting Sampling. Eq.(2 - 4) describe the process of rendering a pixel color given a camera ray $\mathbf { } _ { \pmb { r } ( t ) }$ and a lighting condition $\mu = ( l , k _ { a } , k _ { d } )$ . Generating a full image $\pmb { I _ { g } } \in \mathbb { R } ^ { 3 \times H \times W }$ requires one to sample a camera pose $\boldsymbol { \xi }$ and a lighting condition $\pmb { \mu }$ in addition to the latent code $_ z$ i.e., $I _ { g } = G _ { \theta } ( z , \xi , \mu )$ . In our setting, the camera pose $\boldsymbol { \xi }$ could be described by pitch and yaw angles, and is sampled from a prior Gaussian or uniform distribution $p _ { \xi }$ , as also done in previous works [4, 5]. Sampling the camera pose randomly during training would motivate the learned 3D scene to look realistic from different viewpoints. While this multi-view constraint is beneficial for learning a valid 3D representation, it is often insufficient to infer the accurate 3D object shape. Thus, in our approach, we further introduce a multi-lighting constraint by also randomly sampling a lighting condition $\pmb { \mu }$ from a prior distribution $p _ { \mu }$ . In practice, $p _ { \mu }$ could be estimated from the dataset using existing approaches like [39]. We also show in our experiments that a simple and manually tuned prior distribution could also produce reasonable results. As the shading process is sensitive to the normal direction due to the diffuse term $k _ { d } \mathrm { m a x } ( 0 , l \cdot n ( r , z ) )$ in Eq.(4), this multi-lighting constraint would regularize the model to learn more accurate 3D shapes that produce natural shading, as shown in Fig.1 (b).
|
| 78 |
+
|
| 79 |
+
Training. Our generative model follows the paradigm of GANs [18], where the generator is trained together with a discriminator $D$ with parameters $\phi$ in an adversarial manner. During training, the generator generates fake images $I _ { g } = \bar { G } _ { \theta } ( z , \xi , \mu )$ by sampling the latent code $_ z$ , camera pose $\boldsymbol { \xi }$ and lighting condition $\pmb { \mu }$ from their corresponding prior distributions $p _ { z } , p _ { \xi }$ , and $p _ { \mu }$ . Let $\pmb { I }$ denotes real images sampled from the data distribution $p _ { I }$ . We train our model with a non-saturating GAN loss with $R _ { 1 }$ regularization [42]:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { r } { \mathcal { L } ( \theta , \phi ) = \mathbf { E } _ { z \sim p _ { z } , \xi \sim p _ { \xi } , \mu \sim p _ { \mu } } \left[ f \Big ( D _ { \phi } ( G _ { \theta } ( z , \xi , \mu ) ) \Big ) \right] + \mathbf { E } _ { I \sim p _ { \mathcal { D } } } \left[ f ( - D _ { \phi } ( I ) ) + \lambda \| \nabla D _ { \phi } ( I ) \| ^ { 2 } \right] , } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $f ( u ) = - \log ( 1 + \exp ( - u ) )$ , and $\lambda$ controls the strength of regularization. More implementation details are provided in the supplementary material.
|
| 86 |
+
|
| 87 |
+
Discussion. Note that in $\operatorname { E q . } ( 2 \ \cdot \ 4 )$ , we perform shading after $\pmb { A }$ and $\textbf { \em n }$ are obtained via volume rendering. An alternative way is to perform shading at each local spatial point as $\begin{array} { l l l } { c ( { \boldsymbol { r } } ( t ) , d , z ) } & { = } & { { \boldsymbol { a } } ( { \boldsymbol { r } } ( t ) , d , z ) ( k _ { a } + { k _ { d } } { \operatorname* { m a x } } ( 0 , { l } \cdot { \boldsymbol { n } } ( { \boldsymbol { r } } ( t ) , z ) ) ) } \end{array}$ , where $n ( r ( t ) , { \bar { z } } ) =$ $- \nabla _ { \pmb { r } ( t ) } \sigma ( \pmb { r } ( t ) , z ) / \| \nabla _ { \pmb { r } ( t ) } \sigma ( \pmb { r } ( t ) , z ) \| _ { 2 }$ is the local normal. Then we could perform volume rendering using $\mathbf { } c ( \pmb { r } ( t ) , z )$ to get the final pixel color. In practice, we observe that this formulation obtains suboptimal results. An intuitive reason is that in this formulation, the normal direction is normalized at each local point, neglecting the magnitude of $\nabla _ { \pmb { r } ( t ) } \sigma ( \pmb { r } ( t ) , \pmb { z } )$ , which tends to be larger near the object surfaces. We provide more analysis in experiments and the supplementary material.
|
| 88 |
+
|
| 89 |
+
The Lambertian shading we used is an approximation to the real illumination scenario. While serving as a good regularization for improving the learned 3D shape, it could possibly introduce an additional gap between the distribution of generated images and that of real images. To compensate for such risk, we could optionally let the predicted $\textbf { \em a }$ be conditioned on the lighting condition, i.e., $\pmb { a } = \pmb { a } ( \pmb { r } ( t ) , \pmb { d } , \pmb { \mu } , z )$ . Thus, in cases where the lighting condition deviates from the real data distribution, the generator could learn to adjust the value of $\textbf { \em a }$ and reduce the aforementioned gap. We show the benefit of this design in the experiments.
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
Figure 3: (a) Conventional volume rendering samples dozens of points within a predefined near and far bounds $t _ { n }$ and $t _ { f }$ . (b) We propose an efficient volume rendering technique via surface tracking. Before rendering, our surface tracking network $S _ { \psi }$ predicts an initial guess of the surface position $s$ conditioned on the latent code $_ z$ and camera pose $\xi$ . Then we sample points near $s$ , which requires fewer samples. Finally, we use the volume rendered depth $d$ as the ground truth to train $S _ { \psi }$ . During training, $S _ { \psi }$ is able to predict depth $s$ that well approximates the real surface depth $d$ .
|
| 93 |
+
|
| 94 |
+
# 3.3 Efficient Volume Rendering via Surface Tracking
|
| 95 |
+
|
| 96 |
+
Similar to NeRF, we implement volume rendering with a discretized integral, which typically requires to sample dozens of points along a camera ray, as shown in Fig. 3 (a). In our approach, we also need to perform back-propagation across the generator in Eq.(3) to get the normal direction for each point, which introduces additional computational cost. To achieve more efficient volume rendering, a natural idea is to exploit spatial sparsity. Usually, the weight $T ( t , z ) \sigma ( \pmb { r } ( t ) , z )$ in volume rendering would concentrate on the object surface position during training. Thus, if we know the rough surface position before rendering, we could sample points near the surface to save computation. While for a static scene it is possible to store such spatial sparsity in a sparse voxel grid [8, 9], this technique cannot be directly applied to our generative model, as the 3D scene keeps changing with respect to the input latent code.
|
| 97 |
+
|
| 98 |
+
To achieve more efficient volume rendering in our generative implicit model, we further propose a surface tracking network $S$ that learns to mimic the surface position conditioned on the latent code. In particular, the volume rendering naturally allows the depth estimation of the object surface via:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
t _ { s } ( \pmb { r } , z ) = \int _ { t _ { n } } ^ { t _ { f } } T ( t , z ) \sigma ( \pmb { r } ( t ) , z ) t d t ,
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
where $T ( t , z )$ is defined the same way as in Eq.(2). Thus, given a camera pose $\boldsymbol { \xi }$ and a latent code $_ z$ , we could render the full depth map $\pmb { t } _ { s } ( z , \pmb { \xi } )$ . As shown in Fig. 3 (b), we mimic $\pmb { t } _ { s } ( z , \pmb { \xi } )$ with the surface tracking network $S _ { \psi }$ , which is a light-weighted convolutional neural network that takes $z , \xi$ as inputs and outputs a depth map. The depth mimic loss is:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\mathcal { L } ( \psi ) = \mathbf { E } _ { z \sim p _ { z } , \xi \sim p _ { \xi } } \left[ \| S _ { \psi } ( z , \xi ) - t _ { s } ( z , \xi ) \| _ { 1 } + \operatorname* { P r e c } ( S _ { \psi } ( z , \xi ) , t _ { s } ( d ( z , \xi ) ) \right] ,
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where Prec is the perceptual loss that motivates $S _ { \psi }$ to better capture edges of the surface.
|
| 111 |
+
|
| 112 |
+
During training, $S _ { \psi }$ is optimized jointly with the generator and the discriminator. Thus, each time after we sample a latent code $_ z$ and a camera pose $\boldsymbol { \xi }$ , we can get an initial guess of the depth map as $S _ { \psi } ( z , \pmb { \xi } )$ . Then for a pixel with predicted depth $s$ , we could perform volume rendering in Eq.(2,3,6) with near bound $t _ { n } = s - \Delta _ { i } / 2$ and far bound $t _ { f } = s + \Delta _ { i } / 2$ , where $\Delta _ { i }$ is the interval for volume rendering that decreases as the training iteration $i$ grows. Specifically, we start with a large interval $\Delta _ { m a x }$ and decrease to $\Delta _ { m i n }$ with an exponential schedule. As $\Delta _ { i }$ decreases, the number of points used for rendering $m$ also decreases accordingly. Note that the computational cost of our efficient surface tracking network is marginal compared to the generator, as the former only needs a single forward pass to render an image while the latter will be queried for $H \times W \times m$ times. Thus, the reduction of $m$ would significantly accelerate the training and inference speed for ShadeGAN.
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
Figure 4: Qualitative comparison on BFM (top), CelebA (middle), and Cats (bottom) datasets. "Albedo" refers to the pre-cosine color that approximates albedo. Our approach synthesizes more accurate 3D shapes than pi-GAN and GRAF, and also learns to disentangle shading with albedo.
|
| 116 |
+
|
| 117 |
+
# 4 Experiments
|
| 118 |
+
|
| 119 |
+
In this section, we evaluate the proposed ShadeGAN on 3D-aware image synthesis. We also show that ShadeGAN learns much more accurate 3D shapes than previous methods, and in the meantime allows explicit control over lighting conditions. The datasets used include CelebA [43], BFM [13], and Cats [44], all of which contain only unconstrained 2D RGB images.
|
| 120 |
+
|
| 121 |
+
Implementation. In terms of model architectures, we adopt a SIREN-based MLP [45] as the generator and a convolutional neural network as the discriminator following [4]. For the prior distribution of lighting conditions, we use Unsup3d [39] to estimate the lighting conditions of real data and subsequently fit a multivariate Gaussian distribution of $\pmb { \mu } = ( l , k _ { a } , k _ { d } )$ as the prior. A hand-crafted prior distribution is also included in the ablation study. In quantitative study, we let the pre-cosine color $\textbf { \em a }$ be conditioned on the lighting condition $\pmb { \mu }$ as well as the viewing direction $^ d$ unless otherwise stated. In qualitative study, we observe that removing view conditioning achieves slightly better 3D shapes for CelebA and BFM datasets. Thus, we show results without view conditioning for these two datasets in the main paper, and put those with view conditioning in Fig. 4 of the supplementary material. Other implementation details are also provided in the supplementary.
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 5: Generated face images and their 3D meshes.
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 6: Qualitative ablation. See the main text for discussions.
|
| 128 |
+
|
| 129 |
+
Table 1: Comparisons on the BFM dataset. We report FID $\mathsf { \bar { \rho } _ { 1 2 8 } } 2 \mathsf { \bar { \rho } _ { 1 } }$ for image synthesis, and SIDE $\bar { ( } \times 1 0 ^ { - 2 } )$ and MAD (deg.) for the accuracy of 3D shapes. ‘-’ indicates not available. Results of pi-GAN and Ours are averaged over 5 runs.
|
| 130 |
+
|
| 131 |
+
<table><tr><td>Method</td><td>FID↓</td><td>SIDE↓</td><td>MAD↓</td></tr><tr><td>Supervised</td><td>-</td><td>0.410</td><td>10.78</td></tr><tr><td>Unsup3d [39]</td><td>-</td><td>0.793</td><td>16.51</td></tr><tr><td>GAN2Shape [41]</td><td>-</td><td>0.756</td><td>14.81</td></tr><tr><td>GRAF[5]</td><td>53.4</td><td>1.857</td><td>26.60</td></tr><tr><td>pi-GAN [4]</td><td>16.7±0.2</td><td>0.727±0.012</td><td>20.09±0.23</td></tr><tr><td>Ours</td><td>17.7±0.2</td><td>0.607±0.007</td><td>14.52±0.11</td></tr></table>
|
| 132 |
+
|
| 133 |
+
Table 2: Comparisons on the CelebA and Cats datasets. The image resolution is $1 2 8 ^ { 2 }$ .
|
| 134 |
+
|
| 135 |
+
<table><tr><td>Dataset</td><td>Method FID↓</td><td>MAD↓</td></tr><tr><td rowspan="3">CelebA</td><td>GRAF</td><td>43.0 30.48</td></tr><tr><td>pi-GAN 15.7</td><td>27.22</td></tr><tr><td>Ours 16.2</td><td>20.49</td></tr><tr><td rowspan="3">Cats</td><td>GRAF</td><td>30.3 65.47</td></tr><tr><td>pi-GAN</td><td>10.7 33.48</td></tr><tr><td>Ours 10.3</td><td>25.47</td></tr></table>
|
| 136 |
+
|
| 137 |
+
Comparison with baselines. We compare ShadeGAN with two state-of-the-art generative implicit models, namely GRAF [5] and pi-GAN [4]. Specifically, Fig. 4 includes both synthesized images as well as their corresponding 3D meshes, which are obtained by performing marching cubes on the volume density $\sigma$ . While GRAF and pi-GAN could synthesize images with controllable poses, their learned 3D shapes are inaccurate and noisy. In contrast, our approach not only synthesizes photorealistic 3D-consistent images, but also learns much more accurate 3D shapes and surface normals, indicating the effectiveness of the proposed multi-lighting constraint as a regularization. More synthesized images and their corresponding shapes are included in Fig.5. Besides more accurate 3D shapes, ShadeGAN can also learn the albedo and diffuse shading components inherently. As shown in Fig. 4, although not perfect, ShadeGAN has managed to disentangle shading and albedo with satisfying quality, as such disentanglement is a natural solution to the multi-lighting constraint.
|
| 138 |
+
|
| 139 |
+
The quality of learned 3D shapes is quantitatively evaluated on the BFM dataset. Specifically, we use each of the generative implicit models to generate 50k images and their corresponding depth maps. Image-depth pairs from each model are used as training data to train an additional convolutional neural network (CNN) that learns to predict the depth map of an input image. We then test each trained CNN on the BFM test set and compare its predictions to the ground-truth depth maps as a measurement of the quality of learned 3D shapes. Following [39], we report the scale-invariant depth error (SIDE) and mean angle deviation (MAD) metrics. The results are included in Tab. 1, where ShadeGAN significantly outperforms GRAF and pi-GAN. Besides, ShadeGAN also outperforms other advanced unsupervised 3D shape learning approaches including Unsup3d [39] and GAN2Shape [41], demonstrating its large potential in unsupervised 3D shapes learning. In terms of image quality, Tab. 1 includes the FID [46] scores of images synthesized by different models, where the FID score of ShadeGAN is slightly inferior to pi-GAN in BFM and CelebA. Intuitively, this is caused by the gap between our approximated shading (i.e. Lambertian shading) and the real illumination, which can be potentially avoided by adopting more realistic shading models and improving the lighting prior.
|
| 140 |
+
|
| 141 |
+
In Tab. 2, we also show the quantitative results of different models on CelebA and Cats. To evaluate the learned shape, we use each generative implicit model to generate 2k front-view images and their corresponding depth maps. While these datasets do not have ground truth depth, we report MAD obtained by testing pretrained Unsup3d models [39] on these generated image-depth pairs as a reference. As we can observe, results on CelebA and Cat are consistent with those on the BFM dataset.
|
| 142 |
+
|
| 143 |
+
Table 3: Ablation study on the BFM dataset.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>No.</td><td>Method</td><td>FID↓</td><td>SIDE↓</td><td>MAD</td></tr><tr><td>(1)</td><td>ShadeGAN</td><td>17.7</td><td>0.607</td><td>14.52</td></tr><tr><td>(2)</td><td>local shading</td><td>30.1</td><td>0.754</td><td>18.18</td></tr><tr><td>(3)</td><td>w/o light</td><td>19.2</td><td>0.618</td><td>14.53</td></tr><tr><td>(4)</td><td>w/o view</td><td>18.6</td><td>0.622</td><td>14.88</td></tr><tr><td>(5)</td><td>manual prior</td><td>20.2</td><td>0.643</td><td>15.38</td></tr><tr><td>(6)</td><td>+efficient</td><td>18.2</td><td>0.673</td><td>14.72</td></tr></table>
|
| 146 |
+
|
| 147 |
+
Table 4: Training and inference time cost on CelebA. The efficient volume rendering significantly improves training and inference speed.
|
| 148 |
+
|
| 149 |
+
<table><tr><td>Method</td><td>Train (h) Inference (s) FID</td></tr><tr><td>ShadeGAN</td><td>92.3 0.343</td></tr><tr><td>70.2</td><td>16.4 0.179 16.2</td></tr><tr><td>+efficient pi-GAN</td><td></td></tr><tr><td>56.8</td><td>0.204 15.7</td></tr><tr><td>+efficient 46.9</td><td>0.114 15.9</td></tr></table>
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 7: Visualization of depths predicted by our depth tracking network and those calculated via volume rendering.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 8: Illumination-aware image synthesis. ShadeGAN allows explicit control over the lighting. The pre-cosine color (albedo) is independent of lighting in (a) and is conditioned on lighting in (b). We show results of adding a specular term in (c).
|
| 156 |
+
|
| 157 |
+
Ablation studies. We further study the effects of several design choices in ShadeGAN. First, we perform local points-specific shading as mentioned in the discussion of Sec. 3.2. As Tab. 3 No.(2) and Fig. 6 (b) show, the results of such a local shading strategy are notably worse than the original one, which indicates that taking the magnitude of $\nabla _ { \pmb { x } } \sigma$ into account is beneficial. Besides, the results of Tab. 3 No.(3) and No.(4) imply that removing $\textbf { \em a }$ ’s dependence on the lighting $\pmb { \mu }$ or the viewpoint $^ d$ could lead to a slight performance drop. The results of using a simple manually tuned lighting prior are provided in Tab. 3 No.(5) and Fig. 6 (c), which are only moderately worse than the results of using a data-driven prior, and the generated shapes are still significantly better than the ones produced by existing approaches.
|
| 158 |
+
|
| 159 |
+
To verify the effectiveness of the proposed efficient volume rendering technique, we include its effects on image quality and training/inference time in Tab. 3 No.(6) and Tab. 4. It is observed that the efficient volume rendering has marginal effects on the performance, but significantly reduces the training and inference time by $24 \%$ and $48 \%$ for ShadeGAN. Moreover, in Fig. 7 we visualize the depth maps predicted by our surface tracking network and those obtained via volume rendering. It is shown that under varying identities and camera poses, the surface tracking network could consistently predict depth values that are quite close to the real surface positions, so that we can sample points near the predicted surface for rendering without sacrificing image quality.
|
| 160 |
+
|
| 161 |
+
Illumination-aware image synthesis. As ShadeGAN models the shading process, it by design allows explicit control over the lighting condition. We provide such illumination-aware image synthesis results in Fig.8, where ShadeGAN generates promising images under different lighting directions. We also show that in cases where the predicted $\textbf { \em a }$ is conditioned on the lighting condition $\pmb { \mu }$ , $\textbf { \em a }$ would slightly change $w . r . t .$ the lighting condition, e.g., it would be brighter in areas having a overly dim shading in order to make the final image more natural. Besides, we could optionally add a specular term $k _ { s } \operatorname* { m a x } ( 0 , \boldsymbol { h } \cdot \boldsymbol { n } ) ^ { p }$ in Eq. 4 (i.e., Blinn-Phong shading [47], where $^ { h }$ is the bisector of the angle between the viewpoint and the lighting direction) to create specular highlight effects, as shown in Fig.8 (c).
|
| 162 |
+
|
| 163 |
+
GAN inversion. ShadeGAN could also be used to reconstruct a given target image by performing GAN inversion. As shown in Fig. 9 such inversion allows us to obtain several factors of the image, including the 3D shape, surface normal, approximated albedo, and shading. Besides, we can further perform view synthesis and relighting by changing the viewpoint and lighting condition. The implementation of GAN inversion is provided in the supplementary material.
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 9: GAN inversion for real image editing.
|
| 167 |
+
|
| 168 |
+
Discussions. As the Lambertian shading we used is an approximation to the real illumination, the albedo learned by ShadeGAN is not perfectly disentangled. Our approach does not consider the spatially-varying material properties of objects as well. In the future, we intend to incorporate more sophisticated shading models to learn better disentangled generative reflectance fields.
|
| 169 |
+
|
| 170 |
+
# 5 Conclusion
|
| 171 |
+
|
| 172 |
+
In this work, we present ShadeGAN, a new generative implicit model for shape-accurate 3D-aware image synthesis. We have shown that the multi-lighting constraint, achieved in ShadeGAN by explicit illumination modeling, significantly helps learning accurate 3D shapes from 2D images. ShadeGAN also allows us to control the lighting condition during image synthesis, achieving natural image relighting effects. To reduce the computational cost, we have further devised a light-weighted surface tracking network, which enables an efficient volume rendering technique for generative implicit models, achieving significant acceleration on both training and inference speed. A generative model with shape-accurate 3D representation could broaden its applications in vision and graphics, and our work has taken a solid step towards this goal.
|
| 173 |
+
|
| 174 |
+
Acknowledgment. We would like to thank Eric R. Chan for sharing the codebase of pi-GAN. This study is supported under the ERC Consolidator Grant 4DRepLy (770784). This study is also supported under the RIE2020 Industry Alignment Fund – Industry Collaboration Projects (IAF-ICP) Funding Initiative, as well as cash and in-kind contribution from the industry partner(s).
|
| 175 |
+
|
| 176 |
+
# References
|
| 177 |
+
|
| 178 |
+
[1] T. Karras, S. Laine, and T. Aila, “A style-based generator architecture for generative adversarial networks,” in CVPR, 2019.
|
| 179 |
+
[2] T. Karras, S. Laine, M. Aittala, J. Hellsten, J. Lehtinen, and T. Aila, “Analyzing and improving the image quality of stylegan,” in CVPR, 2020.
|
| 180 |
+
[3] A. Brock, J. Donahue, and K. Simonyan, “Large scale gan training for high fidelity natural image synthesis,” in ICLR, 2019.
|
| 181 |
+
[4] E. R. Chan, M. Monteiro, P. Kellnhofer, J. Wu, and G. Wetzstein, “pi-gan: Periodic implicit generative adversarial networks for 3d-aware image synthesis,” in CVPR, 2021.
|
| 182 |
+
[5] K. Schwarz, Y. Liao, M. Niemeyer, and A. Geiger, “Graf: Generative radiance fields for 3d-aware image synthesis,” in NeurIPS, 2020.
|
| 183 |
+
[6] B. Mildenhall, P. P. Srinivasan, M. Tancik, J. T. Barron, R. Ramamoorthi, and R. Ng, “Nerf: Representing scenes as neural radiance fields for view synthesis,” in ECCV, 2020.
|
| 184 |
+
[7] R. J. Woodham, “Photometric method for determining surface orientation from multiple images,” Optical engineering, vol. 19, no. 1, p. 191139, 1980.
|
| 185 |
+
[8] L. Liu, J. Gu, K. Zaw Lin, T.-S. Chua, and C. Theobalt, “Neural sparse voxel fields,” in NeurIPS, 2020.
|
| 186 |
+
[9] A. Yu, R. Li, M. Tancik, H. Li, R. Ng, and A. Kanazawa, “PlenOctrees for real-time rendering of neural radiance fields,” in arXiv, 2021.
|
| 187 |
+
[10] C. Reiser, S. Peng, Y. Liao, and A. Geiger, “Kilonerf: Speeding up neural radiance fields with thousands of tiny mlps,” arXiv preprint arXiv:2103.13744, 2021.
|
| 188 |
+
[11] S. J. Garbin, M. Kowalski, M. Johnson, J. Shotton, and J. Valentin, “Fastnerf: High-fidelity neural rendering at 200fps,” arXiv preprint arXiv:2103.10380, 2021.
|
| 189 |
+
[12] T. Neff, P. Stadlbauer, M. Parger, A. Kurz, C. R. A. Chaitanya, A. Kaplanyan, and M. Steinberger, “Donerf: Towards real-time rendering of neural radiance fields using depth oracle networks,” arXiv preprint arXiv:2103.03231, 2021.
|
| 190 |
+
[13] P. Paysan, R. Knothe, B. Amberg, S. Romdhani, and T. Vetter, “A 3d face model for pose and illumination invariant face recognition,” in 2009 Sixth IEEE International Conference on Advanced Video and Signal Based Surveillance, Ieee, 2009.
|
| 191 |
+
[14] M. Boss, R. Braun, V. Jampani, J. T. Barron, C. Liu, and H. Lensch, “Nerd: Neural reflectance decomposition from image collections,” arXiv preprint arXiv:2012.03918, 2020.
|
| 192 |
+
[15] S. Bi, Z. Xu, P. Srinivasan, B. Mildenhall, K. Sunkavalli, M. Hašan, Y. Hold-Geoffroy, D. Kriegman, and R. Ramamoorthi, “Neural reflectance fields for appearance acquisition,” arXiv preprint arXiv:2008.03824, 2020.
|
| 193 |
+
[16] P. P. Srinivasan, B. Deng, X. Zhang, M. Tancik, B. Mildenhall, and J. T. Barron, “Nerv: Neural reflectance and visibility fields for relighting and view synthesis,” in CVPR, 2021.
|
| 194 |
+
[17] D. B. Lindell, J. N. Martel, and G. Wetzstein, “Autoint: Automatic integration for fast neural volume rendering,” arXiv preprint arXiv:2012.01714, 2020.
|
| 195 |
+
[18] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio, “Generative adversarial nets,” in NIPS, 2014.
|
| 196 |
+
[19] J. Wu, C. Zhang, T. Xue, B. Freeman, and J. Tenenbaum, “Learning a probabilistic latent space of object shapes via 3d generative-adversarial modeling,” in NIPS, 2016.
|
| 197 |
+
[20] H. A. Alhaija, S. K. Mustikovela, A. Geiger, and C. Rother, “Geometric image synthesis,” in ACCV, Springer, 2018.
|
| 198 |
+
[21] X. Chen, D. Cohen-Or, B. Chen, and N. J. Mitra, “Towards a neural graphics pipeline for controllable image generation,” Computer Graphics Forum, vol. 40, no. 2, 2021.
|
| 199 |
+
[22] J.-Y. Zhu, Z. Zhang, C. Zhang, J. Wu, A. Torralba, J. Tenenbaum, and B. Freeman, “Visual object networks: Image generation with disentangled 3d representations,” in NeurIPS, 2018.
|
| 200 |
+
[23] T. Nguyen-Phuoc, C. Li, L. Theis, C. Richardt, and Y.-L. Yang, “Hologan: Unsupervised learning of 3d representations from natural images,” in ICCV, 2019.
|
| 201 |
+
[24] T. Nguyen-Phuoc, C. Richardt, L. Mai, Y.-L. Yang, and N. Mitra, “Blockgan: Learning 3d object-aware scene representations from unlabelled images,” in NeurIPS, Nov 2020.
|
| 202 |
+
[25] Y. Liao, K. Schwarz, L. Mescheder, and A. Geiger, “Towards unsupervised learning of generative models for 3d controllable image synthesis,” in CVPR, 2020.
|
| 203 |
+
[26] P. Henzler, N. J. Mitra, and T. Ritschel, “Escaping plato’s cave: 3d shape from adversarial rendering,” in ICCV, 2019.
|
| 204 |
+
[27] A. Szabó, G. Meishvili, and P. Favaro, “Unsupervised generative 3d shape learning from natural images,” arXiv preprint arXiv:1910.00287, 2019.
|
| 205 |
+
[28] M. Niemeyer and A. Geiger, “Giraffe: Representing scenes as compositional generative neural feature fields,” in CVPR, 2021.
|
| 206 |
+
[29] A. Tewari, M. Elgharib, G. Bharaj, F. Bernard, H.-P. Seidel, P. Pérez, M. Zollhofer, and C. Theobalt, “Stylerig: Rigging stylegan for 3d control over portrait images,” in CVPR, 2020.
|
| 207 |
+
[30] T. Yenamandra, A. Tewari, F. Bernard, H.-P. Seidel, M. Elgharib, D. Cremers, and C. Theobalt, “i3dmm: Deep implicit 3d morphable model of human heads,” in CVPR, 2021.
|
| 208 |
+
[31] S. Tulsiani, N. Kulkarni, and A. Gupta, “Implicit mesh reconstruction from unannotated image collections,” arXiv preprint arXiv:2007.08504, 2020.
|
| 209 |
+
[32] S. Goel, A. Kanazawa, and J. Malik, “Shape and viewpoint without keypoints,” ECCV, 2020.
|
| 210 |
+
[33] L. Tran and X. Liu, “Nonlinear 3d face morphable model,” in CVPR, 2018.
|
| 211 |
+
[34] A. Kanazawa, S. Tulsiani, A. A. Efros, and J. Malik, “Learning category-specific mesh reconstruction from image collections,” in ECCV, 2018.
|
| 212 |
+
[35] A. Kanazawa, M. J. Black, D. W. Jacobs, and J. Malik, “End-to-end recovery of human shape and pose,” in CVPR, 2018.
|
| 213 |
+
[36] S. Sanyal, T. Bolkart, H. Feng, and M. J. Black, “Learning to regress 3d face shape and expression from an image without 3d supervision,” in CVPR, 2019.
|
| 214 |
+
[37] J. Shang, T. Shen, S. Li, L. Zhou, M. Zhen, T. Fang, and L. Quan, “Self-supervised monocular 3d face reconstruction by occlusion-aware multi-view geometry consistency,” ECCV, 2020.
|
| 215 |
+
[38] M. Sahasrabudhe, Z. Shu, E. Bartrum, R. Alp Guler, D. Samaras, and I. Kokkinos, “Lifting autoencoders: Unsupervised learning of a fully-disentangled 3d morphable model using deep non-rigid structure from motion,” in ICCV Workshops, 2019.
|
| 216 |
+
[39] S. Wu, C. Rupprecht, and A. Vedaldi, “Unsupervised learning of probably symmetric deformable 3d objects from images in the wild,” in CVPR, 2020.
|
| 217 |
+
[40] X. Li, S. Liu, K. Kim, S. De Mello, V. Jampani, M.-H. Yang, and J. Kautz, “Self-supervised single-view 3d reconstruction via semantic consistency,” ECCV, 2020.
|
| 218 |
+
[41] X. Pan, B. Dai, Z. Liu, C. C. Loy, and P. Luo, “Do 2d gans know 3d shape? unsupervised 3d shape reconstruction from 2d image gans,” in ICLR, 2021.
|
| 219 |
+
[42] L. Mescheder, A. Geiger, and S. Nowozin, “Which training methods for gans do actually converge?,” in ICML, 2018.
|
| 220 |
+
[43] Z. Liu, P. Luo, X. Wang, and X. Tang, “Deep learning face attributes in the wild,” in ICCV, 2015.
|
| 221 |
+
[44] W. Zhang, J. Sun, and X. Tang, “Cat head detection-how to effectively exploit shape and texture features,” in ECCV, 2008.
|
| 222 |
+
[45] V. Sitzmann, J. Martel, A. Bergman, D. Lindell, and G. Wetzstein, “Implicit neural representations with periodic activation functions,” in NeurIPS, 2020.
|
| 223 |
+
[46] M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter, “Gans trained by a two time-scale update rule converge to a local nash equilibrium,” in NeurIPS, 2017.
|
| 224 |
+
[47] B. T. Phong, “Illumination for computer generated pictures,” Communications of the ACM, vol. 18, no. 6, pp. 311–317, 1975.
|
| 225 |
+
[48] E. Perez, F. Strub, H. De Vries, V. Dumoulin, and A. Courville, “Film: Visual reasoning with a general conditioning layer,” in AAAI, 2018.
|
| 226 |
+
[49] R. Liu, J. Lehman, P. Molino, F. P. Such, E. Frank, A. Sergeev, and J. Yosinski, “An intriguing failing of convolutional neural networks and the coordconv solution,” in NeurIPS, 2018.
|
| 227 |
+
[50] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in CVPR, 2016.
|
| 228 |
+
[51] Y. Wu and K. He, “Group normalization,” in ECCV, 2018.
|
| 229 |
+
[52] S. Ioffe and C. Szegedy, “Batch normalization: Accelerating deep network training by reducing internal covariate shift,” in ICML, 2015.
|
| 230 |
+
[53] D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980, 2014.
|
| 231 |
+
[54] “Unsup3d.” https://github.com/elliottwu/unsup3d.
|
| 232 |
+
[55] “Celeba.” http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html.
|
| 233 |
+
[56] “Cats.” https://web.archive.org/web/20150520175645/http://137.189.35.203/ WebUI/CatDatabase/catData.html.
|
| 234 |
+
[57] Y. Choi, Y. Uh, J. Yoo, and J.-W. Ha, “Stargan v2: Diverse image synthesis for multiple domains,” in CVPR, 2020.
|
md/train/piLPYqxtWuA/piLPYqxtWuA.md
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FASTSPEECH 2: FAST AND HIGH-QUALITY END-TOEND TEXT TO SPEECH
|
| 2 |
+
|
| 3 |
+
Yi Ren1∗, Chenxu $\mathbf { H } \mathbf { u } ^ { 1 }$ ∗, Xu Tan2, Tao $\mathbf { Q } \mathbf { i n } ^ { 2 }$ , Sheng Zhao3, Zhou Zhao1†, Tie-Yan Liu2
|
| 4 |
+
|
| 5 |
+
1Zhejiang University {rayeren,chenxuhu,zhaozhou}@zju.edu.cn
|
| 6 |
+
|
| 7 |
+
2Microsoft Research Asia {xuta,taoqin,tyliu}@microsoft.com
|
| 8 |
+
|
| 9 |
+
3Microsoft Azure Speech Sheng.Zhao@microsoft.com
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Non-autoregressive text to speech (TTS) models such as FastSpeech (Ren et al., 2019) can synthesize speech significantly faster than previous autoregressive models with comparable quality. The training of FastSpeech model relies on an autoregressive teacher model for duration prediction (to provide more information as input) and knowledge distillation (to simplify the data distribution in output), which can ease the one-to-many mapping problem (i.e., multiple speech variations correspond to the same text) in TTS. However, FastSpeech has several disadvantages: 1) the teacher-student distillation pipeline is complicated and time-consuming, 2) the duration extracted from the teacher model is not accurate enough, and the target mel-spectrograms distilled from teacher model suffer from information loss due to data simplification, both of which limit the voice quality. In this paper, we propose FastSpeech 2, which addresses the issues in FastSpeech and better solves the one-to-many mapping problem in TTS by 1) directly training the model with ground-truth target instead of the simplified output from teacher, and 2) introducing more variation information of speech (e.g., pitch, energy and more accurate duration) as conditional inputs. Specifically, we extract duration, pitch and energy from speech waveform and directly take them as conditional inputs in training and use predicted values in inference. We further design FastSpeech 2s, which is the first attempt to directly generate speech waveform from text in parallel, enjoying the benefit of fully end-to-end inference. Experimental results show that 1) FastSpeech 2 achieves a 3x training speed-up over FastSpeech, and FastSpeech 2s enjoys even faster inference speed; 2) FastSpeech 2 and 2s outperform FastSpeech in voice quality, and FastSpeech 2 can even surpass autoregressive models. Audio samples are available at https://speechresearch.github.io/fastspeech2/.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Neural network based text to speech (TTS) has made rapid progress and attracted a lot of attention in the machine learning and speech community in recent years (Wang et al., 2017; Shen et al., 2018; Ming et al., 2016; Arik et al., 2017; Ping et al., 2018; Ren et al., 2019; Li et al., 2019). Previous neural TTS models (Wang et al., 2017; Shen et al., 2018; Ping et al., 2018; Li et al., 2019) first generate mel-spectrograms autoregressively from text and then synthesize speech from the generated mel-spectrograms using a separately trained vocoder (Van Den Oord et al., 2016; Oord et al., 2017; Prenger et al., 2019; Kim et al., 2018; Yamamoto et al., 2020; Kumar et al.,
|
| 18 |
+
|
| 19 |
+
2019). They usually suffer from slow inference speed and robustness (word skipping and repeating) issues (Ren et al., 2019; Chen et al., 2020). In recent years, non-autoregressive TTS models (Ren et al., 2019; Łancucki, 2020; Kim et al., 2020; Lim et al., 2020; Miao et al., 2020; Peng et al., 2019) ´ are designed to address these issues, which generate mel-spectrograms with extremely fast speed and avoid robustness issues, while achieving comparable voice quality with previous autoregressive models.
|
| 20 |
+
|
| 21 |
+
Among those non-autoregressive TTS methods, FastSpeech (Ren et al., 2019) is one of the most successful models. FastSpeech designs two ways to alleviate the one-to-many mapping problem: 1) Reducing data variance in the target side by using the generated mel-spectrogram from an autoregressive teacher model as the training target (i.e., knowledge distillation). 2) Introducing the duration information (extracted from the attention map of the teacher model) to expand the text sequence to match the length of the mel-spectrogram sequence. While these designs in FastSpeech ease the learning of the one-to-many mapping problem (see Section 2.1) in TTS, they also bring several disadvantages: 1) The two-stage teacher-student training pipeline makes the training process complicated. 2) The target mel-spectrograms generated from the teacher model have some information loss1 compared with the ground-truth ones, since the quality of the audio synthesized from the generated mel-spectrograms is usually worse than that from the ground-truth ones. 3) The duration extracted from the attention map of teacher model is not accurate enough.
|
| 22 |
+
|
| 23 |
+
In this work, we propose FastSpeech 2 to address the issues in FastSpeech and better handle the one-to-many mapping problem in non-autoregressive TTS. To simplify the training pipeline and avoid the information loss due to data simplification in teacher-student distillation, we directly train the FastSpeech 2 model with ground-truth target instead of the simplified output from a teacher. To reduce the information gap (input does not contain all the information to predict the target) between the input (text sequence) and target output (mel-spectrograms) and alleviate the one-to-many mapping problem for non-autoregressive TTS model training, we introduce some variation information of speech including pitch, energy and more accurate duration into FastSpeech: in training, we extract duration, pitch and energy from the target speech waveform and directly take them as conditional inputs; in inference, we use values predicted by the predictors that are jointly trained with the FastSpeech 2 model. Considering the pitch is important for the prosody of speech and is also difficult to predict due to the large fluctuations along time, we convert the pitch contour into pitch spectrogram using continuous wavelet transform (Tuteur, 1988; Grossmann & Morlet, 1984) and predict the pitch in the frequency domain, which can improve the accuracy of predicted pitch. To further simplify the speech synthesis pipeline, we introduce FastSpeech 2s, which does not use mel-spectrograms as intermediate output and directly generates speech waveform from text in inference, enjoying low latency in inference. Experiments on the LJSpeech (Ito, 2017) dataset show that 1) FastSpeech 2 enjoys much simpler training pipeline (3x training time reduction) than FastSpeech while inherits its advantages of fast, robust and controllable (even more controllable in pitch and energy) speech synthesis, and FastSpeech 2s enjoys even faster inference speed; 2) FastSpeech 2 and 2s outperform FastSpeech in voice quality, and FastSpeech 2 can even surpass autoregressive models. We attach audio samples generated by FastSpeech 2 and 2s at https://speechresearch.github.io/fastspeech2/.
|
| 24 |
+
|
| 25 |
+
The main contributions of this work are summarized as follows:
|
| 26 |
+
|
| 27 |
+
• FastSpeech 2 achieves a 3x training speed-up over FastSpeech by simplifying the training pipeline.
|
| 28 |
+
• FastSpeech 2 alleviates the one-to-many mapping problem in TTS and achieves better voice quality.
|
| 29 |
+
• FastSpeech 2s further simplifies the inference pipeline for speech synthesis while maintaining high voice quality, by directly generating speech waveform from text.
|
| 30 |
+
|
| 31 |
+
# 2 FASTSPEECH 2 AND 2S
|
| 32 |
+
|
| 33 |
+
In this section, we first describe the motivation of the design in FastSpeech 2, and then introduce the architecture of FastSpeech 2, which aims to improve FastSpeech to better handle the one-to
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: The overall architecture for FastSpeech 2 and 2s. LR in subfigure (b) denotes the length regulator proposed in FastSpeech. LN in subfigure (c) denotes layer normalization.
|
| 37 |
+
|
| 38 |
+
many mapping problem, with simpler training pipeline and higher voice quality. At last, we extend FastSpeech 2 to FastSpeech 2s for fully end-to-end text-to-waveform synthesis2.
|
| 39 |
+
|
| 40 |
+
# 2.1 MOTIVATION
|
| 41 |
+
|
| 42 |
+
TTS is a typical one-to-many mapping problem (Wang et al., 2017; Zhu et al., 2017; Jayne et al., 2012; Gadermayr et al., 2020; Chen et al., 2021), since multiple possible speech sequences can correspond to a text sequence due to variations in speech, such as pitch, duration, sound volume and prosody. In non-autoregressive TTS, the only input information is text which is not enough to fully predict the variance in speech. In this case, the model is prone to overfit to the variations of the target speech in the training set, resulting in poor generalization ability. As mentioned in Section 1, although FastSpeech designs two ways to alleviate the one-to-many mapping problem, they also bring about several issues including 1) the complicated training pipeline; 2) information loss of target mel-spectrogram as analyzed in Table 1; and 3) not accurate enough ground-truth duration as shown in Table 5a. In the following subsection, we introduce the detailed design of FastSpeech 2 which aims to address these issues.
|
| 43 |
+
|
| 44 |
+
# 2.2 MODEL OVERVIEW
|
| 45 |
+
|
| 46 |
+
The overall model architecture of FastSpeech 2 is shown in Figure 1a. The encoder converts the phoneme embedding sequence into the phoneme hidden sequence, and then the variance adaptor adds different variance information such as duration, pitch and energy into the hidden sequence, finally the mel-spectrogram decoder converts the adapted hidden sequence into mel-spectrogram sequence in parallel. We use the feed-forward Transformer block, which is a stack of selfattention (Vaswani et al., 2017) layer and 1D-convolution as in FastSpeech (Ren et al., 2019), as the basic structure for the encoder and mel-spectrogram decoder. Different from FastSpeech that relies on a teacher-student distillation pipeline and the phoneme duration from a teacher model, FastSpeech 2 makes several improvements. First, we remove the teacher-student distillation pipeline, and directly use ground-truth mel-spectrograms as target for model training, which can avoid the information loss in distilled mel-spectrograms and increase the upper bound of the voice quality. Second, our variance adaptor consists of not only duration predictor but also pitch and energy predictors, where 1) the duration predictor uses the phoneme duration obtained by forced alignment (McAuliffe et al., 2017) as training target, which is more accurate than that extracted from the attention map of autoregressive teacher model as verified experimentally in Section 3.2.2; and 2) the additional pitch and energy predictors can provide more variance information, which is important to ease the one-to-many mapping problem in TTS. Third, to further simplify the training pipeline and push it towards a fully end-to-end system, we propose FastSpeech 2s, which directly generates waveform from text, without cascaded mel-spectrogram generation (acoustic model) and waveform generation (vocoder). In the following subsections, we describe detailed designs of the variance adaptor and direct waveform generation in our method.
|
| 47 |
+
|
| 48 |
+
# 2.3 VARIANCE ADAPTOR
|
| 49 |
+
|
| 50 |
+
The variance adaptor aims to add variance information (e.g., duration, pitch, energy, etc.) to the phoneme hidden sequence, which can provide enough information to predict variant speech for the one-to-many mapping problem in TTS. We briefly introduce the variance information as follows: 1) phoneme duration, which represents how long the speech voice sounds; 2) pitch, which is a key feature to convey emotions and greatly affects the speech prosody; 3) energy, which indicates framelevel magnitude of mel-spectrograms and directly affects the volume and prosody of speech. More variance information can be added in the variance adaptor, such as emotion, style and speaker, and we leave it for future work. Correspondingly, the variance adaptor consists of 1) a duration predictor (i.e., the length regulator, as used in FastSpeech), 2) a pitch predictor, and 3) an energy predictor, as shown in Figure 1b. In training, we take the ground-truth value of duration, pitch and energy extracted from the recordings as input into the hidden sequence to predict the target speech. At the same time, we use the ground-truth duration, pitch and energy as targets to train the duration, pitch and energy predictors, which are used in inference to synthesize target speech. As shown in Figure 1c, the duration, pitch and energy predictors share similar model structure (but different model parameters), which consists of a 2-layer 1D-convolutional network with ReLU activation, each followed by the layer normalization and the dropout layer, and an extra linear layer to project the hidden states into the output sequence. In the following paragraphs, we describe the details of the three predictors respectively.
|
| 51 |
+
|
| 52 |
+
Duration Predictor The duration predictor takes the phoneme hidden sequence as input and predicts the duration of each phoneme, which represents how many mel frames correspond to this phoneme, and is converted into logarithmic domain for ease of prediction. The duration predictor is optimized with mean square error (MSE) loss, taking the extracted duration as training target. Instead of extracting the phoneme duration using a pre-trained autoregressive TTS model in FastSpeech, we use Montreal forced alignment (MFA) (McAuliffe et al., 2017) tool3 to extract the phoneme duration, in order to improve the alignment accuracy and thus reduce the information gap between the model input and output.
|
| 53 |
+
|
| 54 |
+
Pitch Predictor Previous neural network based TTS systems with pitch prediction (Arik et al., 2017; Gibiansky et al., 2017) often predict pitch contour directly. However, due to high variations of ground-truth pitch, the distribution of predicted pitch values is very different from ground-truth distribution, as analyzed in Section 3.2.2. To better predict the variations in pitch contour, we use continuous wavelet transform (CWT) to decompose the continuous pitch series into pitch spectrogram (Suni et al., 2013; Hirose & Tao, 2015) and take the pitch spectrogram as the training target for the pitch predictor which is optimized with MSE loss. In inference, the pitch predictor predicts the pitch spectrogram, which is further converted back into pitch contour using inverse continuous wavelet transform (iCWT). We describe the details of pitch extraction, CWT, iCWT and pitch predictor architecture in Appendix D. To take the pitch contour as input in both training and inference, we quantize pitch $F _ { 0 }$ (ground-truth/predicted value for train/inference respectively) of each frame to 256 possible values in log-scale and further convert it into pitch embedding vector $p$ and add it to the expanded hidden sequence.
|
| 55 |
+
|
| 56 |
+
Energy Predictor We compute L2-norm of the amplitude of each short-time Fourier transform (STFT) frame as the energy. Then we quantize energy of each frame to 256 possible values uniformly, encoded it into energy embedding $e$ and add it to the expanded hidden sequence similarly to pitch. We use an energy predictor to predict the original values of energy instead of the quantized values and optimize the energy predictor with MSE loss4.
|
| 57 |
+
|
| 58 |
+
# 2.4 FASTSPEECH 2S
|
| 59 |
+
|
| 60 |
+
To enable fully end-to-end text-to-waveform generation, in this subsection, we extend FastSpeech 2 to FastSpeech 2s, which directly generates waveform from text, without cascaded mel-spectrogram generation (acoustic model) and waveform generation (vocoder). As shown in Figure 1a, FastSpeech 2s generates waveform conditioning on intermediate hidden, which makes it more compact in inference by discarding mel-spectrogram decoder and achieve comparable performance with a cascaded system. We first discuss the challenges in non-autoregressive text-to-waveform generation, then describe details of FastSpeech 2s, including model structure and training and inference processes.
|
| 61 |
+
|
| 62 |
+
Challenges in Text-to-Waveform Generation When pushing TTS pipeline towards fully endto-end framework, there are several challenges: 1) Since the waveform contains more variance information (e.g., phase) than mel-spectrograms, the information gap between the input and output is larger than that in text-to-spectrogram generation. 2) It is difficult to train on the audio clip that corresponds to the full text sequence due to the extremely long waveform samples and limited GPU memory. As a result, we can only train on a short audio clip that corresponds to a partial text sequence which makes it hard for the model to capture the relationship among phonemes in different partial text sequences and thus harms the text feature extraction.
|
| 63 |
+
|
| 64 |
+
Our Method To tackle the challenges above, we make several designs in the waveform decoder: 1) Considering that the phase information is difficult to predict using a variance predictor (Engel et al., 2020), we introduce adversarial training in the waveform decoder to force it to implicitly recover the phase information by itself (Yamamoto et al., 2020). 2) We leverage the mel-spectrogram decoder of FastSpeech 2, which is trained on the full text sequence to help on the text feature extraction. As shown in Figure 1d, the waveform decoder is based on the structure of WaveNet (Van Den Oord et al., 2016) including non-causal convolutions and gated activation (Van den Oord et al., 2016). The waveform decoder takes a sliced hidden sequence corresponding to a short audio clip as input and upsamples it with transposed 1D-convolution to match the length of audio clip. The discriminator in the adversarial training adopts the same structure in Parallel WaveGAN (Yamamoto et al., 2020) which consists of ten layers of non-causal dilated 1-D convolutions with leaky ReLU activation function. The waveform decoder is optimized by the multi-resolution STFT loss and the LSGAN discriminator loss following Parallel WaveGAN. In inference, we discard the mel-spectrogram decoder and only use the waveform decoder to synthesize speech audio.
|
| 65 |
+
|
| 66 |
+
# 2.5 DISCUSSIONS
|
| 67 |
+
|
| 68 |
+
In this subsection, we discuss how FastSpeech 2 and 2s differentiate from previous and concurrent works.
|
| 69 |
+
|
| 70 |
+
Compared with Deep Voice (Arik et al., 2017), Deep Voice 2 (Gibiansky et al., 2017) and other methods Fan et al. (2014); Ze et al. (2013) which generate waveform autoregressively and also predict variance information such as duration and pitch, Fastspeech 2 and 2s adopt self-attention based feed-forward network to generate mel-spectrograms or waveform in parallel. While some existing non-autoregressive acoustic models (Zeng et al., 2020; Lim et al., 2020; Kim et al., 2020) mostly focus on improving the duration accuracy, FastSpeech 2 and 2s provide more variation information (duration, pitch and energy) as inputs to reduce the information gap between the input and output. A concurrent work (Łancucki, 2020) employs pitch prediction in phoneme level, while FastSpeech 2 ´ and 2s predict more fine-grained pitch contour in frame level. In addition, to improve the prosody in synthesized speech, FastSpeech 2 and 2s further introduce continuous wavelet transform to model the variations in pitch.
|
| 71 |
+
|
| 72 |
+
While some text-to-waveform models such as ClariNet (Ping et al., 2019) jointly train an autoregressive acoustic model and a non-autoregressive vocoder, FastSpeech 2s embraces the fully nonautoregressive architecture for fast inference. A concurrent work called EATS (Donahue et al., 2020)
|
| 73 |
+
|
| 74 |
+
also employs non-autoregressive architecture and adversarial training to convert text to waveform directly and mainly focuses on predicting the duration of each phoneme end-to-end using a differentiable monotonic interpolation scheme. Compared with EATS, FastSpeech 2s additionally provides more variation information to ease the one-to-many mapping problem in TTS.
|
| 75 |
+
|
| 76 |
+
Previous non-autoregressive vocoders (Oord et al., 2017; Prenger et al., 2019; Yamamoto et al., 2020; Kumar et al., 2019) are not complete text-to-speech systems, since they convert time aligned linguistic features to waveforms, and require a separate linguistic model to convert input text to linguistic features or an acoustic model to convert input text to acoustic features (e.g., melspectrograms). FastSpeech 2s is the first attempt to directly generate waveform from phoneme sequence fully in parallel, instead of linguistic features or mel-spectrograms.
|
| 77 |
+
|
| 78 |
+
# 3 EXPERIMENTS AND RESULTS
|
| 79 |
+
|
| 80 |
+
# 3.1 EXPERIMENTAL SETUP
|
| 81 |
+
|
| 82 |
+
Datasets We evaluate FastSpeech 2 and 2s on LJSpeech dataset (Ito, 2017). LJSpeech contains 13,100 English audio clips (about 24 hours) and corresponding text transcripts. We split the dataset into three sets: 12,228 samples for training, 349 samples (with document title LJ003) for validation and 523 samples (with document title LJ001 and LJ002) for testing. For subjective evaluation, we randomly choose 100 samples in test set. To alleviate the mispronunciation problem, we convert the text sequence into the phoneme sequence (Arik et al., 2017; Wang et al., 2017; Shen et al., 2018; Sun et al., 2019) with an open-source grapheme-to-phoneme tool5. We transform the raw waveform into mel-spectrograms following Shen et al. (2018) and set frame size and hop size to 1024 and 256 with respect to the sample rate 22050.
|
| 83 |
+
|
| 84 |
+
Model Configuration Our FastSpeech 2 consists of 4 feed-forward Transformer (FFT) blocks (Ren et al., 2019) in the encoder and the mel-spectrogram decoder. The output linear layer in the decoder converts the hidden states into 80-dimensional mel-spectrograms and our model is optimized with mean absolute error (MAE). We add more detailed configurations of FastSpeech 2 and 2s used in our experiments in Appendix A. The details of training and inference are added in Appendix B.
|
| 85 |
+
|
| 86 |
+
# 3.2 RESULTS
|
| 87 |
+
|
| 88 |
+
<table><tr><td>Method</td><td>CMOS</td></tr><tr><td>FastSpeech 2</td><td>一 0.000</td></tr><tr><td>FastSpeech Transformer TTS</td><td>-0.885 -0.235</td></tr></table>
|
| 89 |
+
|
| 90 |
+
Table 1: Audio quality comparison.
|
| 91 |
+
|
| 92 |
+
<table><tr><td>Method</td><td>MOS</td></tr><tr><td>GT</td><td>4.30± 0.07</td></tr><tr><td>GT (Mel + PWG)</td><td>3.92 ± 0.08</td></tr><tr><td>Tacotron 2 (Shen et al.,2018) (Mel + PWG)</td><td>3.70± 0.08</td></tr><tr><td>Transformer TTS (Li et al.,2019) (Mel + PWG)</td><td>3.72 ± 0.07</td></tr><tr><td>FastSpeech (Ren et al.,2019) (Mel + PWG)</td><td>3.68± 0.09</td></tr><tr><td>FastSpeech 2 (Mel + PWG)</td><td>3.83 ± 0.08</td></tr><tr><td>FastSpeech 2s</td><td>3.71 ± 0.09</td></tr></table>
|
| 93 |
+
|
| 94 |
+
(a) The MOS with $9 5 \%$ confidence intervals.
|
| 95 |
+
|
| 96 |
+
(b) CMOS comparison.
|
| 97 |
+
|
| 98 |
+
In this section, we first evaluate the audio quality, training and inference speedup of FastSpeech 2 and 2s. Then we conduct analyses and ablation studies of our method6.
|
| 99 |
+
|
| 100 |
+
# 3.2.1 MODEL PERFORMANCE
|
| 101 |
+
|
| 102 |
+
Audio Quality To evaluate the perceptual quality, we perform mean opinion score (MOS) (Chu & Peng, 2006) evaluation on the test set. Twenty native English speakers are asked to make quality judgments about the synthesized speech samples. The text content keeps consistent among different systems so that all testers only examine the audio quality without other interference factors. We compare the MOS of the audio samples generated by FastSpeech 2 and FastSpeech $2 s$ with other systems, including 1) $G T .$ , the ground-truth recordings; 2) GT $( M e l + P W G )$ ), where we first convert the ground-truth audio into mel-spectrograms, and then convert the mel-spectrograms back to audio using Parallel WaveGAN (Yamamoto et al., 2020) (PWG); 3) Tacotron 2 (Shen et al., 2018) $( M e l + P W G )$ ; 4) Transformer TTS (Li et al., 2019) $( M e l + P W G )$ ; 5) FastSpeech (Ren et al., 2019) $( M e l + P W G )$ . All the systems in 3), 4) and 5) use Parallel WaveGAN as the vocoder for a fair comparison. The results are shown in Table 1. It can be seen that FastSpeech 2 can surpass and FastSpeech 2s can match the voice quality of autoregressive models Transformer TTS and Tacotron 2. Importantly, FastSpeech 2 outperforms FastSpeech, which demonstrates the effectiveness of providing variance information such as pitch, energy and more accurate duration and directly taking ground-truth speech as training target without using teacher-student distillation pipeline.
|
| 103 |
+
|
| 104 |
+
Table 2: The comparison of training time and inference latency in waveform synthesis. The training time of FastSpeech includes teacher and student training. RTF denotes the real-time factor, that is the time (in seconds) required for the system to synthesize one second waveform. The training and inference latency tests are conducted on a server with 36 Intel Xeon CPUs, 256GB memory, 1 NVIDIA V100 GPU and batch size of 48 for training and 1 for inference. Besides, we do not include the time of GPU memory garbage collection and transferring input and output data between the CPU and the GPU. The speedup in waveform synthesis for FastSpeech is larger than that reported in Ren et al. (2019) since we use Parallel WaveGAN as the vocoder which is much faster than WaveGlow.
|
| 105 |
+
|
| 106 |
+
<table><tr><td>Method</td><td>Training Time (h)</td><td>Inference Speed (RTF)</td><td>Inference Speedup</td></tr><tr><td>Transformer TTS (Li et al.,2019)</td><td>38.64</td><td>9.32 × 10-1</td><td>/</td></tr><tr><td>FastSpeech (Ren et al.,2019)</td><td>53.12</td><td>1.92 × 10-2</td><td>48.5×</td></tr><tr><td>FastSpeech 2</td><td>17.02</td><td>1.95 × 10-2</td><td>47.8×</td></tr><tr><td>FastSpeech 2s</td><td>92.18</td><td>1.80 × 10-2</td><td>51.8×</td></tr></table>
|
| 107 |
+
|
| 108 |
+
Training and Inference Speedup FastSpeech 2 simplifies the training pipeline of FastSpeech by removing the teacher-student distillation process, and thus reduces the training time. We list the total training time of Transformer TTS (the autoregressive teacher model), FastSpeech (including the training of Transformer TTS teacher model and FastSpeech student model) and FastSpeech 2 in Table 2. It can be seen that FastSpeech 2 reduces the total training time by $3 . 1 2 \times$ compared with FastSpeech. Note that training time here only includes acoustic model training, without considering the vocoder training. Therefore, we do not compare the training time of FastSpeech 2s here. We then evaluate the inference latency of FastSpeech 2 and 2s compared with the autoregressive Transformer TTS model, which has the similar number of model parameters with FastSpeech 2 and 2s. We show the inference speedup for waveform generation in Table 2. It can be seen that compared with the Transformer TTS model, FastSpeech 2 and 2s speeds up the audio generation by $4 7 . 8 \times$ and $5 1 . 8 \times$ respectively in waveform synthesis. We can also see that FastSpeech 2s is faster than FastSpeech 2 due to fully end-to-end generation.
|
| 109 |
+
|
| 110 |
+
3.2.2 ANALYSES ON VARIANCE INFORMATION
|
| 111 |
+
|
| 112 |
+
<table><tr><td>Method</td><td>9</td><td>Y</td><td>K</td><td>DTW</td></tr><tr><td>GT</td><td>54.4</td><td>0.836</td><td>0.977</td><td>/</td></tr><tr><td>Tacotron 2</td><td>44.1</td><td>1.28</td><td>1.311</td><td>26.32</td></tr><tr><td>TransformerTTS</td><td>40.8</td><td>0.703</td><td>1.419</td><td>24.40</td></tr><tr><td>FastSpeech</td><td>50.8</td><td>0.724</td><td>-0.041</td><td>24.89</td></tr><tr><td>FastSpeech 2</td><td>54.1</td><td>0.881</td><td>0.996</td><td>24.39</td></tr><tr><td>FastSpeech 2 - CWT</td><td>42.3</td><td>0.771</td><td>1.115</td><td>25.13</td></tr><tr><td>FastSpeech 2s</td><td>53.9</td><td>0.872</td><td>0.998</td><td>24.37</td></tr></table>
|
| 113 |
+
|
| 114 |
+
Table 3: Standard deviation $( \sigma )$ , skewness $( \gamma )$ , kurtosis $( \kappa )$ and average DTW distances (DTW) of pitch in ground-truth and synthesized audio.
|
| 115 |
+
|
| 116 |
+
More Accurate Variance Information in Synthesized Speech In the paragraph, we measure if providing more variance information (e.g., pitch and energy) as input in FastSpeech 2 and 2s can indeed synthesize speech with more accurate pitch and energy.
|
| 117 |
+
|
| 118 |
+
For pitch, we compute the moments (standard deviation $( \sigma )$ , skewness $( \gamma )$ and kurtosis $( \kappa )$ ) (Andreeva et al., 2014; Niebuhr & Skarnitzl, 2019) and average dynamic time warping (DTW) Muller ¨ (2007) distance of the pitch distribution for the ground-truth speech and synthesized speech. The results are shown in Table 3. It can be seen that compared with FastSpeech, the moments $( \sigma , \gamma$ and $\kappa$ ) of generated audio of FastSpeech 2/2s are more close to the ground-truth audio and the average DTW distances to the ground-truth pitch are smaller than other methods, demonstrating that FastSpeech 2/2s can generate speech with more natural pitch contour (which can result in better prosody) than FastSpeech. We also conduct a case study on generated pitch contours in Appendix D.
|
| 119 |
+
|
| 120 |
+
<table><tr><td></td><td></td><td></td><td>Method|FastSpeech |FastSpeech 2|FastSpeech 2s</td></tr><tr><td>MAE</td><td>0.142</td><td>0.131</td><td>0.133</td></tr></table>
|
| 121 |
+
|
| 122 |
+
Table 4: The mean absolute error (MAE) of the energy in synthesized speech audio.
|
| 123 |
+
|
| 124 |
+
For energy, we compute the mean absolute error (MAE) between the frame-wise energy extracted from the generated waveform and the ground-truth speech. To ensure that the numbers of frames in the synthesized and ground-truth speech are the same, we use the ground-truth duration extracted by MFA in both FastSpeech and FastSpeech 2. The results are shown in Table 4. We can see that the MAE of the energy for FastSpeech 2/2s are smaller than that for FastSpeech, indicating that they both synthesize speech audio with more similar energy to the ground-truth audio.
|
| 125 |
+
|
| 126 |
+
More Accurate Duration for Model Training We then analyze the accuracy of the provided duration information to train the duration predictor and the effectiveness of more accurate duration for better voice quality based on FastSpeech. We manually align 50 audio generated by the teacher model and the corresponding text in phoneme level and get the ground-truth phoneme-level duration. We compute the average of absolute phoneme boundary differences (McAuliffe et al., 2017) using the duration from the teacher model of FastSpeech and from MFA as used in this paper respectively. The results are shown in Table 5a. We can see that MFA can generate more accurate duration than the teacher model of FastSpeech. Next, we replace the duration used in FastSpeech (from teacher model) with that extracted by MFA, and conduct the CMOS (Loizou, 2011) test to compare the voice quality between the two FastSpeech models trained with different durations7. The results are listed in Table 5b and it can be seen that more accurate duration information improves the voice quality of FastSpeech, which verifies the effectiveness of our improved duration from MFA.
|
| 127 |
+
|
| 128 |
+
<table><tr><td>Method</td><td>△(ms)</td></tr><tr><td>Duration from teacher model</td><td>19.68</td></tr><tr><td>Duration from MFA</td><td>12.47</td></tr></table>
|
| 129 |
+
|
| 130 |
+
<table><tr><td>Setting</td><td>CMOS</td></tr><tr><td>FastSpeech + Duration from teacher</td><td>0</td></tr><tr><td>FastSpeech + Duration from MFA</td><td>+0.195</td></tr></table>
|
| 131 |
+
|
| 132 |
+
(a) Alignment accuracy comparison.
|
| 133 |
+
|
| 134 |
+
(b) CMOS comparison.
|
| 135 |
+
|
| 136 |
+
Table 5: The comparison of the duration from teacher model and MFA. $\Delta$ means the average of absolute boundary differences.
|
| 137 |
+
|
| 138 |
+
# 3.2.3 ABLATION STUDY
|
| 139 |
+
|
| 140 |
+
Pitch and Energy Input We conduct ablation studies to demonstrate the effectiveness of several variance information of FastSpeech 2 and 2s, including pitch and energy8. We conduct CMOS evaluation for these ablation studies. The results are shown in Table 6. We find that removing the energy (Row 3 in both subtables) in FastSpeech 2 and 2s results in performance drop in terms of voice quality (-0.040 and -0.160 CMOS respectively), indicating that energy is effective for FastSpeech 2 in improving the voice quality, and more effective for FastSpeech 2s. We also find that removing the pitch (Row 4 in both subtables) in FastSpeech 2 and 2s results in -0.245 and -1.130 CMOS respectively, which demonstrates the effectiveness of pitch. When we remove both pitch and energy (the last row in both subtables), the voice quality further drops, indicating that both pitch and energy can help improve the performance of FastSpeech 2 and 2s.
|
| 141 |
+
|
| 142 |
+
Predicting Pitch in Frequency Domain To study the effectiveness of predicting pitch in frequency domain using continuous wavelet transform (CWT) as described in Section 2.3, we directly fit the pitch contour with mean square error like energy in FastSpeech 2 and 2s. We conduct CMOS evaluation and get CMOS drops of 0.185 and 0.201 for FastSpeech 2 and 2s respectively. We also compute the moments of pitch and average DTW distance to the ground-truth pitch as shown in row 6 (denoeted as FastSpeech $2 \cdot C W T$ ) in Table 3. The results demonstrate that CWT can help model the pitch better and improve the prosody of synthesized speech, and thus obtaining better CMOS score.
|
| 143 |
+
|
| 144 |
+
Mel-Spectrogram Decoder in FastSpeech 2s To verify the effectiveness of the mel-spectrogram decoder in FastSpeech 2s on text feature extraction as described in Section 2.4, we remove the mel-spectrogram decoder and conduct CMOS evaluation. It causes a 0.285 CMOS drop, which demonstrates that the mel-spectrogram decoder is essential to high-quality waveform generation.
|
| 145 |
+
|
| 146 |
+
Table 6: CMOS comparison in the ablation studies.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Setting</td><td>CMOS</td></tr><tr><td>FastSpeech 2</td><td>0</td></tr><tr><td>FastSpeech 2 - energy</td><td>-0.040</td></tr><tr><td>FastSpeech2-pitch</td><td>-0.245</td></tr><tr><td>FastSpeech 2-pitch -energy</td><td>-0.370</td></tr></table>
|
| 149 |
+
|
| 150 |
+
<table><tr><td>Setting</td><td>CMOS</td></tr><tr><td>FastSpeech 2s</td><td>0</td></tr><tr><td>FastSpeech 2s - energy</td><td>-0.160</td></tr><tr><td>FastSpeech 2s-pitch</td><td>-1.130</td></tr><tr><td>FastSpeech 2s-pitch -energy</td><td>-1.355</td></tr></table>
|
| 151 |
+
|
| 152 |
+
(b) CMOS comparison for FastSpeech 2s.
|
| 153 |
+
|
| 154 |
+
(a) CMOS comparison for FastSpeech 2.
|
| 155 |
+
|
| 156 |
+
# 4 CONCLUSION
|
| 157 |
+
|
| 158 |
+
In this work, we proposed FastSpeech 2, a fast and high-quality end-to-end TTS system, to address the issues in FastSpeech and ease the one-to-many mapping problem: 1) we directly train the model with ground-truth mel-spectrograms to simplify the training pipeline and also avoid information loss compared with FastSpeech; and 2) we improve the duration accuracy and introduce more variance information including pitch and energy to ease the one-to-many mapping problem, and improve pitch prediction by introducing continuous wavelet transform. Moreover, based on FastSpeech 2, we further developed FastSpeech 2s, a non-autoregressive text-to-waveform generation model, which enjoys the benefit of fully end-to-end inference and achieves faster inference speed. Our experimental results show that FastSpeech 2 and 2s outperform FastSpeech, and FastSpeech 2 can even surpass autoregressive models in terms of voice quality, with much simpler training pipeline while inheriting the advantages of fast, robust and controllable speech synthesis of FastSpeech.
|
| 159 |
+
|
| 160 |
+
High quality, fast and fully end-to-end training without any external libraries is definitely the ultimate goal of neural TTS and also a very challenging problem. To ensure high quality of FastSpeech 2, we use an external high-performance alignment tool and pitch extraction tools, which may seem a little complicated, but are very helpful for high-quality and fast speech synthesis. We believe there will be more simpler solutions to achieve this goal in the future and we will certainly work on fully end-to-end TTS without external alignment models and tools. We will also consider more variance information (Zhang et al., 2021) to further improve the voice quality and speed up the inference with more light-weight model (Luo et al., 2021).
|
| 161 |
+
|
| 162 |
+
# ACKNOWLEDGMENTS
|
| 163 |
+
|
| 164 |
+
This work was supported in part by the National Key R&D Program of China (Grant No.2018AAA0100603), National Natural Science Foundation of China (Grant No.62072397), Zhejiang Natural Science Foundation (Grant No.LR19F020006), National Natural Science Foundation of China (Grant No.61836002) and X Lab, the Second Academy of CASIC, Beijing, 100854, China.
|
| 165 |
+
|
| 166 |
+
# REFERENCES
|
| 167 |
+
|
| 168 |
+
Bistra Andreeva, Grazyna Demenko, Bernd M ˙ obius, Frank Zimmerer, Jeanin J ¨ ugler, and Magdalena ¨ Oleskowicz-Popiel. Differences of pitch profiles in germanic and slavic languages. In Fifteenth Annual Conference of the International Speech Communication Association, 2014.
|
| 169 |
+
|
| 170 |
+
Sercan O Arik, Mike Chrzanowski, Adam Coates, Gregory Diamos, Andrew Gibiansky, Yongguo Kang, Xian Li, John Miller, Andrew Ng, Jonathan Raiman, et al. Deep voice: Real-time neural text-to-speech. arXiv preprint arXiv:1702.07825, 2017.
|
| 171 |
+
|
| 172 |
+
Mingjian Chen, Xu Tan, Yi Ren, Jin Xu, Hao Sun, Sheng Zhao, and Tao Qin. Multispeech: Multispeaker text to speech with transformer. In INTERSPEECH, pp. 4024–4028, 2020.
|
| 173 |
+
|
| 174 |
+
Mingjian Chen, Xu Tan, Bohan Li, Yanqing Liu, Tao Qin, sheng zhao, and Tie-Yan Liu. Adaspeech: Adaptive text to speech for custom voice. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ Drynvt7gg4L.
|
| 175 |
+
|
| 176 |
+
Min Chu and Hu Peng. Objective measure for estimating mean opinion score of synthesized speech, April 4 2006. US Patent 7,024,362.
|
| 177 |
+
|
| 178 |
+
Jeff Donahue, Sander Dieleman, Mikołaj Binkowski, Erich Elsen, and Karen Simonyan. End-to-end ´ adversarial text-to-speech. arXiv preprint arXiv:2006.03575, 2020.
|
| 179 |
+
|
| 180 |
+
Jesse Engel, Lamtharn Hantrakul, Chenjie Gu, and Adam Roberts. Ddsp: Differentiable digital signal processing. arXiv preprint arXiv:2001.04643, 2020.
|
| 181 |
+
|
| 182 |
+
Yuchen Fan, Yao Qian, Feng-Long Xie, and Frank K Soong. Tts synthesis with bidirectional lstm based recurrent neural networks. In Fifteenth Annual Conference of the International Speech Communication Association, 2014.
|
| 183 |
+
|
| 184 |
+
Michael Gadermayr, Maximilian Tschuchnig, Dorit Merhof, Nils Kramer, Daniel Truhn, and ¨ Burkhard Gess. An asymetric cycle-consistency loss for dealing with many-to-one mappings in image translation: A study on thigh mr scans. arXiv preprint arXiv:2004.11001, 2020.
|
| 185 |
+
|
| 186 |
+
Andrew Gibiansky, Sercan Arik, Gregory Diamos, John Miller, Kainan Peng, Wei Ping, Jonathan Raiman, and Yanqi Zhou. Deep voice 2: Multi-speaker neural text-to-speech. In Advances in neural information processing systems, pp. 2962–2970, 2017.
|
| 187 |
+
|
| 188 |
+
Alexander Grossmann and Jean Morlet. Decomposition of hardy functions into square integrable wavelets of constant shape. SIAM journal on mathematical analysis, 15(4):723–736, 1984.
|
| 189 |
+
|
| 190 |
+
Keikichi Hirose and Jianhua Tao. Speech Prosody in Speech Synthesis: Modeling and generation of prosody for high quality and flexible speech synthesis. Springer, 2015.
|
| 191 |
+
|
| 192 |
+
Keith Ito. The lj speech dataset. https://keithito.com/LJ-Speech-Dataset/, 2017.
|
| 193 |
+
|
| 194 |
+
Chrisina Jayne, Andreas Lanitis, and Chris Christodoulou. One-to-many neural network mapping techniques for face image synthesis. Expert Systems with Applications, 39(10):9778–9787, 2012.
|
| 195 |
+
|
| 196 |
+
Jaehyeon Kim, Sungwon Kim, Jungil Kong, and Sungroh Yoon. Glow-tts: A generative flow for text-to-speech via monotonic alignment search. arXiv preprint arXiv:2005.11129, 2020.
|
| 197 |
+
|
| 198 |
+
Sungwon Kim, Sang-gil Lee, Jongyoon Song, Jaehyeon Kim, and Sungroh Yoon. Flowavenet: A generative flow for raw audio. arXiv preprint arXiv:1811.02155, 2018.
|
| 199 |
+
|
| 200 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 201 |
+
|
| 202 |
+
Kundan Kumar, Rithesh Kumar, Thibault de Boissiere, Lucas Gestin, Wei Zhen Teoh, Jose Sotelo, Alexandre de Brebisson, Yoshua Bengio, and Aaron C Courville. Melgan: Generative adversarial´ networks for conditional waveform synthesis. In Advances in Neural Information Processing Systems, pp. 14881–14892, 2019.
|
| 203 |
+
|
| 204 |
+
Adrian Łancucki. Fastpitch: Parallel text-to-speech with pitch prediction. ´ arXiv preprint arXiv:2006.06873, 2020.
|
| 205 |
+
|
| 206 |
+
Naihan Li, Shujie Liu, Yanqing Liu, Sheng Zhao, and Ming Liu. Neural speech synthesis with transformer network. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 6706–6713, 2019.
|
| 207 |
+
|
| 208 |
+
Dan Lim, Won Jang, Hyeyeong Park, Bongwan Kim, Jesam Yoon, et al. Jdi-t: Jointly trained duration informed transformer for text-to-speech without explicit alignment. arXiv preprint arXiv:2005.07799, 2020.
|
| 209 |
+
|
| 210 |
+
Philipos C Loizou. Speech quality assessment. In Multimedia analysis, processing and communications, pp. 623–654. Springer, 2011.
|
| 211 |
+
|
| 212 |
+
Renqian Luo, Xu Tan, Rui Wang, Tao Qin, Jinzhu Li, Sheng Zhao, Enhong Chen, and Tie-Yan Liu. Lightspeech: Lightweight and fast text to speech with neural architecture search. In 2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2021.
|
| 213 |
+
|
| 214 |
+
Michael McAuliffe, Michaela Socolof, Sarah Mihuc, Michael Wagner, and Morgan Sonderegger. Montreal forced aligner: Trainable text-speech alignment using kaldi. In Interspeech, pp. 498– 502, 2017.
|
| 215 |
+
|
| 216 |
+
Chenfeng Miao, Shuang Liang, Minchuan Chen, Jun Ma, Shaojun Wang, and Jing Xiao. Flowtts: A non-autoregressive network for text to speech based on flow. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 7209–7213. IEEE, 2020.
|
| 217 |
+
|
| 218 |
+
Huaiping Ming, Dongyan Huang, Lei Xie, Jie Wu, Minghui Dong, and Haizhou Li. Deep bidirectional lstm modeling of timbre and prosody for emotional voice conversion. 2016.
|
| 219 |
+
|
| 220 |
+
Meinard Muller. Dynamic time warping. ¨ Information retrieval for music and motion, pp. 69–84, 2007.
|
| 221 |
+
|
| 222 |
+
Oliver Niebuhr and Radek Skarnitzl. Measuring a speaker’s acoustic correlates of pitch–but which? a contrastive analysis based on perceived speaker charisma. In Proceedings of 19th International Congress of Phonetic Sciences, 2019.
|
| 223 |
+
|
| 224 |
+
Aaron van den Oord, Yazhe Li, Igor Babuschkin, Karen Simonyan, Oriol Vinyals, Koray Kavukcuoglu, George van den Driessche, Edward Lockhart, Luis C Cobo, Florian Stimberg, et al. Parallel wavenet: Fast high-fidelity speech synthesis. arXiv preprint arXiv:1711.10433, 2017.
|
| 225 |
+
|
| 226 |
+
Kainan Peng, Wei Ping, Zhao Song, and Kexin Zhao. Parallel neural text-to-speech. arXiv preprint arXiv:1905.08459, 2019.
|
| 227 |
+
|
| 228 |
+
Wei Ping, Kainan Peng, Andrew Gibiansky, Sercan O. Arik, Ajay Kannan, Sharan Narang, Jonathan Raiman, and John Miller. Deep voice 3: 2000-speaker neural text-to-speech. In International Conference on Learning Representations, 2018.
|
| 229 |
+
|
| 230 |
+
Wei Ping, Kainan Peng, and Jitong Chen. Clarinet: Parallel wave generation in end-to-end text-tospeech. In International Conference on Learning Representations, 2019.
|
| 231 |
+
|
| 232 |
+
Ryan Prenger, Rafael Valle, and Bryan Catanzaro. Waveglow: A flow-based generative network for speech synthesis. In ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 3617–3621. IEEE, 2019.
|
| 233 |
+
|
| 234 |
+
Yi Ren, Yangjun Ruan, Xu Tan, Tao Qin, Sheng Zhao, Zhou Zhao, and Tie-Yan Liu. Fastspeech: Fast, robust and controllable text to speech. In Advances in Neural Information Processing Systems, pp. 3165–3174, 2019.
|
| 235 |
+
|
| 236 |
+
Harold Ryan. Ricker, ormsby; klander, bntterwo-a choice of wavelets, 1994.
|
| 237 |
+
|
| 238 |
+
Jonathan Shen, Ruoming Pang, Ron J Weiss, Mike Schuster, Navdeep Jaitly, Zongheng Yang, Zhifeng Chen, Yu Zhang, Yuxuan Wang, Rj Skerrv-Ryan, et al. Natural tts synthesis by conditioning wavenet on mel spectrogram predictions. In 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 4779–4783. IEEE, 2018.
|
| 239 |
+
|
| 240 |
+
Hao Sun, Xu Tan, Jun-Wei Gan, Hongzhi Liu, Sheng Zhao, Tao Qin, and Tie-Yan Liu. Token-level ensemble distillation for grapheme-to-phoneme conversion. In INTERSPEECH, 2019.
|
| 241 |
+
|
| 242 |
+
Antti Santeri Suni, Daniel Aalto, Tuomo Raitio, Paavo Alku, Martti Vainio, et al. Wavelets for intonation modeling in hmm speech synthesis. In 8th ISCA Workshop on Speech Synthesis, Proceedings, Barcelona, August 31-September 2, 2013. ISCA, 2013.
|
| 243 |
+
|
| 244 |
+
Franz B Tuteur. Wavelet transformations in signal detection. IFAC Proceedings Volumes, 21(9): 1061–1065, 1988.
|
| 245 |
+
|
| 246 |
+
Aaron Van Den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, ¨ Nal Kalchbrenner, Andrew W Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. SSW, 125, 2016.
|
| 247 |
+
|
| 248 |
+
Aaron Van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelcnn decoders. In Advances in neural information processing systems, pp. 4790–4798, 2016.
|
| 249 |
+
|
| 250 |
+
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.
|
| 251 |
+
|
| 252 |
+
Yuxuan Wang, RJ Skerry-Ryan, Daisy Stanton, Yonghui Wu, Ron J Weiss, Navdeep Jaitly, Zongheng Yang, Ying Xiao, Zhifeng Chen, Samy Bengio, et al. Tacotron: Towards end-to-end speech synthesis. arXiv preprint arXiv:1703.10135, 2017.
|
| 253 |
+
|
| 254 |
+
Ryuichi Yamamoto, Eunwoo Song, and Jae-Min Kim. Parallel wavegan: A fast waveform generation model based on generative adversarial networks with multi-resolution spectrogram. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 6199–6203. IEEE, 2020.
|
| 255 |
+
|
| 256 |
+
Heiga Ze, Andrew Senior, and Mike Schuster. Statistical parametric speech synthesis using deep neural networks. In 2013 ieee international conference on acoustics, speech and signal processing, pp. 7962–7966. IEEE, 2013.
|
| 257 |
+
|
| 258 |
+
Zhen Zeng, Jianzong Wang, Ning Cheng, Tian Xia, and Jing Xiao. Aligntts: Efficient feed-forward text-to-speech system without explicit alignment. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 6714–6718. IEEE, 2020.
|
| 259 |
+
|
| 260 |
+
Chen Zhang, Yi Ren, Xu Tan, Jinglin Liu, Kejun Zhang, Tao Qin, Sheng Zhao, and Tie-Yan Liu. Denoispeech: Denoising text to speech with frame-level noise modeling. In 2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2021.
|
| 261 |
+
|
| 262 |
+
Jun-Yan Zhu, Richard Zhang, Deepak Pathak, Trevor Darrell, Alexei A Efros, Oliver Wang, and Eli Shechtman. Toward multimodal image-to-image translation. In Advances in neural information processing systems, pp. 465–476, 2017.
|
| 263 |
+
|
| 264 |
+
# A MODEL CONFIGURATION
|
| 265 |
+
|
| 266 |
+
Our FastSpeech 2 consists of 4 feed-forward Transformer (FFT) blocks (Ren et al., 2019) in the encoder and the mel-spectrogram decoder. In each FFT block, the dimension of phoneme embeddings and the hidden size of the self-attention are set to 256. The number of attention heads is set to 2 and the kernel sizes of the 1D-convolution in the 2-layer convolutional network after the self-attention layer are set to 9 and 1, with input/output size of 256/1024 for the first layer and 1024/256 in the second layer. The size of the phoneme vocabulary is 76, including punctuations. In the variance predictor, the kernel sizes of the 1D-convolution are set to 3, with input/output sizes of 256/256 for both layers and the dropout rate is set to 0.5. Our waveform decoder consists of 1-layer transposed 1D-convolution with filter size 64 and 30 dilated residual convolution blocks, whose skip channel size and kernel size of 1D-convolution are set to 64 and 3. The configurations of the discriminator in FastSpeech 2s are the same as Parallel WaveGAN (Yamamoto et al., 2020). We list hyperparameters and configurations of all models used in our experiments in Table 7.
|
| 267 |
+
|
| 268 |
+
Table 7: Hyperparameters of Transformer TTS, FastSpeech and FastSpeech 2/2s.
|
| 269 |
+
|
| 270 |
+
<table><tr><td rowspan=1 colspan=1>Hyperparameter</td><td rowspan=1 colspan=1>TransformerTTS</td><td rowspan=1 colspan=1>FastSpeech/FastSpeech 2/2s</td></tr><tr><td rowspan=1 colspan=1>Phoneme Embedding Dimension</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>Pre-netLayers</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>Pre-net Hidden</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>/</td></tr><tr><td rowspan=1 colspan=1>EncoderLayers</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>4</td></tr><tr><td rowspan=1 colspan=1>EncoderHidden</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>Encoder Conv1D Kernel</td><td rowspan=1 colspan=1>9</td><td rowspan=1 colspan=1>9</td></tr><tr><td rowspan=1 colspan=1>Encoder Conv1D Filter Size</td><td rowspan=1 colspan=1>1024</td><td rowspan=1 colspan=1>1024</td></tr><tr><td rowspan=1 colspan=1>Encoder Attention Heads</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td></tr><tr><td rowspan=1 colspan=1> Mel-Spectrogram Decoder Layers</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>4</td></tr><tr><td rowspan=1 colspan=1>Mel-Spectrogram Decoder Hidden</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>Mel-Spectrogram Decoder Conv1D Kernel</td><td rowspan=1 colspan=1>9</td><td rowspan=1 colspan=1>9</td></tr><tr><td rowspan=1 colspan=1>Mel-Spectrogram Decoder Conv1D Filter Size</td><td rowspan=1 colspan=1>1024</td><td rowspan=1 colspan=1>1024</td></tr><tr><td rowspan=1 colspan=1>Mel-Spectrogram Decoder Attention Headers</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td></tr><tr><td rowspan=1 colspan=1>Encoder/Decoder Dropout</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.1</td></tr><tr><td rowspan=1 colspan=1>Variance Predictor Conv1DKernel</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>3</td></tr><tr><td rowspan=1 colspan=1>Variance Predictor Conv1DFilter Size</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>Variance Predictor Dropout</td><td rowspan=1 colspan=1>/</td><td rowspan=1 colspan=1>0.5</td></tr><tr><td rowspan=1 colspan=1>Waveform Decoder ConvolutionBlocks</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>30</td></tr><tr><td rowspan=1 colspan=1>Waveform Decoder Dilated Conv1D Kernel size</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>3</td></tr><tr><td rowspan=1 colspan=1>Waveform Decoder Transposed Conv1D Filter Size</td><td rowspan=1 colspan=1>/</td><td rowspan=1 colspan=1>64</td></tr><tr><td rowspan=1 colspan=1>WaveformDecoderSkip Channlel Size</td><td rowspan=1 colspan=1>/</td><td rowspan=1 colspan=1>64</td></tr><tr><td rowspan=1 colspan=1>Batch Size</td><td rowspan=1 colspan=1>48</td><td rowspan=1 colspan=1>48/48/12</td></tr><tr><td rowspan=1 colspan=1>Total Numberof Parameters</td><td rowspan=1 colspan=1>24M</td><td rowspan=1 colspan=1>23M/27M/28M</td></tr></table>
|
| 271 |
+
|
| 272 |
+
# B TRAINING AND INFERENCE
|
| 273 |
+
|
| 274 |
+
We train FastSpeech 2 on 1 NVIDIA V100 GPU, with batchsize of 48 sentences. We use the Adam optimizer (Kingma & Ba, 2014) with $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 8$ , $\varepsilon = 1 0 ^ { - 9 }$ and follow the same learning rate schedule in Vaswani et al. (2017). It takes $1 6 0 \mathrm { k }$ steps for training until convergence. In the inference process, the output mel-spectrograms of our FastSpeech 2 are transformed into audio samples using pre-trained Parallel WaveGAN (Yamamoto et al., $2 0 2 0 ) ^ { 9 }$ . For FastSpeech 2s, we train the model on 2 NVIDIA V100 GPUs, with batchsize of 6 sentences on each GPU. The waveform decoder takes the sliced hidden states corresponding to 20,480 waveform sample clips as input. The optimizer and learning rate schedule for FastSpeech 2s are the same as FastSpeech 2. The details of the adversarial training follow Parallel WaveGAN (Yamamoto et al., 2020). It takes $6 0 0 \mathrm { k }$ steps for training until convergence for FastSpeech 2s.
|
| 275 |
+
|
| 276 |
+
# C MODELING PITCH WITH CONTINUOUS WAVELET TRANSFORM
|
| 277 |
+
|
| 278 |
+
# C.1 CONTINUOUS WAVELET TRANSFORM
|
| 279 |
+
|
| 280 |
+
Given a continous pitch contour function $F _ { 0 }$ , we can convert it to pitch spectrogram $W ( \tau , t )$ using continuous wavelet transform (Tuteur, 1988; Grossmann $\&$ Morlet, 1984):
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
W ( \tau , t ) = \tau ^ { - 1 / 2 } \int _ { - \infty } ^ { + \infty } F _ { 0 } ( x ) \psi ( \frac { x - t } { \tau } ) d x
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
where $\psi$ is the Mexican hat mother wavelet (Ryan, 1994), $F _ { 0 } ( x )$ is the pitch value in position $x$ , $\tau$ and $t$ are scale and position of wavelet respectively. The original pitch contour $F _ { 0 }$ can be recovered from the wavelet representation $W ( \tau , t )$ by inverse continuous wavelet transform (iCWT) using the following formula:
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
F _ { 0 } ( t ) = \int _ { - \infty } ^ { + \infty } \int _ { 0 } ^ { + \infty } W \left( \tau , t \right) \tau ^ { - 5 / 2 } \psi \left( \frac { x - t } { \tau } \right) d x d \tau
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
Suppose that we decompose the pitch contour $F _ { 0 }$ into 10 scales (Ming et al., 2016), $F _ { 0 }$ can be represented by 10 separate components given by:
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
W _ { i } ( t ) = { W ( 2 ^ { i + 1 } \tau _ { 0 } , t ) ( i + 2 . 5 ) ^ { - 5 / 2 } }
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
where $i = 1 , . . . , 1 0$ and $\tau _ { 0 } = 5 m s$ , which is originally proposed in Suni et al. (2013). Given 10 wavelet components ${ \hat { W } } _ { i } ( t )$ , we can recompose pitch contour $\hat { F } _ { 0 }$ by the following formula (Ming et al., 2016):
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
\hat { F _ { 0 } } ( t ) = \sum _ { i = 1 } ^ { 1 0 } \hat { W _ { i } } ( t ) ( i + 2 . 5 ) ^ { - 5 / 2 }
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
# C.2 IMPLEMENTATION DETAILS
|
| 305 |
+
|
| 306 |
+
First we extract the pitch contour using PyWorldVocoder10. Since CWT is very sensitive to discontinuous signals, we preprocess the pitch contour as follows: 1) we use linear interpolation to fill the unvoiced frame in pitch contour; 2) we transform the resulting pitch contour to logarithmic scale; 3) we normalize it to zero mean and unit variance for each utterance, and we have to save the original utterance-level mean and variance for pitch contour reconstruction; and 4) we convert the normalized pitch contour to pitch spectrogram using continuous wavelet transform following Equation 1.
|
| 307 |
+
|
| 308 |
+
As shown in Figure 2, pitch predictor consists of a 2-layer 1Dconvolutional network with ReLU activation, each followed by the layer normalization and the dropout layer, and an extra linear layer to project the hidden states into the pitch spectrogram. To predict the mean/variance of recovered pitch contour for each utterance, we average the hidden states output by the 1D-convolutional network on the time dimension to a global vector and project it to mean and variance using a linear layer.
|
| 309 |
+
|
| 310 |
+
We train the pitch predictor with ground-truth pitch spectrogram and the mean/variance of pitch contour and optimize it with mean square error. During inference, we predict the pitch spectrogram and the mean/variance of recovered pitch contour using pitch predictor, inverse the pitch spectrogram to pitch contour with inverse continuous wavelet transform (iCWT) following Equation 2, and finally denormalize it with the predicted mean/variance.
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure 2: Details in pitch predictor. CWT and iCWT denote continuous wavelet transform and inverse continuous wavelet transform respectively.
|
| 314 |
+
|
| 315 |
+
# D CASE STUDY ON PITCH CONTOUR
|
| 316 |
+
|
| 317 |
+
In this section, we conduct the case study on pitch contours of the audios generated by different methods. We randomly choose 1 utterance from the test set and plot the pitch countor of groundtruth audio samples and that generated by FastSpeech, FastSpeech 2, FastSpeech $2 s$ in Figure 3. We can see that FastSpeech 2 and 2s can capture the variations in pitch better than FastSpeech thanks to taking pitch information as input.
|
| 318 |
+
|
| 319 |
+

|
| 320 |
+
Figure 3: Pitch contours extracted from generated and ground-truth audio samples. We only plot the voiced part of pitch contour. The input text is “The worst, which perhaps was the English, was a terrible falling-off from the work of the earlier presses”.
|
| 321 |
+
|
| 322 |
+
# E VARIANCE CONTROL
|
| 323 |
+
|
| 324 |
+
FastSpeech 2 and 2s introduce several variance information to ease the one-to-many mapping problem in TTS. As a byproduct, they also make the synthesized speech more controllable and can be used to manually control pitch, duration and energy (volume) of synthesized audio. As a demonstration, we manipulate pitch input to control the pitch of synthesized speech in this subsubsection. We show the mel-spectrograms before and after the pitch manipulation in Figure 4. From the samples, we can see that FastSpeech 2 generates high-quality mel-spectrograms after adjusting the $\hat { F } _ { 0 }$ from 0.75 to 1.50 times. Such manipulation can also be applied to FastSpeech 2s and the results are put in the supplementary materials. We also put the audio samples controlled by other variance information in supplementary materials.
|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
Figure 4: The mel-spectrograms of the voice with different $\hat { F } _ { 0 }$ . $F _ { 0 }$ is the fundamental frequency of original audio. The red curves denote $\hat { F } _ { 0 }$ contours. The input text is “They discarded this for a more completely Roman and far less beautiful letter.”
|
md/train/r1e8WTEYPB/r1e8WTEYPB.md
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPARSE AND STRUCTURED VISUAL ATTENTION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Visual attention mechanisms have been widely used in image captioning models. In this paper, to better link the image structure with the generated text, we replace the traditional softmax attention mechanism by two alternative sparsity-promoting transformations: sparsemax and Total-Variation Sparse Attention (TVMAX). With sparsemax, we obtain sparse attention weights, selecting relevant features. In order to promote sparsity and encourage fusing of the related adjacent spatial locations, we propose TVMAX. By selecting relevant groups of features, the TVMAX transformation improves interpretability. We present results in the Microsoft COCO and Flickr30k datasets, obtaining gains in comparison to softmax. TVMAX outperforms the other compared attention mechanisms in terms of humanrated caption quality and attention relevance.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The goal of image captioning is to generate a fluent textual caption that describes a given image (Farhadi et al., 2010; Kulkarni et al., 2011; Vinyals et al., 2015; Xu et al., 2015). Image captioning is a multimodal task: it combines text generation with the detection and identification of objects in the image, along with their relations. While neural encoder-decoder models have achieved impressive performance in many text generation tasks (Bahdanau et al., 2015; Vaswani et al., 2017; Chorowski et al., 2015; Chopra et al., 2016), it is appealing to design image captioning models where structural bias can be injected to improve their adequacy (preservation of the image’s information), therefore strengthening the link between their language and vision components.
|
| 12 |
+
|
| 13 |
+
State-of-the-art approaches for image captioning (Liu et al., 2018a;b; Anderson et al., 2018; Lu et al., 2018) are based on encoder-decoders with visual attention. These models pay attention either to the features generated by convolutional neural networks (CNNs) pretrained on image recognition datasets, or to detected bounding boxes. In this paper, we focus on the former category: visual attention over features generated by a CNN. Without explicit object detection, it is up to the attention mechanism to identify relevant image regions, in an unsupervised manner.
|
| 14 |
+
|
| 15 |
+
A key component of attention mechanisms is the transformation that maps scores into probabilities, with softmax being the standard choice (Bahdanau et al., 2015). However, softmax is strictly dense, i.e., it devotes some attention probability mass to every region of the image. Not only is this wasteful, it also leads to “lack of focus”: for complex images with many objects, this may lead to vague captions with substantial repetitions. Figure 1 presents an example in which this is visible: in the caption generated using softmax (top), the model attends to the whole image at every time step, leading to a repetition of “bowl of fruit.” This undesirable behaviour is eliminated by using our alternative solutions: sparsemax (middle) and the newly proposed TVMAX (bottom).
|
| 16 |
+
|
| 17 |
+
In this work, we introduce novel visual attention mechanisms by endowing them with a new capability: that of selecting only the relevant features of the image. To this end, we first propose replacing softmax with sparsemax (Martins & Astudillo, 2016). While sparsemax has been previously used in NLP for attention mechanisms over words, it has never been applied to computer vision to attend over image regions. With sparsemax, the attention weights obtained are sparse, leading to the selection (non-zero attention) of only a few relevant features. Second, to further encourage the weights of related adjacent spatial locations to be the same (e.g., parts of an object), we introduce a new attention mechanism: Total-Variation Sparse Attention (which we dub TVMAX), inspired by prior work in structured sparsity (Tibshirani et al., 2005; Bach et al., 2012). With TVMAX, sparsity is allied to the ability of selecting compact regions. According to our human evaluation experiments, this leads to better interpretability, since the model’s behaviour is better understood by looking at the selected image regions when a particular word is generated. It also leads to a better selection of the relevant features, and consequently to the improvement of the generated captions.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Example of captions generated using softmax (top), sparsemax (middle) and TVMAX attention (bottom). Shading denotes the attention weight, with white for zero attention. The darker the green is, the higher the attention weight is. The full sequences are presented in Appendix C.
|
| 21 |
+
|
| 22 |
+
This paper introduces three main contributions:
|
| 23 |
+
|
| 24 |
+
• We propose a novel visual attention mechanism using sparse attention, based on sparsemax (Martins & Astudillo, 2016), that improves the quality of the generated captions and increases interpretability.
|
| 25 |
+
We introduce a new attention mechanism, TVMAX, that encourages sparse attention over contiguous 2D regions, giving the model the capability of selecting compact objects. We show that TVmax can be evaluated by composing a proximal operator with a sparsemax projection, and we provide a closed-form expression for its Jacobian. This leads to an efficient implementation of its forward and backward pass. We perform an empirical and qualitative comparison of the various attention mechanisms considered. We also carry out a human evaluation experiment, taking into account the generated captions as well as the perceived relevance of the selected regions.
|
| 26 |
+
|
| 27 |
+
# 2 SELECTIVE VISUAL ATTENTION
|
| 28 |
+
|
| 29 |
+
Attention mechanisms have the ability to select the relevant features, in this case spatial locations. This requires a mapping from importance scores to a distribution, $z \in \mathbb { R } ^ { k } \mapsto \dot { p } \in \triangle ^ { k }$ , where $\begin{array} { r } { \bigtriangleup ^ { k } : = \Big \{ { \pmb p } \in \mathbb { R } ^ { k } \ \big \vert \ \sum _ { i = 1 } ^ { k } p _ { i } = 1 , { \pmb p } \geqslant { \bf 0 } \Big \} } \end{array}$ denotes the simplex (the set of all probability distributions over $k$ values). The standard choice for this mapping is softmax, defined as:
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
[ \mathsf { s o f t m a x } ( z ) ] _ { i } = \frac { \exp ( z _ { i } ) } { \sum _ { j } \exp ( z _ { j } ) } .
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
However, as softmax is strictly positive, its output is dense. Thus, the model must pay some attention to the whole image and, consequently, assign lower attention weights to the relevant regions. This motivates our proposed selective visual attention mechanisms, which, by being sparse, are able to better isolate the relevant image regions.
|
| 36 |
+
|
| 37 |
+
# 2.1 SPARSEMAX
|
| 38 |
+
|
| 39 |
+
To achieve selective capabilities, we propose the use of sparsemax (Martins & Astudillo, 2016), a sparse mapping consisting in the Euclidean projection of $_ z$ onto the probability simplex:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\mathsf { s p a r s e m a x } ( z ) : = \underset { \pmb { p } \in \triangle ^ { k } } { \arg \operatorname* { m i n } } \frac 1 2 \| \pmb { p } - z \| _ { 2 } ^ { 2 } ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
which allows to obtain sparse outputs with a small increase in complexity. Output sparsity is an attractive property for attention mechanisms, since some features do not provide relevant information for the current prediction. In the image captioning case, using sparsemax allows focusing only on the spatial locations of the image that are relevant to the word being generated, assigning zero attention weight to all other regions.
|
| 46 |
+
|
| 47 |
+
# 2.2 SPARSE AND STRUCTURED VISUAL ATTENTION
|
| 48 |
+
|
| 49 |
+
To generate descriptive captions, the model should identify the objects present in the image. Thus, when generating object-related words, the attention mechanism should assign high weights to the regions of the image containing the object. However, sparsemax is unstructured and index-invariant, leading it to select discontinuous regions. To overcome this, we propose a new visual attention mechanism, TVMAX. TVMAX is a non-trivial generalization of fusedmax (Niculae & Blondel, 2017), a transformation based on fused lasso, to the 2D case. To this end, we first extend fusedmax even more generally, to arbitrary graphs.
|
| 50 |
+
|
| 51 |
+
# 2.2.1 GENERALIZED FUSED LASSO
|
| 52 |
+
|
| 53 |
+
Let $\mathbf { \boldsymbol { w } } \in \mathbb { R } ^ { k }$ , and let $I = \{ 1 , \ldots , k \}$ . Consider a graph over $I$ defined by its edges $E \subseteq I \times I$ , where an edge between $i$ and $j$ means we want to encourage $w _ { i }$ to be close to $w _ { j }$ . For simplicity we use $i \sim j$ as shorthand for $( i , j ) \in E$ .
|
| 54 |
+
|
| 55 |
+
The generalized fused lasso penalty (Tibshirani et al., 2005) is defined as:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\Omega _ { E } ( \pmb { w } ) = \sum _ { i \sim j } | w _ { i } - w _ { j } | .
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
Minimizing $\Omega _ { E }$ encourages “fused” solutions, i.e., it encourages $w _ { i } = w _ { j }$ for $i \sim j$ . In particular, its proximal operator1 can be seen as a fused signal approximator, seeking a vector $\pmb { w }$ that approximates $_ z$ well (in terms of Euclidean distance) and that is encouraged to be fused:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\mathsf { p r o x } _ { \lambda \Omega _ { E } } ( z ) = \underset { { \pmb w } \in \mathbb { R } ^ { d } } { \arg \operatorname* { m i n } } \frac { 1 } { 2 } \| { \pmb w } - { \pmb z } \| ^ { 2 } + \lambda \Omega _ { E } ( { \pmb w } ) .
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
Computing the value of $\mathsf { p r o x } _ { \lambda \Omega _ { E } }$ is non-trivial in general (Xin et al., 2016), but for certain edge configurations, described below, efficient algorithms exist.
|
| 68 |
+
|
| 69 |
+
• If $E$ forms a chain, i.e. $i \sim j \iff i = j - 1$ , the problem is called 1D total variation and can be solved in ${ \mathcal { O } } ( k )$ time using the taut string algorithm (Davies & Kovac, 2001; Barbero & Sra, 2014). We use the quasilinear algorithm of Condat (2013), which is very fast in practice.
|
| 70 |
+
|
| 71 |
+
• If the indices are aligned on a 2D grid, as in an image, and $i \sim j$ holds iff. $j$ is to the right or immediately below $i$ , the problem is called 2D total variation. Unlike the 1D case, exact algorithms are not available. However, for an input of size $a \times b$ , it is possible to split the penalty into $a$ column-wise and $b$ row-wise 1D problems. We may then apply a number of iterative methods, for instance proximal Dykstra (Barbero & Sra, 2014).2
|
| 72 |
+
|
| 73 |
+
# 2.2.2 TVMAX
|
| 74 |
+
|
| 75 |
+
TVMAX combines 2D total variation (TV2D) regularization with sparsemax. This way it promotes sparsity and encourages the attention weights of adjacent spatial locations to be the same, selecting contiguous regions of the image. TVMAX is defined as follows:
|
| 76 |
+
|
| 77 |
+
Definition 1 (TVMAX). Let $z \in \mathbb { R } ^ { k }$ , such that $_ { z }$ ’s indices can be decomposed into rows and columns. The TVMAX transformation is defined as
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathrm { T V M A X } ( z ) : = \operatorname * { a r g m i n } _ { \pmb { p } \in \triangle ^ { k } } \frac { 1 } { 2 } \| \pmb { p } - z \| _ { 2 } ^ { 2 } + \lambda \Omega _ { 2 D } ^ { T V } ( \pmb { p } ) ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $\lambda$ is an hyper-parameter controlling the amount of fusion $\lambda = 0$ recovers sparsemax) and $\Omega _ { 2 D } ^ { T V }$ is a $2 D$ total variation penalty.
|
| 84 |
+
|
| 85 |
+
Note that Eq. 5 differs from Eq. 4 in which the variable $\pmb { p }$ is further constrained to lie in the probability simplex. We show next how the forward and backward passes can be efficiently computed.
|
| 86 |
+
|
| 87 |
+
# 2.2.3 GENERALIZED FUSED SPARSE ATTENTION
|
| 88 |
+
|
| 89 |
+
To construct generalized fused sparse attention, we follow Niculae & Blondel (2017) and define
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\begin{array} { r } { \mathsf { g f u s e d m a x } _ { E } ( z ) : = \underset { p \in \triangle } { \arg \operatorname* { m i n } } \| p - z \| _ { 2 } ^ { 2 } + \lambda \Omega _ { E } ( p ) . } \end{array}
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
This can be seen as a constrained fused lasso approximator, because the solution $\pmb { p }$ must be a probability distribution vector. While the optimization function is very similar to Eq. 4, the additional constraint that $p \in \triangle$ increases complexity. Fortunately, the following result holds:
|
| 96 |
+
|
| 97 |
+
Proposition 1 (Computing generalized fusedmax).
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { r } { \mathsf { g f u s e d m a x } _ { E } ( z ) = \mathsf { p r o j } _ { \triangle } \left( \mathsf { p r o x } _ { \lambda \Omega _ { E } } ( z ) \right) . } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
The proof is given in Appendix A.2.
|
| 104 |
+
|
| 105 |
+
Proposition 1 also provides a shortcut for deriving the Jacobian of generalized fusedmax via the chain rule: denoting by $J _ { F }$ the Jacobian of $\mathsf { p r o x } _ { \lambda \Omega _ { E } }$ , we have
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\frac { \partial \mathtt { g f u s e d m a x } } { \partial z } = J _ { \mathtt { g f u s e d m a x } } = J _ { \mathtt { s p a r s e m a x } } ( \mathsf { p r o x } _ { \lambda \Omega _ { E } } ( z ) ) J _ { F } ( z ) .
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
As we already know how to compute $J _ { \mathsf { s p a r s e m a x } }$ (Appendix A.1), we may concentrate our effort on deriving the simpler $J _ { F }$ (Eq. 9).
|
| 112 |
+
|
| 113 |
+
Proposition 2 (Group-wise characterization of $\mathsf { p r o x } _ { \lambda \Omega _ { E } } ,$ ). Let $\boldsymbol { w } ^ { \star } : = \mathsf { p r o x } _ { \lambda \Omega _ { E } }$ , and denote by $G _ { i }$ the set of indices fused to $w _ { i }$ in the solution, $G _ { i }$ may be defined recursively:
|
| 114 |
+
|
| 115 |
+
1. $i \in G _ { i }$ for all $i$ , and
|
| 116 |
+
|
| 117 |
+
2. $j \in G _ { i }$ if there exists $m \in G _ { i }$ such that $m \sim j$ and $w _ { m } ^ { \star } = w _ { j } ^ { \star }$ .
|
| 118 |
+
|
| 119 |
+
Define $s _ { i j } = \mathsf { s i g n } ( w _ { i } ^ { \star } - w _ { j } ^ { \star } )$ . Then, the solution has the expression
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
w _ { i } ^ { \star } = \frac { 1 } { | G _ { i } | } \sum _ { j \in G _ { i } } \left( z _ { j } + \sum _ { \stackrel { m \sim j } { m \ll G _ { i } } } \lambda s _ { m j } - \sum _ { \stackrel { j \sim m } { m \ll G _ { i } } } \lambda s _ { j m } \right) .
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
Proposition 2 shows how to easily compute a generalized Jacobian of gfusedmax: since small perturbations in $_ { z }$ never change the groups $G _ { i }$ nor the signs of across-group differences $s _ { i j }$ , differentiating Eq. 8 yields
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\pmb { J } _ { F i , j } = \frac { \partial \pmb { w } _ { i } ^ { \star } } { \partial z _ { j } } = \left\{ \frac { 1 } { | \pmb { G } _ { i } | } , \quad j \in G _ { i } , \right.
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
This generalizes Lemma 1 of Niculae & Blondel (2017) to generalized fused lasso, with a simpler proof, given in Appendix A.3.
|
| 132 |
+
|
| 133 |
+
# 2.2.4 COMPUTATION
|
| 134 |
+
|
| 135 |
+
As we show in Proposition 1, computing TVMAX’s forward pass can be done by chaining efficient algorithms for TV2D and sparsemax.
|
| 136 |
+
|
| 137 |
+
From Eq. 7 we have that TVMAX’s Jacobian can be computed as $\begin{array} { r l } { J _ { \mathrm { T V M A X } } } & { { } = } \end{array}$ $J _ { \mathrm { s p } } ( \mathsf { p r o x } _ { \lambda \Omega _ { 2 D } ^ { T V } } ( z ) ) J _ { \mathrm { t v } } ( z )$ , where $J _ { \mathrm { s p } }$ is the sparsemax’s Jacobian and $\scriptstyle J _ { \mathrm { t v } }$ is the Jacobian of the Total Variation proximal operator.3 As derived in Proposition 2, $( J _ { \mathrm { t v } } ) _ { i , j } = 1 / n _ { i j }$ if $i$ and $j$ are fused in a group with $n _ { i j }$ elements, and 0 otherwise.
|
| 138 |
+
|
| 139 |
+
The backward pass intuitively involves ”spreading�� the credit assigned to one image location evenly across all locations fused with it. This can be implemented by Algorithm 1 in $\mathcal { O } ( k + N _ { g } \log k )$ where $N _ { g }$ is the number of groups of fused positions. In the worst case, when there are no positions fused, the complexity is $\mathcal { O } ( k + k \log k )$ . This algorithm is inspired by flood filling algorithms (Burtsev & Kuzmin, 1993).
|
| 140 |
+
|
| 141 |
+
Algorithm 1 TVMAX backward pass (Jacobian-vector products)
|
| 142 |
+
|
| 143 |
+
<table><tr><td> Input: p = TVMAX(z),dp ∈ Rk.</td><td></td></tr><tr><td> Output: dz = JTvmAx(dp) ∈ Rk</td><td>#chainrule</td></tr><tr><td>3 Initialize:N←</td><td>#neighbours stack</td></tr><tr><td>4</td><td># visited positions</td></tr><tr><td>5</td><td># current group</td></tr><tr><td>6</td><td>#intermediate value used for JTvmAx's computation</td></tr><tr><td>7 dw ← (Jsp)T dp</td><td>#Eqs.14 and15 of $A.1</td></tr><tr><td>8 while|V|<k do</td><td>#checkif all positions havebeen visited</td></tr><tr><td>9 pick(io,jo) V,push (io,jo) to N</td><td>#getnot visited position andadd it to neighbours stack</td></tr><tr><td>10 while N not empty do</td><td></td></tr><tr><td>11</td><td>pop (i,j) from N</td></tr><tr><td>12 if pi,j = Pio,jo then</td><td>#checkif element is fused</td></tr><tr><td>13</td><td>G ← GU{(i,j)},V ←VU{(i,j)} #add neighbourto groupandto visited positions</td></tr><tr><td>14</td><td>s ←s+(dw)i,j #sum of the dw of each element of the group</td></tr><tr><td>15</td><td>for all neighbours (i',j')~(i,j) do</td></tr><tr><td>16</td><td>if (i',j') V then push (i’,j') to N</td></tr><tr><td>17</td><td>if G not empty then:</td></tr><tr><td>18</td><td>(dz)i,j ← $/iG| for all (i,j) ∈G</td></tr><tr><td>19</td><td># compute JTvmAx for elements in group G G↑Q</td></tr><tr><td>20</td><td>s=0</td></tr></table>
|
| 144 |
+
|
| 145 |
+
# 3 IMAGE CAPTIONING MODEL
|
| 146 |
+
|
| 147 |
+
To compare the proposed attention mechanisms, we use a straight-forward simple encoder-decoder model with visual attention, inspired by Liu et al. (2018a). The model is sketched in Figure 2.
|
| 148 |
+
|
| 149 |
+
Given an image, we use a residual CNN pretrained on ImageNet (He et al., 2016; Russakovsky et al., 2014) to get a feature map with spatial dimension of size $8 \times 8$ and channel dimension of size 2048, that go through a fine-tuned feedforward layer yielding $g \ = \ 5 1 2$ feature maps. The visual feature matrix $V = [ v _ { 1 } , v _ { 2 } , \ldots , v _ { k } ]$ , with $v _ { i } \in \mathbb { R } ^ { g }$ and $k = 6 4 = 8 \times 8$ , contains the image information used to generate the corresponding caption. Following Liu et al. (2018a), we use input and output attention to select the relevant features for the current generation. To generate the word at position $t$ , the input attention, $\pmb { \alpha } _ { t }$ , is computed using the LSTM’s previous hidden state, $h _ { t - 1 } \in$ $\mathbb { R } ^ { \dot { d } }$ . First, a similarity score $z _ { t , i } , i \in \{ 1 , \ldots , k \}$ , is computed between $\boldsymbol { h } _ { t - 1 }$ and the $i ^ { t h }$ image cell via a feedforward transformation (Bahdanau et al., 2015), as $z _ { t , i } = { w ^ { \top } } \mathrm { t a n h } \big ( \mathsf { a f f i n e } ( [ v _ { i } ; h _ { t - 1 } ] ) \big )$ , for all $k$ image cells. Then, $\pmb { \alpha } _ { t }$ is obtained by normalizing the $k$ -dimensional vector of scores ${ \boldsymbol { z } } _ { t }$ with softmax, $\pmb { \alpha } _ { t } = \mathsf { s o f t m a x } ( z _ { t } )$ . Using these attention weights, a vector representation of the image to be used as input of the LSTM, is obtained, $s _ { t } ~ = ~ V \alpha _ { t }$ . The output attention $\widetilde { \alpha } _ { t }$ , is computed in the same way as above, but applied to the current LSTM hidden state $\boldsymbol { h } _ { t }$ , instead of $\boldsymbol { h } _ { t - 1 }$ , and normalized with the different proposed transformations. This produces output visual features $\widetilde { \pmb { s } } _ { t } = \pmb { V } \widetilde { \pmb { \alpha } } _ { t }$ , which are passed through a feedforward layer to yield the image representation ${ r } _ { t } = \mathrm { t a n h } \big ( \mathsf { a f f i n e } ( \widetilde { \pmb { s } } _ { t } ) \big )$ . Finally, the predictive probability of the next word is:
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
P ( y _ { t } \mid y _ { 1 : ( t - 1 ) } ; \mathrm { I m a g e } ) \propto \mathsf { s o f t m a x } ( \mathsf { a f f i n e } ( [ r _ { t } ; h _ { t } ] ) ) .
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 2: Diagram of the caption generation network.
|
| 157 |
+
|
| 158 |
+
# 4 EXPERIMENTS
|
| 159 |
+
|
| 160 |
+
Settings. The input images are resized to $2 5 6 \times 2 5 6$ before going through the residual CNN and the feature maps obtained have a size of $8 \times 8$ . We use an LSTM hidden size of $d = 5 1 2$ and a word embedding size of 256, for all models. The models were trained for 50 epochs using the Adam optimizer (Kingma & Ba, 2014) with a learning rate of 0.0001 and a decay of 0.8 and 0.999 for the first and second momentum, respectively. After the $1 0 ^ { t h }$ epoch, the learning rate starts decaying with a decay factor of 0.99. For TVMAX, we set $\lambda = 0 . 0 1$ .
|
| 161 |
+
|
| 162 |
+
Datasets and Metrics. We report our results on the Microsoft COCO (MSCOCO) and Flickr30k datasets. MSCOCO is composed of 113,287 images of common objects in context while Flickr30k consists in 31,000 pictures of people involved in everyday activities and events. Each image is annotated with 5 captions. We use the split proposed by Karpathy & Fei-Fei (2015), which stipulates equal validation and test sizes of 5,000 images (MSCOCO) and 1,000 (Flickr30k). The metrics we report are SPICE (Anderson et al., 2016), CIDEr (Vedantam et al., 2015), longest common subsequence ROUGE, (denoted $\mathrm { R O U G E } _ { L }$ ; Lin, 2004), $1 -$ to 4–gram BLEU (denoted $\mathrm { B L E U _ { 4 } }$ ; Papineni et al., 2002), and METEOR (Banerjee & Lavie, 2005). To investigate whether selective attention alleviates repetition, we also measure the n-gram repetition metric REP (Malaviya et al., 2018).
|
| 163 |
+
|
| 164 |
+
Table 1: Automatic evaluation of caption generation on MSCOCO and Flickr30k.
|
| 165 |
+
|
| 166 |
+
<table><tr><td></td><td colspan="5">MSCOCO</td><td colspan="6">Flickr30k</td></tr><tr><td>SPICE CIDER ROUGEL BLEU4 METEOR REP↓</td><td></td><td></td><td></td><td></td><td></td><td></td><td>SPICE CIDER ROUGEL BLEU4 METEOR REP↓</td><td></td><td></td><td></td><td></td></tr><tr><td>softmax</td><td>18.4</td><td>0.967</td><td>52.9</td><td>29.9</td><td>24.9</td><td>3.76</td><td>13.5 0.443</td><td>44.2</td><td>19.9</td><td>19.1</td><td>6.09</td></tr><tr><td>sparsemax</td><td>18.9</td><td>0.990</td><td>53.5</td><td>31.5</td><td>25.3 3.69</td><td>13.7</td><td>0.444</td><td>44.3</td><td>20.7</td><td>19.3</td><td>5.84</td></tr><tr><td>TVMAX</td><td>18.5</td><td>0.974</td><td>53.1</td><td>29.9</td><td>25.1</td><td>3.17</td><td>13.3 0.438</td><td>44.2</td><td>20.5</td><td>19.0</td><td>3.97</td></tr></table>
|
| 167 |
+
|
| 168 |
+
Automated metrics. As can be seen in table 1, overall sparsemax and TVMAX attention mechanisms achieve better results when compared with softmax, indicating that the use of selective attention leads to better captions. This improvement does not come at a high computational cost: at inference time, models using TVMAX and sparsemax are only $1 . 3 \mathrm { x }$ and $1 . 1 \mathrm { x }$ slower than softmax. Moreover, for TVMAX, automatic metrics results are slightly worse than sparsemax but still superior to softmax on MSCOCO and similar on Flickr30k. We show next that this is compensated with fewer repetitions and higher scores in the human evaluation of the captions and attention relevance.
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Figure 3: Example of captions generated using softmax (top), sparsemax (middle) and TVMAX attention (bottom). Shading denotes the attention weight, with white for zero attention. The darker the green is, the higher the attention weight is. The full sequences are presented in Appendix C.
|
| 172 |
+
|
| 173 |
+
Table 2: Human evaluation results with different attention mechanisms on MSCOCO.
|
| 174 |
+
|
| 175 |
+
<table><tr><td></td><td>CAPTION (1-5)</td><td>ATTENTION RELEVANCE(1-5)</td></tr><tr><td>softmax</td><td>3.50</td><td>3.38</td></tr><tr><td>sparsemax</td><td>3.71</td><td>3.89</td></tr><tr><td>TVMAX</td><td>3.87</td><td>4.10</td></tr></table>
|
| 176 |
+
|
| 177 |
+
Human rating. The caption evaluation consisted in attributing a score from 1 to 5 to the caption of each model while the attention evaluation consisted in scoring the relevancy of the attended areas, from 1 to 5, when generating the non stop words of the captions. A full description of the human assessment can be found in Appendix B.
|
| 178 |
+
|
| 179 |
+
Despite performing slightly worse than sparsemax under automated metrics, TVMAX outperforms sparsemax and softmax in the caption human evaluation and the attention relevance human evaluation, reported in Table 2. The superior score on attention relevance shows that TVMAX is better at selecting the relevant features and its output is more interpretable. Additionally, the better caption evaluation results demonstrate that the ability to select compact regions induces the generation of better captions. We next explore possible explanations for the TVMAX superior results.
|
| 180 |
+
|
| 181 |
+
Repetition. Figure 1 illustrates that softmax attention is prone to spuriously repeating references to the same object. Selective attention mechanisms like sparsemax and especially TVMAX reduce repetition, as measured by the REP metric reported in Table 1. This expected success can be attributed to the sparsity of the attention weights distribution and to the ability to select compact regions exclusively and can be one of the causes of the human evaluation results. This happens even though TVMAX generates longer sentences than sparsemax and softmax (9.5 against 9.0 words on average) and shows the benefit of promoting structured and sparse attention simultaneously. To corroborate our intuition that sparsity leads to less repetition, we measured the Jensen-Shannon divergence (JS) between the attention distributions for each step of the generation of the captions correspondent to the images of the MSCOCO test set. The mean JS values are 0.12, 0.29, and 0.34 for softmax, sparsemax, and TVmax, respectively. This shows that sparsity leads to less similar attention distributions along the generation of the captions and, consequently, to less repetitions.
|
| 182 |
+
|
| 183 |
+
Object detection. Using the MSCOCO object detection ground truth, we compared the percentage of objects present in the image that are referred to in the captions, using each attention mechanism. With TVMAX $2 8 . 2 \%$ of the reference objects are referred, against $2 7 . 5 \%$ and $2 7 . 4 \%$ for sparsemax and softmax, repectively. This shows that promoting high attention to groups of spatial locations of the image leads to a more precise identification of the objects.
|
| 184 |
+
|
| 185 |
+
Sparsity. The average image area that receives zero attention is $3 4 \%$ for sparsemax and $2 5 \%$ for TVMAX. To illustrate where the models attend to, we display the output attention in Figures 1 and 3. As expected, softmax weights are spread widely across the image, ending up missing the relevant regions. In contrast, sparsemax and TVMAX weights are zero for the non-relevant spatial locations.
|
| 186 |
+
|
| 187 |
+
Qualitative comparison. As the image of Figure 1 contains various similar objects, the softmax model (top) generates a incoherent, repetition-laden caption. In contrast, the sparsemax (middle) and TVMAX (bottom) models better identify the relevant parts of the image, generating coherent and descriptive captions. Moreover, the groups obtained with TVMAX are clearly visible and more aligned to object boundaries, offering better interpretability, as revealed by human attention assessment. In Figure 3 it can also be noticed that with TVMAX (bottom) the model correctly identified “a group of people” instead of “a soccer player” as with sparsemax (middle) and softmax (top). This indicates its superior ability to correctly define the relevant groups of features and that this ability leads to improved captions.
|
| 188 |
+
|
| 189 |
+
# 5 RELATED WORK
|
| 190 |
+
|
| 191 |
+
Image captioning. In the last years, neural models with visual attention mechanisms have been receiving increased interest. Several researchers have been studying diverse attention mechanisms in order to refine visual information for image captioning. Xu et al. (2015) proposed the use of hard attention, which only attends to one region at each step. However, to generate descriptive captions the model should, often, focus on more than one region. In addition, hard attention is non-differentiable, requiring imitation learning or Monte Carlo policy gradient approximations.Anderson et al. (2018) proposed bottom-up attention, using an object detection model designed to identify bounding boxes of objects, and top-down attention, selecting the relevant bounding-boxes. Wang et al. (2019) proposed an hierarchical attention network composed by a patch detector, object detector, and concept detector. Using object detection models is less demanding on the attention mechanism, since it only has to select the boxes the model should attend to. However, such models are limited by the bounding boxes position’s accuracy. Gao et al. (2019) introduced a deliberate attention network to refine the attended visual features. Yet, the attention distribution remained dense.
|
| 192 |
+
|
| 193 |
+
Sparse attention. In several tasks only a few features are relevant for the current prediction. This can be attained when using sparse attention. Various prior works have proposed sparse attention mechanisms with promising results, (Xu et al., 2015; Martins & Astudillo, 2016; Malaviya et al., 2018; Peters et al., 2019). Niculae & Blondel (2017) proposed 1D fusedmax, which incorporates the fused lasso, so that adjacent words are encouraged to have the same attention weight. In this work, the authors were able to improve interpretability without sacrificing performance, obtaining superior results on textual entailment and summarization. We derive a generalized fused attention mechanism, extending 1D fusedmax.
|
| 194 |
+
|
| 195 |
+
# 6 CONCLUSIONS AND FUTURE WORK
|
| 196 |
+
|
| 197 |
+
We propose using sparse and structured visual attention, in order to improve the process of selecting the features relevant to the caption generation. For that, we used sparsemax and introduced TVMAX. Results on the image captioning task, show that the attention mechanism is able to select better
|
| 198 |
+
|
| 199 |
+
features when using sparsemax or TVMAX. Furthermore, in the human assessment and attention analysis we see that the improved selection of the relevant features as well as the ability to group spatial features lead to the generation of better captions, while improving the model’s interpretability.
|
| 200 |
+
|
| 201 |
+
In future work, TVMAX attention can be applied to other multimodal problems such as visual question answering. It can also be applied in other tasks for which we have prior knowledge of the data’s stucture, for instance graphs or trees.
|
| 202 |
+
|
| 203 |
+
# REFERENCES
|
| 204 |
+
|
| 205 |
+
Peter Anderson, Basura Fernando, Mark Johnson, and Stephen Gould. SPICE: Semantic propositional image caption evaluation. In Proc. ECCV, 2016.
|
| 206 |
+
|
| 207 |
+
Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. Bottom-up and top-down attention for image captioning and visual question answering. In Proc. CVPR, 2018.
|
| 208 |
+
|
| 209 |
+
Francis Bach, Rodolphe Jenatton, Julien Mairal, Guillaume Obozinski, et al. Optimization with sparsity-inducing penalties. Foundations and Trends $\textsuperscript { \textregistered }$ in Machine Learning, 4(1):1–106, 2012.
|
| 210 |
+
|
| 211 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Proc. ICLR, 2015.
|
| 212 |
+
|
| 213 |
+
Satanjeev Banerjee and Alon Lavie. METEOR: An automatic metric for MT evaluation with improved correlation with human judgments. In Proc. ACL Workshop on Intrinsic and Extrinsic Evaluation Measures for Machine Translation and/or Summarization, 2005.
|
| 214 |
+
|
| 215 |
+
Alvaro Barbero and Suvrit Sra. Modular proximal optimization for multidimensional total-variation ´ regularization. preprint arXiv:1411.0589, 2014.
|
| 216 |
+
|
| 217 |
+
Sergei Burtsev and Ye.P. Kuzmin. An efficient flood-filling algorithm. Computers & Graphics, 17: 549–561, 09 1993.
|
| 218 |
+
|
| 219 |
+
Sumit Chopra, Michael Auli, and Alexander M Rush. Abstractive sentence summarization with attentive recurrent neural networks. In Proc. NAACL-HLT, 2016.
|
| 220 |
+
|
| 221 |
+
Jan K Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk, Kyunghyun Cho, and Yoshua Bengio. Attention-based models for speech recognition. In Proc. NeurIPS, 2015.
|
| 222 |
+
|
| 223 |
+
Laurent Condat. A direct algorithm for 1-d total variation denoising. IEEE Signal Processing Letters, 20(11):1054–1057, 2013.
|
| 224 |
+
|
| 225 |
+
P. Laurie Davies and Arne Kovac. Local extremes, runs, strings and multiresolution. The Annals of Statistics, 29(1):1–48, 2001. ISSN 00905364.
|
| 226 |
+
|
| 227 |
+
Ali Farhadi, Mohsen Hejrati, Mohammad Amin Sadeghi, Peter Young, Cyrus Rashtchian, Julia Hockenmaier, and David Forsyth. Every picture tells a story: Generating sentences from images. In Proc. ECCV, 2010.
|
| 228 |
+
|
| 229 |
+
Jerome Friedman, Trevor Hastie, Holger Hofling, and Robert Tibshirani. Pathwise coordinate opti- ¨ mization. The Annals of Applied Statistics, 1(2):302–332, 2007.
|
| 230 |
+
|
| 231 |
+
Lianli Gao, Kaixuan Fan, Jingkuan Song, Xianglong Liu, Xing Xu, and Heng Tao Shen. Deliberate attention networks for image captioning. 2019.
|
| 232 |
+
|
| 233 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proc. CVPR, 2016.
|
| 234 |
+
|
| 235 |
+
Andrej Karpathy and Li Fei-Fei. Deep visual-semantic alignments for generating image descriptions. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2015.
|
| 236 |
+
|
| 237 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. preprint arXiv:1412.6980, 2014.
|
| 238 |
+
|
| 239 |
+
Girish Kulkarni, Visruth Premraj, Sagnik Dhar, Siming Li, Yejin Choi, Alexander C Berg, and Tamara L Berg. Baby talk: Understanding and generating image descriptions. In Proc. CVPR, 2011.
|
| 240 |
+
|
| 241 |
+
Chin-Yew Lin. ROUGE: A package for automatic evaluation of summaries. Text Summarization Branches Out, 2004.
|
| 242 |
+
|
| 243 |
+
Fenglin Liu, Xuancheng Ren, Yuanxin Liu, Houfeng Wang, and Xu Sun. simNet: Stepwise imagetopic merging network for generating detailed and comprehensive image captions. Preprint arXiv:1808.08732, 2018a.
|
| 244 |
+
|
| 245 |
+
Xihui Liu, Hongsheng Li, Jing Shao, Dapeng Chen, and Xiaogang Wang. Show, tell and discriminate: Image captioning by self-retrieval with partially labeled data. preprint arXiv:1803.08314, 2018b.
|
| 246 |
+
|
| 247 |
+
Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. Neural baby talk. In Proc. CVPR, 2018.
|
| 248 |
+
|
| 249 |
+
Chaitanya Malaviya, Pedro Ferreira, and Andre FT Martins. Sparse and constrained attention for ´ neural machine translation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 370–376, 2018.
|
| 250 |
+
|
| 251 |
+
Andre Martins and Ramon Astudillo. From softmax to sparsemax: A sparse model of attention and multi-label classification. In Maria Florina Balcan and Kilian Q. Weinberger (eds.), Proc. ICML, 20–22 Jun 2016.
|
| 252 |
+
|
| 253 |
+
Vlad Niculae and Mathieu Blondel. A regularized framework for sparse and structured neural attention. In Proc. NeurIPS, 2017.
|
| 254 |
+
|
| 255 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. BLEU: a method for automatic evaluation of machine translation. In Proc. ACL, 2002.
|
| 256 |
+
|
| 257 |
+
Ben Peters, Vlad Niculae, and Andre FT Martins. Sparse sequence-to-sequence models. ´ In Proc. ACL, 2019.
|
| 258 |
+
|
| 259 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. Imagenet large scale visual recognition challenge, 2014.
|
| 260 |
+
|
| 261 |
+
Robert Tibshirani, Michael Saunders, Saharon Rosset, Ji Zhu, and Keith Knight. Sparsity and smoothness via the fused lasso. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 67(1):91–108, 2005.
|
| 262 |
+
|
| 263 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proc. NeurIPS, 2017.
|
| 264 |
+
|
| 265 |
+
Ramakrishna Vedantam, C Lawrence Zitnick, and Devi Parikh. CIDEr: Consensus-based image description evaluation. In Proc. CVPR, 2015.
|
| 266 |
+
|
| 267 |
+
Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. Show and tell: A neural image caption generator. In Proc. CVPR, 2015.
|
| 268 |
+
|
| 269 |
+
Weixuan Wang, Zhihong Chen, and Haifeng Hu. Hierarchical attention network for image captioning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 8957–8964, 2019.
|
| 270 |
+
|
| 271 |
+
Bo Xin, Yoshinobu Kawahara, Yizhou Wang, Lingjing Hu, and Wen Gao. Efficient generalized fused lasso and its applications. ACM Trans. Intell. Syst. Technol., 7(4):60:1–60:22, May 2016. ISSN 2157-6904.
|
| 272 |
+
|
| 273 |
+
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhudinov, Rich Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In Proc. ICML, 2015.
|
| 274 |
+
|
| 275 |
+
Yaoliang Yu. On decomposing the proximal map. In Proc. NeurIPS, 2013.
|
| 276 |
+
|
| 277 |
+
# A FORWARD AND BACKWARD PASS OF 2D FUSEDMAX ATTENTION.
|
| 278 |
+
|
| 279 |
+
# A.1 PRELIMINARIES
|
| 280 |
+
|
| 281 |
+
The proximal operator of a function $f \colon { \mathbb { R } ^ { d } } \to { \mathbb { R } \cup \{ \infty \} }$ is defined as
|
| 282 |
+
|
| 283 |
+
$$
|
| 284 |
+
{ \sf p r o x } _ { f } ( z ) = \underset { { \pmb w } \in \mathbb { R } ^ { d } } { \arg \operatorname* { m i n } } f ( z ) + \frac { 1 } { 2 } \| z - { \pmb w } \| _ { 2 } ^ { 2 } ,
|
| 285 |
+
$$
|
| 286 |
+
|
| 287 |
+
and it is guaranteed to have a unique solution, thanks to the strong convexity of the Euclidean distance.
|
| 288 |
+
|
| 289 |
+
The indicator function of a set $\mathcal { C } \subset \mathbb { R } ^ { d }$ is the function
|
| 290 |
+
|
| 291 |
+
$$
|
| 292 |
+
\iota _ { \mathcal { C } } \colon \mathbb { R } ^ { d } \to \mathbb { R } \cup \{ \infty \} , \quad \iota _ { \mathcal { C } } ( \pmb { w } ) : = \left\{ \begin{array} { l l } { 0 , } & { \pmb { w } \in \mathcal { C } , } \\ { \infty , } & { \pmb { w } \notin \mathcal { C } . } \end{array} \right.
|
| 293 |
+
$$
|
| 294 |
+
|
| 295 |
+
The projection onto a convex set $\mathcal { C } \subset \mathbb { R } ^ { d }$ is defined as
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
\mathsf { p r o j } _ { \mathcal { C } } ( z ) : = \mathop { \arg \operatorname* { m i n } } _ { \pmb { w } \in \mathcal { C } } \frac { 1 } { 2 } \| z - \pmb { w } \| _ { 2 } ^ { 2 } = \mathsf { p r o x } _ { \iota _ { \mathcal { C } } } ( z ) ,
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
showing that the proximal operator can be seen as a generalization of projection.
|
| 302 |
+
|
| 303 |
+
The sparsemax attention mapping (Martins & Astudillo, 2016) is the projection onto the simplex,
|
| 304 |
+
|
| 305 |
+
$$
|
| 306 |
+
{ \mathsf { s p a r s e m a x } } ( z ) : = { \mathsf { p r o j } } _ { \triangle } ( z ) = \operatorname * { a r g m i n } _ { p \in { \triangle } } { \frac { 1 } { 2 } } \| p - z \| ^ { 2 } .
|
| 307 |
+
$$
|
| 308 |
+
|
| 309 |
+
A necessary component for using sparsemax for attention is its Jacobian, the matrix of its partial derivatives $\begin{array} { r } { ( J _ { \mathsf { s p a r s e m a x } } ) _ { i , j } = \frac { \partial \mathsf { s p a r s e m a x } ( z ) _ { i } } { \partial z _ { j } } } \end{array}$ ∂ sparsemax(z)i . Martins & Astudillo (2016) derive its expression
|
| 310 |
+
|
| 311 |
+
$$
|
| 312 |
+
\boldsymbol { J } _ { \mathsf { s p a r s e m a x } } ( z ) = \mathsf { d i a g } s - \frac { 1 } { \| s \| _ { 1 } } \pmb { s } \pmb { s } ^ { \top } ,
|
| 313 |
+
$$
|
| 314 |
+
|
| 315 |
+
where $s _ { j } = 1$ if sparsemax $( z ) _ { j } > 0$ and $s _ { j } = 0$ otherwise.
|
| 316 |
+
|
| 317 |
+
# A.2 PROOF OF PROPOSITION 1
|
| 318 |
+
|
| 319 |
+
Proof. This result is a slight extension of Proposition 2 in Niculae & Blondel (2017), and also follows from Corrolary 4 of Yu (2013), by taking $f = \iota _ { \triangle }$ , and noting that $\iota \triangle$ is symmetric: if $p \in \triangle$ , then any vector $\pmb { p } ^ { \prime }$ obtained by permuting $\pmb { p }$ is also in $\triangle$ , because its values remain nonnegative and sum to 1. □
|
| 320 |
+
|
| 321 |
+
# A.3 PROOF OF PROPOSITION 2
|
| 322 |
+
|
| 323 |
+
Let $\boldsymbol { w } ^ { \star } : = \mathsf { p r o x } _ { \lambda \Omega _ { E } }$ , and denote by $G _ { i }$ the set of indices fused to $w _ { i }$ in the solution. Define $s _ { i j } =$ $\mathsf { s i g n } ( w _ { i } ^ { \star } - w _ { j } ^ { \star } )$ .
|
| 324 |
+
|
| 325 |
+
Proof. The subgradient optimality conditions of Eq. 4 are: (Friedman et al., 2007)
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
w _ { i } ^ { \star } - z _ { i } + \sum _ { k : i \sim k } \lambda t _ { i k } - \sum _ { k : k \sim i } \lambda t _ { k i } = 0 , \quad \quad 1 \leq i \leq d .
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
where $t _ { i j } = \mathsf { s i g n } ( w _ { i } ^ { \star } - w _ { j } ^ { \star } )$ if $w _ { i } ^ { \star } \neq w _ { j } ^ { \star }$ , otherwise $t _ { i j }$ is a free variable in $[ - 1 , 1 ]$ .
|
| 332 |
+
|
| 333 |
+
We focus on a single group $G = G _ { i }$ , dropping the index $i$ for brevity. Within a fused group, the solution is constant, i.e., $w _ { j } ^ { \star } = w$ for $j \in G$ . We separate the sums in Eq. 16 according to whether $k \in G$ or not, and move the “constant” terms to the right hand side, yielding the system
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
w + \sum _ { j \sim k } \lambda t _ { j k } - \sum _ { k \sim j \atop k \in G } \lambda t _ { k j } = z _ { j } + \sum _ { \stackrel { k \sim j } { k \notin G } } \lambda s _ { k j } - \sum _ { j \sim k } \lambda s _ { j k } , \qquad j \in G .
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
Summing up the Eq. 17 over all $j \in G$ , we observe that for any $k \in G$ , the term $\lambda t _ { j k }$ appears twice with opposite signs. Thus,
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
\sum _ { j \in G } w = \sum _ { j \in G } \left( z _ { j } + \sum _ { \stackrel { k \sim j } { k \notin G } } \lambda s _ { k j } - \sum _ { j \stackrel { \sim k } { k \notin G } } \lambda s _ { j k } \right) .
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
Dividing by $| G |$ gives exactly Eq. 8. This reasoning applies to any group $G _ { i }$
|
| 346 |
+
|
| 347 |
+
# B HUMAN EVALUATION DESCRIPTION
|
| 348 |
+
|
| 349 |
+
To perform the human evaluation firstly 100 images were randomly selected from the test set of the MSCOCO dataset (using the split proposed by Karpathy & Fei-Fei (2015)). For each of the selected images, the human evaluators selected a score from 1 to 5 for the captions generated by the models using softmax attention, sparsemax attention, and TVMAX attention. They were also asked to evaluate whether the models attend to the relevant regions of the image when generating a certain word. For that they observed the attention plots corresponding to the non stop words of the caption of each of the models. While in Figures 1 and 3, 4, and 5 we emphasized sparsity with a hard white mask, for the human evaluation the sparse regions of the attention plots were simply fully transparent, to avoid biasing the evaluators. The possible scores were also between 1 and 5. The 100 images were judged by 6 persons both for the captions evaluation and attention evaluation. The order of the captions and attention plots was randomly chosen for each image.
|
| 350 |
+
|
| 351 |
+
With these scores, we computed the mean of the captions evaluation scores and the mean of the attention relevance evaluation scores. The results are reported in Table 2.
|
| 352 |
+
|
| 353 |
+
# C ADDITIONAL ATTENTION VISUALIZATION
|
| 354 |
+
|
| 355 |
+

|
| 356 |
+
Figure 4: Example generated captions using softmax attention (top), sparsemax attention (middle) and TVMAX attention (bottom). The captions are “A bowl of fruit and a bowl of fruit”, “A bowl of fruit and oranges on a table” and “A bowl of oranges and a banana on a table”.
|
| 357 |
+
|
| 358 |
+

|
| 359 |
+
Figure 5: Example generated captions using softmax attention (top), sparsemax attention (middle) and TVMAX attention (bottom). The captions are “A soccer player is running to the base”, “A soccer player is running to the field” and “A group of people playing soccer on a field”.
|
md/train/r1rhWnZkg/r1rhWnZkg.md
ADDED
|
@@ -0,0 +1,424 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HADAMARD PRODUCT FOR LOW-RANK BILINEAR POOLING
|
| 2 |
+
|
| 3 |
+
Jin-Hwa Kim
|
| 4 |
+
Interdisciplinary Program in Cognitive Science
|
| 5 |
+
Seoul National University
|
| 6 |
+
Seoul 08826, Republic of Korea
|
| 7 |
+
jhkim@bi.snu.ac.kr
|
| 8 |
+
Kyoung-Woon On
|
| 9 |
+
School of Computer Science and Engineering
|
| 10 |
+
Seoul National University
|
| 11 |
+
Seoul 08826, Republic of Korea
|
| 12 |
+
kwon@bi.snu.ac.kr
|
| 13 |
+
|
| 14 |
+
Woosang Lim School of Computing, KAIST Daejeon 34141, Republic of Korea quasar17@kaist.ac.kr
|
| 15 |
+
|
| 16 |
+
Jeonghee Kim & Jung-Woo Ha NAVER LABS Corp. & NAVER Corp. Gyeonggi-do 13561, Republic of Korea {jeonghee.kim,jungwoo.ha}@navercorp.com
|
| 17 |
+
|
| 18 |
+
Byoung-Tak Zhang
|
| 19 |
+
School of Computer Science and Engineering & Interdisciplinary Program in Cognitive Science
|
| 20 |
+
Seoul National University & Surromind Robotics
|
| 21 |
+
Seoul 08826, Republic of Korea
|
| 22 |
+
btzhang@bi.snu.ac.kr
|
| 23 |
+
|
| 24 |
+
# ABSTRACT
|
| 25 |
+
|
| 26 |
+
Bilinear models provide rich representations compared with linear models. They have been applied in various visual tasks, such as object recognition, segmentation, and visual question-answering, to get state-of-the-art performances taking advantage of the expanded representations. However, bilinear representations tend to be high-dimensional, limiting the applicability to computationally complex tasks. We propose low-rank bilinear pooling using Hadamard product for an efficient attention mechanism of multimodal learning. We show that our model outperforms compact bilinear pooling in visual question-answering tasks with the state-of-the-art results on the VQA dataset, having a better parsimonious property.
|
| 27 |
+
|
| 28 |
+
# 1 INTRODUCTION
|
| 29 |
+
|
| 30 |
+
Bilinear models (Tenenbaum & Freeman, 2000) provide richer representations than linear models. To exploit this advantage, fully-connected layers in neural networks can be replaced with bilinear pooling. The outer product of two vectors (or Kroneker product for matrices) is involved in bilinear pooling, as a result of this, all pairwise interactions among given features are considered. Recently, a successful application of this technique is used for fine-grained visual recognition (Lin et al., 2015).
|
| 31 |
+
|
| 32 |
+
However, bilinear pooling produces a high-dimensional feature of quadratic expansion, which may constrain a model structure and computational resources. For example, an outer product of two feature vectors, both of which have 1K-dimensionality, produces a million-dimensional feature vector. Therefore, for classification problems, the choice of the number of target classes is severely constrained, because the number of parameters for a standard linear classifier is determined by multiplication of the size of the high-dimensional feature vector and the number of target classes.
|
| 33 |
+
|
| 34 |
+
Compact bilinear pooling (Gao et al., 2016) reduces the quadratic expansion of dimensionality by two orders of magnitude, retaining the performance of the full bilinear pooling. This approximation uses sampling-based computation, Tensor Sketch Projection (Charikar et al., 2002; Pham & Pagh, 2013), which utilizes an useful property that $\Psi ( x \otimes y , h , s ) = \Psi ( x , h , s ) * \Psi ( y , h , s )$ , which means the projection of outer product of two vectors is the convolution of two projected vectors. Here, $\Psi$ is the proposed projection function, and, $h$ and $s$ are randomly sampled parameters by the algorithm.
|
| 35 |
+
|
| 36 |
+
Nevertheless, compact bilinear pooling embraces two shortcomings. One comes from the sampling approach. Compact bilinear pooling relies on a favorable property, $E [ \langle \Psi ( x , h , s ) , \Psi ( y , h , s ) \rangle ] \stackrel { - } { = }$ $\langle { \bar { x } } , y \rangle$ , which provides a basis to use projected features instead of original features. Yet, calculating the exact expectation is computationally intractable, so, the random parameters, $h$ and $s$ are fixed during training and evaluation. This practical choice leads to the second. The projected dimension of compact bilinear pooling should be large enough to minimize the bias from the fixed parameters. Practical choices are 10K and 16K for 512 and 4096-dimensional inputs, respectively (Gao et al., 2016; Fukui et al., 2016). Though, these compacted dimensions are reduced ones by two orders of magnitude compared with full bilinear pooling, such high-dimensional features could be a bottleneck for computationally complex models.
|
| 37 |
+
|
| 38 |
+
We propose low-rank bilinear pooling using Hadamard product (element-wise multiplication), which is commonly used in various scientific computing frameworks as one of tensor operations. The proposed method factors a three-dimensional weight tensor for bilinear pooling into three twodimensional weight matrices, which enforces the rank of the weight tensor to be low-rank. As a result, two input feature vectors linearly projected by two weight matrices, respectively, are computed by Hadamard product, then, followed by a linear projection using the third weight matrix. For example, the projected vector $\mathbf { z }$ is represented by $\mathbf { W } _ { z } ^ { T } ( \mathbf { \bar { W } } _ { \mathbf { x } } ^ { T } \mathbf { x } \circ \mathbf { W } _ { \mathbf { y } } ^ { T } \mathbf { y } )$ , where $\circ$ denotes Hadamard product.
|
| 39 |
+
|
| 40 |
+
We also explore to add non-linearity using non-linear activation functions into the low-rank bilinear pooling, and shortcut connections inspired by deep residual learning (He et al., 2016). Then, we show that it becomes a simple baseline model (Antol et al., 2015) or one-learning block of Multimodal Residual Networks (Kim et al., 2016b) as a low-rank bilinear model, yet, this interpretation has not be done.
|
| 41 |
+
|
| 42 |
+
Our contributions are as follows: First, we propose low-rank bilinear pooling to approximate full bilinear pooling to substitute compact bilinear pooling. Second, Multimodal Low-rank Bilinear Attention Networks (MLB) having an efficient attention mechanism using low-rank bilinear pooling is proposed for visual question-answering tasks. MLB achieves a new state-of-the-art performance, and has a better parsimonious property. Finally, ablation studies to explore alternative choices, e.g. network depth, non-linear functions, and shortcut connections, are conducted.
|
| 43 |
+
|
| 44 |
+
# 2 LOW-RANK BILINEAR MODEL
|
| 45 |
+
|
| 46 |
+
Bilinear models use a quadratic expansion of linear transformation considering every pair of features.
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
f _ { i } = \sum _ { j = 1 } ^ { N } \sum _ { k = 1 } ^ { M } w _ { i j k } x _ { j } y _ { k } + b _ { i } = \mathbf { x } ^ { T } \mathbf { W } _ { i } \mathbf { y } + b _ { i }
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $\mathbf { x }$ and $\mathbf { y }$ are input vectors, ${ \bf W } _ { i } \in \mathbb { R } ^ { N \times M }$ is a weight matrix for the output $f _ { i }$ , and $b _ { i }$ is a bias for the output $f _ { i }$ . Notice that the number of parameters is $L \times ( N \times M + 1 )$ including a bias vector b, where $L$ is the number of output features.
|
| 53 |
+
|
| 54 |
+
Pirsiavash et al. (2009) suggest a low-rank bilinear method to reduce the rank of the weight matrix $\mathbf { W } _ { i }$ to have less number of parameters for regularization. They rewrite the weight matrix as $\mathbf { W } _ { i } =$ $\mathbf { U } _ { i } \mathbf { V } _ { i } ^ { T }$ where $\mathbf { U } _ { i } \in \mathbb { R } ^ { N \times d }$ and $\mathbf { V } _ { i } \in \mathbb { R } ^ { M \times d }$ , which imposes a restriction on the rank of $\mathbf { W } _ { i }$ to be at most $d \leq \operatorname* { m i n } ( N , M )$ .
|
| 55 |
+
|
| 56 |
+
Based on this idea, $f _ { i }$ can be rewritten as follows:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
f _ { i } = \mathbf { x } ^ { T } \mathbf { W } _ { i } \mathbf { y } + b _ { i } = \mathbf { x } ^ { T } \mathbf { U } _ { i } \mathbf { V } _ { i } ^ { T } \mathbf { y } + b _ { i } = \mathbb { 1 } ^ { T } ( \mathbf { U } _ { i } ^ { T } \mathbf { x } \circ \mathbf { V } _ { i } ^ { T } \mathbf { y } ) + b _ { i }
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $\mathbb { 1 } \in \mathbb { R } ^ { d }$ denotes a column vector of ones, and $\circ$ denotes Hadamard product. Still, we need two third-order tensors, $\mathbf { U }$ and $\mathbf { V }$ , for a feature vector f , whose elements are $\{ f _ { i } \}$ . To reduce the order of the weight tensors by one, we replace $\mathbb { 1 }$ with $\mathbf { P } \in \mathbb { R } ^ { d \times c }$ and $b _ { i }$ with $\mathbf { b } \in \mathbb { R } ^ { c }$ , then, redefine as ${ \bf U } \in \mathbb { R } ^ { N \times d }$ and $\mathbf { V } \in \mathbb { R } ^ { M \times d }$ to get a projected feature vector $\mathbf { f } \in \mathbb { R } ^ { c }$ . Then, we get:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\mathbf { f } = \mathbf { P } ^ { T } ( \mathbf { U } ^ { T } \mathbf { x } \circ \mathbf { V } ^ { T } \mathbf { y } ) + \mathbf { b }
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $d$ and $c$ are hyperparameters to decide the dimension of joint embeddings and the output dimension of low-rank bilinear models, respectively.
|
| 69 |
+
|
| 70 |
+
# 3 LOW-RANK BILINEAR POOLING
|
| 71 |
+
|
| 72 |
+
A low-rank bilinear model in Equation 3 can be implemented using two linear mappings without biases for embedding two input vectors, Hadamard product to learn joint representations in a multiplicative way, and a linear mapping with a bias to project the joint representations into an output vector for a given output dimension. Then, we use this structure as a pooling method for deep neural networks. Now, we discuss possible variations of low-rank bilinear pooling based on this model inspired by studies of neural networks.
|
| 73 |
+
|
| 74 |
+
# 3.1 FULL MODEL
|
| 75 |
+
|
| 76 |
+
In Equation 3, linear projections, $U$ and $V$ , can have their own bias vectors. As a result, linear models for each input vectors, $\mathbf { x }$ and $\mathbf { y }$ , are integrated in an additive form, called as full model for linear regression in statistics:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array} { r } { \begin{array} { c } { \mathbf { f } = \mathbf { P } ^ { T } \big ( ( \mathbf { U } ^ { T } \mathbf { x } + \mathbf { b } _ { x } \big ) \circ ( \mathbf { V } ^ { T } \mathbf { y } + \mathbf { b } _ { y } ) \big ) + \mathbf { b } } \\ { = \mathbf { P } ^ { T } ( \mathbf { U } ^ { T } \mathbf { x } \circ \mathbf { V } ^ { T } \mathbf { y } + \mathbf { U } ^ { T } \mathbf { x } + \mathbf { V } ^ { \prime T } \mathbf { y } ) + \mathbf { b } ^ { \prime } . } \\ { \mathbf { J } ^ { \prime T } = \mathrm { d i a g } ( \mathbf { b } _ { y } ) \cdot \mathbf { U } ^ { T } , \mathbf { V } ^ { \prime T } = \mathrm { d i a g } ( \mathbf { b } _ { x } ) \cdot \mathbf { V } ^ { T } , \mathrm { a n d } \ \mathbf { b } ^ { \prime } = \mathbf { b } + \mathbf { P } ^ { T } ( \mathbf { b } _ { x } \circ \mathbf { b } _ { y } ) . } \end{array} } \end{array}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
# 3.2 NONLINEAR ACTIVATION
|
| 83 |
+
|
| 84 |
+
Applying non-linear activation functions may help to increase representative capacity of model. The first candidate is to apply non-linear activation functions right after linear mappings for input vectors.
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\mathbf { f } = \mathbf { P } ^ { T } \big ( \sigma ( \mathbf { U } ^ { T } \mathbf { x } ) \circ \sigma ( \mathbf { V } ^ { T } \mathbf { y } ) \big ) + \mathbf { b }
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $\sigma$ denotes an arbitrary non-linear activation function, which maps any real values into a finite interval, e.g. sigmoid or tanh. If two inputs come from different modalities, statistics of two inputs may be quite different from each other, which may result an interference. Since the gradient with respect to each input is directly dependent on the other input in Hadamard product of two inputs.
|
| 91 |
+
|
| 92 |
+
Additional applying an activation function after the Hadamard product is not appropriate, since activation functions doubly appear in calculating gradients. However, applying the activation function only after the Hadamard product would be alternative choice (We explore this option in Section 5) as follows:
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\mathbf { f } = \mathbf { P } ^ { T } \sigma \big ( \mathbf { U } ^ { T } \mathbf { x } \circ \mathbf { V } ^ { T } \mathbf { y } \big ) + \mathbf { b } .
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
Note that using the activation function in low-rank bilinear pooling can be found in an implementation of simple baseline for the VQA dataset (Antol et al., 2015) without an interpretation of low-rank bilinear pooling. However, notably, Wu et al. (2016c) studied learning behavior of multiplicative integration in RNNs with discussions and empirical evidences.
|
| 99 |
+
|
| 100 |
+
# 3.3 SHORTCUT CONNECTION
|
| 101 |
+
|
| 102 |
+
When we apply two previous techniques, full model and non-linear activation, linear models of two inputs are nested by the non-linear activation functions. To avoid this unfortunate situation, we add shortcut connections as explored in residual learning (He et al., 2016).
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\mathbf { f } = \mathbf { P } ^ { T } \big ( \sigma ( \mathbf { U } ^ { T } \mathbf { x } ) \circ \sigma ( \mathbf { V } ^ { T } \mathbf { y } ) \big ) + h _ { x } ( \mathbf { x } ) + h _ { y } ( \mathbf { y } ) + \mathbf { b }
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $h _ { x }$ and $h _ { y }$ are shortcut mappings. For linear projection, the shortcut mappings are linear mappings. Notice that this formulation is a generalized form of the one-block layered MRN (Kim et al., 2016b). Though, the shortcut connections are not used in our proposed model, as explained in Section 6.
|
| 109 |
+
|
| 110 |
+
# 4 MULTIMODAL LOW-RANK BILINEAR ATTENTION NETWORKS
|
| 111 |
+
|
| 112 |
+
In this section, we apply low-rank bilinear pooling to propose an efficient attention mechanism for visual question-answering tasks, based on the interpretation of previous section. We assumed that inputs are a question embedding vector $\mathbf { q }$ and a set of visual feature vectors $\mathbf { F }$ over $S \times S$ lattice space.
|
| 113 |
+
|
| 114 |
+
# 4.1 LOW-RANK BILINEAR POOLING IN ATTENTION MECHANISM
|
| 115 |
+
|
| 116 |
+
Attention mechanism uses an attention probability distribution $\alpha$ over $S \times S$ lattice space. Here, using low-rank bilinear pooling, $\alpha$ is defined as
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\alpha = \mathrm { s o f t m a x } \Big ( \mathbf { P } _ { \alpha } ^ { T } \big ( \sigma ( \mathbf { U } _ { \mathbf { q } } ^ { T } \mathbf { q } \cdot \mathbb { 1 } ^ { T } ) \circ \sigma ( \mathbf { V } _ { \mathbf { F } } ^ { T } \mathbf { F } ^ { T } ) \big ) \Big )
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
where $\alpha \in \mathbb { R } ^ { G \times S ^ { 2 } }$ , $\mathbf { P } _ { \alpha } \in \mathbb { R } ^ { d \times G }$ , $\sigma$ is a hyperbolic tangent function, ${ \bf U _ { q } } \in \mathbb { R } ^ { N \times d }$ , ${ \bf q } \in \mathbb { R } ^ { N }$ , $\mathbb { 1 } \in \mathbb { R } ^ { S ^ { 2 } }$ , ${ \bf V _ { F } } \in \mathbb { R } ^ { M \times d }$ , and $\mathbf { F } \in \mathbb { R } ^ { S ^ { 2 } \times M }$ . If $G > 1$ , multiple glimpses are explicitly expressed as in Fukui et al. (2016), conceptually similar to Jaderberg et al. (2015). And, the softmax function applies to each row vector of $\alpha$ . The bias terms are omitted for simplicity.
|
| 123 |
+
|
| 124 |
+
# 4.2 MULTIMODAL LOW-RANK BILINEAR ATTENTION NETWORKS
|
| 125 |
+
|
| 126 |
+
Attended visual feature $\hat { \mathbf { v } }$ is a linear combination of $\mathbf { F } _ { i }$ with coefficients $\alpha _ { g , i }$ . Each attention probability distribution $\alpha _ { g }$ is for a glimpse $g$ . For $G > 1$ , $\hat { \mathbf { v } }$ is the concatenation of resulting vectors $\hat { \mathbf { v } } _ { g }$ as
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\hat { \mathbf { v } } = \prod _ { g = 1 } ^ { G } \sum _ { s = 1 } ^ { S ^ { 2 } } \alpha _ { g , s } \mathbf { F } _ { s }
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
where $| |$ denotes concatenation of vectors. The posterior probability distribution is an output of a softmax function, whose input is the result of another low-rank bilinear pooling of $\mathbf { q }$ and $\hat { \mathbf { v } }$ as
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\begin{array} { r } { p ( a | \mathbf { q } , \mathbf { F } ; \Theta ) = \underset { a \in \Omega } { \mathrm { s o f t m a x } } \left( \mathbf { P } _ { o } ^ { T } \big ( \sigma ( \mathbf { W } _ { \mathbf { q } } ^ { T } \mathbf { q } ) \circ \sigma ( \mathbf { V } _ { \hat { \mathbf { v } } } ^ { T } \hat { \mathbf { v } } ) \big ) \right) } \\ { \hat { a } = \underset { a \in \Omega } { \mathrm { a r g m a x } } p ( a | \mathbf { q } , \mathbf { F } ; \Theta ) \quad } \end{array}
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
where $\hat { a }$ denotes a predicted answer, $\Omega$ is a set of candidate answers and $\Theta$ is an aggregation of entire model parameters.
|
| 139 |
+
|
| 140 |
+
# 5 EXPERIMENTS
|
| 141 |
+
|
| 142 |
+
In this section, we conduct six experiments to select the proposed model, Multimodal Low-rank Bilinear Attention Networks (MLB). Each experiment controls other factors except one factor to assess the effect on accuracies. Based on MRN (Kim et al., 2016b), we start our assessments with an initial option of $G = 1$ and shortcut connections of MRN, called as Multimodal Attention Residual Networks (MARN). Notice that we use one embeddings for each visual feature for better performance, based on our preliminary experiment (not shown). We attribute this choice to the attention mechanism for visual features, which provides more capacity to learn visual features. We use the same hyper-parameters of MRN (Kim et al., 2016b), without any explicit mention of this.
|
| 143 |
+
|
| 144 |
+
The VQA dataset (Antol et al., 2015) is used as a primary dataset, and, for data augmentation, question-answering annotations of Visual Genome (Krishna et al., 2016) are used. Validation is performed on the VQA test-dev split, and model comparison is based on the results of the VQA test-standard split. For the comprehensive reviews of VQA tasks, please refer to Wu et al. (2016a) and Kafle & Kanan (2016a). The details about preprocessing, question and vision embedding, and hyperparameters used in our experiments are described in Appendix A. The source code for the experiments is available in Github repository1.
|
| 145 |
+
|
| 146 |
+
Number of Learning Blocks Kim et al. (2016b) argue that three-block layered MRN shows the best performance among one to four-block layered models, taking advantage of residual learning. However, we speculate that an introduction of attention mechanism makes deep networks hard to optimize. Therefore, we explore the number of learning blocks of MARN, which have an attention mechanism using low-rank bilinear pooling.
|
| 147 |
+
|
| 148 |
+
Number of Glimpses Fukui et al. (2016) show that the attention mechanism of two glimpses was an optimal choice. In a similar way, we assess one, two, and four-glimpse models.
|
| 149 |
+
|
| 150 |
+
Table 1: The accuracies of our experimental model, Multimodal Attention Residual Networks (MARN), with respect to the number of learning blocks (L#), the number of glimpse (G#), the position of activation functions (tanh), answer sampling, shortcut connections, and data augmentation using Visual Genome dataset, for VQA test-dev split and Open-Ended task. Note that our proposed model, Multimodal Low-rank Bilinear Attention Networks (MLB) have no shortcut connections, compared with MARN. MODEL: model name, SIZE: number of parameters, ALL: overall accuracy in percentage, Y/N: yes/no, NUM: numbers, and ETC: others. Since Fukui et al. (2016) only report the accuracy of the ensemble model on the test-standard, the test-dev results of their single models are included in the last sector. Some figures have different precisions which are rounded. $^ *$ indicates the selected model for each experiment.
|
| 151 |
+
|
| 152 |
+
<table><tr><td>MODEL</td><td>SIZE</td><td>ALL</td><td>Y/N</td><td>NUM</td><td>ETC</td></tr><tr><td>MRN-L3</td><td>65.0M</td><td>61.68</td><td>82.28</td><td></td><td></td></tr><tr><td>MARN-L3</td><td>65.5M</td><td></td><td>82.31</td><td>38.82</td><td>49.25 50.83</td></tr><tr><td></td><td></td><td>62.37</td><td></td><td>38.06</td><td></td></tr><tr><td>MARN-L2</td><td>56.3M</td><td>63.92</td><td>82.88</td><td>37.98</td><td>53.59</td></tr><tr><td>* MARN-L1</td><td>47.0M</td><td>63.79</td><td>82.73</td><td>37.92</td><td>53.46</td></tr><tr><td>MARN-L1-G1</td><td>47.0M</td><td>63.79</td><td>82.73</td><td>37.92</td><td>53.46</td></tr><tr><td>* MARN-L1-G2</td><td>57.7M</td><td>64.53</td><td>83.41</td><td>37.82</td><td>54.43</td></tr><tr><td>MARN-L1-G4</td><td>78.9M</td><td>64.61</td><td>83.72</td><td>37.86</td><td>54.33</td></tr><tr><td>No Tanh</td><td>57.7M</td><td>63.58</td><td>83.18</td><td>37.23</td><td>52.79</td></tr><tr><td>* Before-Product</td><td>57.7M</td><td>64.53</td><td>83.41</td><td>37.82</td><td>54.43</td></tr><tr><td>After-Product</td><td>57.7M</td><td>64.53</td><td>83.53</td><td>37.06</td><td>54.50</td></tr><tr><td>Mode Answer</td><td>57.7M</td><td>64.53</td><td>83.41</td><td>37.82</td><td>54.43</td></tr><tr><td> * Sampled Answer</td><td>57.7M</td><td>64.80</td><td>83.59</td><td>38.38</td><td>54.73</td></tr><tr><td>Shortcut * No Shortcut</td><td>57.7M 51.9M</td><td>64.80</td><td>83.59</td><td>38.38</td><td>54.73</td></tr><tr><td>MLB</td><td>51.9M</td><td>65.08</td><td>84.14</td><td>38.21</td><td>54.87</td></tr><tr><td>MLB+VG</td><td>51.9M</td><td>65.08 65.84</td><td>84.14 83.87</td><td>38.21 37.87</td><td>54.87</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>56.76</td></tr><tr><td>MCB+Att (Fukui et al., 2016)</td><td>69.2M</td><td>64.2</td><td>82.2</td><td>37.7</td><td>54.8</td></tr><tr><td>MCB+Att+GloVe (Fukui et al., 2016) MCB+Att+Glove+VG (Fukui et al., 2016)</td><td>70.5M 70.5M</td><td>64.7 65.4</td><td>82.5 82.3</td><td>37.6 37.2</td><td>55.6 57.4</td></tr></table>
|
| 153 |
+
|
| 154 |
+
Non-Linearity We assess three options applying non-linearity on low-rank bilinear pooling, vanilla, before Hadamard product as in Equation 5, and after Hadamard product as in Equation 6.
|
| 155 |
+
|
| 156 |
+
Answer Sampling VQA (Antol et al., 2015) dataset has ten answers from unique persons for each question, while Visual Genome (Krishna et al., 2016) dataset has a single answer for each question. Since difficult or ambiguous questions may have divided answers, the probabilistic sampling from the distribution of answers can be utilized to optimize for the multiple answers. An instance 2 can be found in Fukui et al. (2016). We simplify the procedure as follows:
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
\begin{array} { r } { p ( a _ { 1 } ) = \left\{ \begin{array} { l l } { | a _ { 1 } | / { \Sigma _ { i } } | a _ { i } | , } & { \mathrm { i f ~ } | a _ { 1 } | \geq 3 } \\ { 0 , } & { \mathrm { o t h e r w i s e } } \end{array} \right. } \\ { p ( a _ { 0 } ) = 1 - p ( a _ { 1 } ) } \end{array}
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
where $\left| a _ { i } \right|$ denotes the number of unique answer $a _ { i }$ in a set of multiple answers, $a _ { 0 }$ denotes a mode, which is the most frequent answer, and $a _ { 1 }$ denotes the secondly most frequent answer. We define the divided answers as having at least three answers which are the secondly frequent one, for the evaluation metric of VQA (Antol et al., 2015),
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
\begin{array} { r } { \mathrm { a c c u r a c y } ( a _ { k } ) = \operatorname* { m i n } \left( | a _ { k } | / 3 , 1 \right) . } \end{array}
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
Table 2: The VQA test-standard results to compare with state-of-the-art. Notice that these results are trained by provided VQA train and validation splits, without any data augmentation.
|
| 169 |
+
|
| 170 |
+
<table><tr><td rowspan="2">MODEL</td><td colspan="3">Open-Ended</td><td colspan="2">MC</td></tr><tr><td>ALL</td><td>Y/N</td><td>NUM</td><td>ETC</td><td>ALL</td></tr><tr><td>iBOWIMG (Zhou et al., 2015)</td><td>55.89</td><td></td><td>34.98</td><td>42.62</td><td></td></tr><tr><td>DPPnet (Noh et al., 2016)</td><td>57.36</td><td>76.76 80.28</td><td>36.92</td><td>42.24</td><td>61.97 62.69</td></tr><tr><td>Deeper LSTM+Normalized CNN (Antol et al., 2015)</td><td>58.16</td><td>80.56</td><td>36.53</td><td>43.73</td><td>63.09</td></tr><tr><td>SMem (Xu& Saenko,2016)</td><td>58.24</td><td>80.80</td><td>37.53</td><td>43.48</td><td>1</td></tr><tr><td>Ask Your Neurons (Malinowski et al., 2016)</td><td>58.43</td><td>78.24</td><td>36.27</td><td>46.32</td><td></td></tr><tr><td>SAN (Yang et al., 2016)</td><td>58.85</td><td>79.11</td><td>36.41</td><td>46.42</td><td>=</td></tr><tr><td>D-NMN (Andreas et al., 2016)</td><td>59.44</td><td>80.98</td><td>37.48</td><td>45.81</td><td>=</td></tr><tr><td>ACK (Wu et al., 2016b)</td><td>59.44</td><td>81.07</td><td>37.12</td><td>45.83</td><td>=</td></tr><tr><td>FDA (Ilievski et al., 2016)</td><td>59.54</td><td>81.34</td><td></td><td></td><td>=</td></tr><tr><td>HYBRID (Kafle & Kanan,2016b)</td><td>60.06</td><td>80.34</td><td>35.67 37.82</td><td>46.10</td><td>64.18</td></tr><tr><td>DMN+ (Xiong et al., 2016)</td><td>60.36</td><td></td><td></td><td>47.56</td><td>1</td></tr><tr><td></td><td></td><td>80.43</td><td>36.82</td><td>48.33</td><td>1</td></tr><tr><td>MRN (Kim et al., 2016b)</td><td>61.84</td><td>82.39</td><td>38.23</td><td>49.41</td><td>66.33</td></tr><tr><td>HieCoAtt (Lu et al., 2016)</td><td>62.06</td><td>79.95</td><td>38.22</td><td>51.95</td><td>66.07</td></tr><tr><td>RAU (Noh & Han,2016)</td><td>63.2</td><td>81.7</td><td>38.2</td><td>52.8</td><td>67.3</td></tr><tr><td>MLB (ours)</td><td>65.07</td><td>84.02</td><td>37.90</td><td>54.77</td><td>68.89</td></tr></table>
|
| 171 |
+
|
| 172 |
+
The rate of the divided answers is approximately $1 6 . 4 0 \%$ , and only $0 . 2 3 \%$ of questions have more than two divided answers in VQA dataset. We assume that it eases the difficulty of convergence without severe degradation of performance.
|
| 173 |
+
|
| 174 |
+
Shortcut Connection The contribution of shortcut connections for residual learning is explored based on the observation of the competitive performance of single-block layered model. Since the usefulness of shortcut connections is linked to the network depth (He et al., 2016).
|
| 175 |
+
|
| 176 |
+
Data Augmentation The data augmentation with Visual Genome (Krishna et al., 2016) question answer annotations is explored. Visual Genome (Krishna et al., 2016) originally provides 1.7 Million visual question answer annotations. After aligning to VQA, the valid number of question-answering pairs for training is 837,298, which is for distinct 99,280 images.
|
| 177 |
+
|
| 178 |
+
# 6 RESULTS
|
| 179 |
+
|
| 180 |
+
The six experiments are conducted sequentially. Each experiment determines experimental variables one by one. Refer to Table 1, which has six sectors divided by mid-rules.
|
| 181 |
+
|
| 182 |
+
# 6.1 SIX EXPERIMENT RESULTS
|
| 183 |
+
|
| 184 |
+
Number of Learning Blocks Though, MRN (Kim et al., 2016b) has the three-block layered architecture, MARN shows the best performance with two-block layered models $( 6 3 . 9 2 \% )$ . For the multiple glimpse models in the next experiment, we choose one-block layered model for its simplicity to extend, and competitive performance $( 6 3 . 7 9 \% )$ ).
|
| 185 |
+
|
| 186 |
+
Number of Glimpses Compared with the results of Fukui et al. (2016), four-glimpse MARN $( 6 4 . 6 1 \% )$ is better than other comparative models. However, for a parsimonious choice, two-glimpse MARN $( 6 4 . 5 3 \% )$ is chosen for later experiments. We speculate that multiple glimpses are one of key factors for the competitive performance of MCB (Fukui et al., 2016), based on a large margin in accuracy, compared with one-glimpse MARN $( 6 3 . 7 9 \%$ ).
|
| 187 |
+
|
| 188 |
+
Non-Linearity The results confirm that activation functions are useful to improve performances. Surprisingly, there is no empirical difference between two options, before-Hadamard product and after-Hadamard product. This result may build a bridge to relate with studies on multiplicative integration with recurrent neural networks (Wu et al., 2016c).
|
| 189 |
+
|
| 190 |
+
Answer Sampling Sampled answers $( 6 4 . 8 0 \% )$ result better performance than mode answers $( 6 4 . 5 3 \% )$ . It confirms that the distribution of answers from annotators can be used to improve the performance. However, the number of multiple answers is usually limited due to the cost of data collection.
|
| 191 |
+
|
| 192 |
+
Shortcut Connection Though, MRN (Kim et al., 2016b) effectively uses shortcut connections to improve model performance, one-block layered MARN shows better performance without the shortcut connection. In other words, the residual learning is not used in our proposed model, MLB. It seems that there is a trade-off between introducing attention mechanism and residual learning. We leave a careful study on this trade-off for future work.
|
| 193 |
+
|
| 194 |
+
Data Augmentation Data augmentation using Visual Genome (Krishna et al., 2016) question answer annotations significantly improves the performance by $0 . 7 6 \%$ in accuracy for VQA test-dev split. Especially, the accuracy of others (ETC)-type answers is notably improved from the data augmentation.
|
| 195 |
+
|
| 196 |
+
# 6.2 COMPARISON WITH STATE-OF-THE-ART
|
| 197 |
+
|
| 198 |
+
The comparison with other single models on VQA test-standard is shown in Table 2. The overall accuracy of our model is approximately $1 . 9 \%$ above the next best model (Noh & Han, 2016) on the Open-Ended task of VQA. The major improvements are from yes-or-no (Y/N) and others (ETC)- type answers. In Table 3, we also report the accuracy of our ensemble model to compare with other ensemble models on VQA test-standard, which won 1st to 5th places in VQA Challenge $2 0 1 6 ^ { 3 }$ . We beat the previous state-of-the-art with a margin of $0 . 4 2 \%$ .
|
| 199 |
+
|
| 200 |
+
Table 3: The VQA test-standard results for ensemble models to compare with state-of-the-art. For unpublished entries, their team names are used instead of their model names. Some of their figures are updated after the challenge.
|
| 201 |
+
|
| 202 |
+
<table><tr><td rowspan="2">MODEL</td><td colspan="4">Open-Ended</td><td>MC</td></tr><tr><td>ALL</td><td>Y/N</td><td>NUM</td><td>ETC</td><td>ALL</td></tr><tr><td>RAU (Noh & Han,2016)</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>64.12</td><td>83.33</td><td>38.02</td><td>53.37</td><td>67.34</td></tr><tr><td>MRN (Kim et al., 2016b)</td><td>63.18</td><td>83.16</td><td>39.14</td><td>51.33</td><td>67.54</td></tr><tr><td>DLAIT (not published)</td><td>64.83</td><td>83.23</td><td>40.80</td><td>54.32</td><td>68.30</td></tr><tr><td>Naver Labs (not published)</td><td>64.79</td><td>83.31</td><td>38.70</td><td>54.79</td><td>69.26</td></tr><tr><td>MCB (Fukui et al., 2016)</td><td>66.47</td><td>83.24</td><td>39.47</td><td>58.00</td><td>70.10</td></tr><tr><td>MLB (ours)</td><td>66.89</td><td>84.61</td><td>39.07</td><td>57.79</td><td>70.29</td></tr><tr><td>Human (Antol et al., 2015)</td><td>83.30</td><td>95.77</td><td>83.39</td><td>72.67</td><td>91.54</td></tr></table>
|
| 203 |
+
|
| 204 |
+
# 7 RELATED WORKS
|
| 205 |
+
|
| 206 |
+
MRN (Kim et al., 2016b) proposes multimodal residual learning with Hadamard product of low-rank bilinear pooling. However, their utilization of low-rank bilinear pooling is limited to joint residual mapping function for multimodal residual learning. Higher-order Boltzmann Machines (Memisevic & Hinton, 2007; 2010) use Hadamard product to capture the interactions of input, output, and hidden representations for energy function. Wu et al. (2016c) propose the recurrent neural networks using Hadamard product to integrate multiplicative interactions among hidden representations in the model. For details of these related works, please refer to Appendix D.
|
| 207 |
+
|
| 208 |
+
Yet, compact bilinear pooling or multimodal compact bilinear pooling (Gao et al., 2016; Fukui et al., 2016) is worth to discuss and carefully compare with our method.
|
| 209 |
+
|
| 210 |
+
# 7.1 COMPACT BILINEAR POOLING
|
| 211 |
+
|
| 212 |
+
Compact bilinear pooling (Gao et al., 2016) approximates full bilinear pooling using a samplingbased computation, Tensor Sketch Projection (Charikar et al., 2002; Pham & Pagh, 2013):
|
| 213 |
+
|
| 214 |
+
$$
|
| 215 |
+
\begin{array} { r l } & { \Psi ( x \otimes y , h , s ) = \Psi ( x , h , s ) * \Psi ( y , h , s ) } \\ & { \qquad = \mathrm { F F T } ^ { - 1 } ( \mathrm { F F T } ( \Psi ( x , h , s ) \circ \mathrm { F F T } ( \Psi ( y , h , s ) ) } \end{array}
|
| 216 |
+
$$
|
| 217 |
+
|
| 218 |
+
where $\otimes$ denotes outer product, $^ *$ denotes convolution, $\begin{array} { r } { \Psi ( v , h , s ) _ { i } : = \sum _ { j : h _ { j } = i } s _ { j } \cdot v _ { j } } \end{array}$ , FFT denotes Fast Fourier Transform, $d$ denotes an output dimension, $x , y , h , s \in \mathbb { R } ^ { n }$ , $x$ and $y$ are inputs, and $h$ and $s$ are random variables. $h _ { i }$ is sampled from $\{ 1 , . . . , d \}$ , and $s _ { i }$ is sampled from $\{ - 1 , 1 \}$ , then, both random variables are fixed for further usage. Even if the dimensions of $x$ and $y$ are different from each other, it can be used for multimodal learning (Fukui et al., 2016).
|
| 219 |
+
|
| 220 |
+
Similarly to Equation 1, compact bilinear pooling can be described as follows:
|
| 221 |
+
|
| 222 |
+
$$
|
| 223 |
+
f _ { i } = \mathbf { x } ^ { T } \mathcal { W } _ { i } \mathbf { y }
|
| 224 |
+
$$
|
| 225 |
+
|
| 226 |
+
where $\mathcal { W } _ { i j k } = s _ { i j k } w _ { i j k }$ if $s _ { i j k }$ is sampled from $\{ - 1 , 1 \}$ , $w _ { i j k }$ is sampled from $\{ \mathbf { P } _ { i 1 } , \mathbf { P } _ { i 2 } , \dots , \mathbf { P } _ { i d } \}$ , and the compact bilinear pooling is followed by a fully connected layer $\mathbf { P } \in \mathbb { R } ^ { | \Omega | \times d }$ . Then, this method can be formulated as a hashing trick (Weinberger et al., 2009; Chen et al., 2015) to share randomly chosen bilinear weights using $d$ parameters for a output value, in a way that a single parameter is shared by $N M / d$ bilinear terms in expectation, with the variance of $\dot { N } M ( d - 1 ) \big / { d ^ { 2 } }$ (See Appendix B).
|
| 227 |
+
|
| 228 |
+
In comparison with our method, their method approximates a three-dimensional weight tensor in bilinear pooling with a two-dimensional matrix $\mathbf { P }$ , which is larger than the concatenation of three two-dimensional matrices for low-rank bilinear pooling. The ratio of the number of parameters for a single output to the total number of parameters for $| \Omega |$ outputs is $d / d | \Omega | = 1 / | \Omega |$ (Fukui et al., 2016), vs. $d ( N + M + 1 ) / d ( N + M + | \Omega | ) = ( N + M + 1 ) / ( N + M + | \Omega | ) \approx 2 / 3$ (ours), since our method uses a three-way factorization. Hence, more parameters are allocated to each bilinear approximation than compact bilinear pooling does, effectively managing overall parameters guided by back-propagation algorithm.
|
| 229 |
+
|
| 230 |
+
MCB (Fukui et al., 2016), which uses compact bilinear pooling for multimodal tasks, needs to set the dimension of output $d$ to 16K, to reduce the bias induced by the fixed random variables $h$ and $s$ . As a result, the majority of model parameters $( 1 6 \mathsf { K } \times 3 \mathsf { K } = 4 8 \mathsf { M } )$ are concentrated on the last fully connected layer, which makes a fan-out structure. So, the total number of parameters of MCB is highly sensitive to the number of classes, which is approximately $6 9 . 2 \mathbf { M }$ for $M C B + a t t$ , and $7 0 . 5 \mathbf { M }$ for $M C B + a t t + G l o V e$ . Yet, the total number of parameters of our proposed model (MLB) is 51.9M, which is more robust to the number of classes having $d = 1 . 2 \mathrm { K }$ , which has a similar role in model architecture.
|
| 231 |
+
|
| 232 |
+
# 8 CONCLUSIONS
|
| 233 |
+
|
| 234 |
+
We suggest a low-rank bilinear pooling method to replace compact bilinear pooling, which has a fan-out structure, and needs complex computations. Low-rank bilinear pooling has a flexible structure using linear mapping and Hadamard product, and a better parsimonious property, compared with compact bilinear pooling. We achieve new state-of-the-art results on the VQA dataset using a similar architecture of Fukui et al. (2016), replacing compact bilinear pooling with low-rank bilinear pooling. We believe our method could be applicable to other bilinear learning tasks.
|
| 235 |
+
|
| 236 |
+
# ACKNOWLEDGMENTS
|
| 237 |
+
|
| 238 |
+
The authors would like to thank Patrick Emaase for helpful comments and editing. Also, we are thankful to anonymous reviewers who provided comments to improve this paper. This work was supported by NAVER LABS Corp. & NAVER Corp. and partly by the Korea government (IITP-R0126-16-1072-SW.StarLab, KEIT10044009-HRI.MESSI, KEIT-10060086-RISF, ADD-UD130070ID-BMRR). The part of computing resources used in this study was generously shared by Standigm Inc.
|
| 239 |
+
|
| 240 |
+
# REFERENCES
|
| 241 |
+
|
| 242 |
+
Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Learning to Compose Neural Networks for Question Answering. arXiv preprint arXiv:1601.01705, 2016.
|
| 243 |
+
|
| 244 |
+
Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C. Lawrence Zitnick, and Devi Parikh. VQA: Visual Question Answering. IEEE International Conference on Computer Vision, 2015.
|
| 245 |
+
|
| 246 |
+
Moses Charikar, Kevin Chen, and Martin Farach-Colton. Finding frequent items in data streams. In International Colloquium on Automata, Languages, and Programming, pp. 693–703. Springer, 2002.
|
| 247 |
+
|
| 248 |
+
Wenlin Chen, James T. Wilson, Stephen Tyree, Kilian Q. Weinberger, and Yixin Chen. Compressing Neural Networks with the Hashing Trick. In 32nd International Conference on Machine Learning, pp. 2285–2294, 2015.
|
| 249 |
+
|
| 250 |
+
Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger ¨ Schwenk, and Yoshua Bengio. Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation. In 2014 Conference on Empirical Methods in Natural Language Processing, pp. 1724–1734, 2014.
|
| 251 |
+
|
| 252 |
+
Akira Fukui, Dong Huk Park, Daylen Yang, Anna Rohrbach, Trevor Darrell, and Marcus Rohrbach. Multimodal Compact Bilinear Pooling for Visual Question Answering and Visual Grounding. arXiv preprint arXiv:1606.01847, 2016.
|
| 253 |
+
|
| 254 |
+
Yarin Gal. A Theoretically Grounded Application of Dropout in Recurrent Neural Networks. arXiv preprint arXiv:1512.05287, 2015.
|
| 255 |
+
|
| 256 |
+
Yang Gao, Oscar Beijbom, Ning Zhang, and Trevor Darrell. Compact Bilinear Pooling. In IEEE Conference on Computer Vision and Pattern Recognition, 2016.
|
| 257 |
+
|
| 258 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In IEEE Conference on Computer Vision and Pattern Recognition, 2016.
|
| 259 |
+
|
| 260 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long Short-Term Memory. ¨ Neural computation, 9(8):1735–1780, 1997.
|
| 261 |
+
|
| 262 |
+
Ilija Ilievski, Shuicheng Yan, and Jiashi Feng. A Focused Dynamic Attention Model for Visual Question Answering. arXiv preprint arXiv:1604.01485, 2016.
|
| 263 |
+
|
| 264 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial Transformer Networks. In Advances in Neural Information Processing Systems 28, pp. 2008–2016, 2015.
|
| 265 |
+
|
| 266 |
+
Kushal Kafle and Christopher Kanan. Visual Question Answering: Datasets, Algorithms, and Future Challenges. arXiv preprint arXiv:1610.01465, 2016a.
|
| 267 |
+
|
| 268 |
+
Kushal Kafle and Christopher Kanan. Answer-Type Prediction for Visual Question Answering. IEEE Conference on Computer Vision and Pattern Recognition, pp. 4976–4984, 2016b.
|
| 269 |
+
|
| 270 |
+
Jin-Hwa Kim, Jeonghee Kim, Jung-Woo Ha, and Byoung-Tak Zhang. TrimZero: A Torch Recurrent Module for Efficient Natural Language Processing. In KIIS Spring Conference, volume 26, pp. 165–166, 2016a.
|
| 271 |
+
|
| 272 |
+
Jin-Hwa Kim, Sang-Woo Lee, Dong-Hyun Kwak, Min-Oh Heo, Jeonghee Kim, Jung-Woo Ha, and Byoung-Tak Zhang. Multimodal Residual Learning for Visual QA. arXiv preprint arXiv:1606.01455, 2016b.
|
| 273 |
+
|
| 274 |
+
Ryan Kiros, Yukun Zhu, Ruslan Salakhutdinov, Richard S. Zemel, Antonio Torralba, Raquel Urtasun, and Sanja Fidler. Skip-Thought Vectors. In Advances in Neural Information Processing Systems 28, pp. 3294–3302, 2015.
|
| 275 |
+
|
| 276 |
+
Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A Shamma, Michael Bernstein, and Li Fei-Fei. Visual genome: Connecting language and vision using crowdsourced dense image annotations. arXiv preprint arXiv:1602.07332, 2016.
|
| 277 |
+
|
| 278 |
+
Nicholas Leonard, Sagar Waghmare, Yang Wang, and Jin-Hwa Kim. rnn´ $:$ Recurrent Library for Torch. arXiv preprint arXiv:1511.07889, 2015.
|
| 279 |
+
|
| 280 |
+
Tsung-Yu Lin, Aruni RoyChowdhury, and Subhransu Maji. Bilinear CNN Models for Fine-grained Visual Recognition. In IEEE International Conference on Computer Vision, pp. 1449–1457, 2015.
|
| 281 |
+
|
| 282 |
+
Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. Hierarchical Question-Image Co-Attention for Visual Question Answering. arXiv preprint arXiv:1606.00061, 2016.
|
| 283 |
+
|
| 284 |
+
Mateusz Malinowski, Marcus Rohrbach, and Mario Fritz. Ask Your Neurons: A Deep Learning Approach to Visual Question Answering. arXiv preprint arXiv:1605.02697, 2016.
|
| 285 |
+
Roland Memisevic and Geoffrey E Hinton. Unsupervised learning of image transformations. In IEEE Conference on Computer Vision and Pattern Recognition, 2007.
|
| 286 |
+
Roland Memisevic and Geoffrey E Hinton. Learning to represent spatial transformations with factored higherorder Boltzmann machines. Neural computation, 22(6):1473–1492, 2010.
|
| 287 |
+
Hyeonwoo Noh and Bohyung Han. Training Recurrent Answering Units with Joint Loss Minimization for VQA. arXiv preprint arXiv:1606.03647, 2016.
|
| 288 |
+
Hyeonwoo Noh, Paul Hongsuck Seo, and Bohyung Han. Image Question Answering using Convolutional Neural Network with Dynamic Parameter Prediction. In IEEE Conference on Computer Vision and Pattern Recognition, 2016.
|
| 289 |
+
Ninh Pham and Rasmus Pagh. Fast and scalable polynomial kernels via explicit feature maps. In 19th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 239–247. ACM, 2013.
|
| 290 |
+
Hamed Pirsiavash, Deva Ramanan, and Charless C. Fowlkes. Bilinear classifiers for visual recognition. In Advances in Neural Information Processing Systems 22, pp. 1482–1490, 2009.
|
| 291 |
+
Joshua B Tenenbaum and William T Freeman. Separating style and content with bilinear models. Neural computation, 12(6):1247–1283, 2000.
|
| 292 |
+
Tijmen Tieleman and Geoffrey Hinton. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural Networks for Machine Learning, 4, 2012.
|
| 293 |
+
Kilian Weinberger, Anirban Dasgupta, John Langford, Alex Smola, and Josh Attenberg. Feature hashing for large scale multitask learning. In 26th International Conference on Machine Learning, pp. 1113–1120, 2009.
|
| 294 |
+
Qi Wu, Damien Teney, Peng Wang, Chunhua Shen, Anthony Dick, and Anton van den Hengel. Visual Question Answering: A Survey of Methods and Datasets. arXiv preprint arXiv:1607.05910, 2016a.
|
| 295 |
+
Qi Wu, Peng Wang, Chunhua Shen, Anthony Dick, and Anton van den Hengel. Ask Me Anything: Free-form Visual Question Answering Based on Knowledge from External Sources. In IEEE Conference on Computer Vision and Pattern Recognition, 2016b.
|
| 296 |
+
Yuhuai Wu, Saizheng Zhang, Ying Zhang, Yoshua Bengio, and Ruslan Salakhutdinov. On Multiplicative Integration with Recurrent Neural Networks. arXiv preprint arXiv:1606.06630, 2016c.
|
| 297 |
+
Caiming Xiong, Stephen Merity, and Richard Socher. Dynamic Memory Networks for Visual and Textual Question Answering. In 33rd International Conference on Machine Learning, 2016.
|
| 298 |
+
Huijuan Xu and Kate Saenko. Ask, Attend and Answer: Exploring Question-Guided Spatial Attention for Visual Question Answering. In European Conference on Computer Vision, 2016.
|
| 299 |
+
Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng, and Alex Smola. Stacked Attention Networks for Image Question Answering. In IEEE Conference on Computer Vision and Pattern Recognition, 2016.
|
| 300 |
+
Bolei Zhou, Yuandong Tian, Sainbayar Sukhbaatar, Arthur Szlam, and Rob Fergus. Simple Baseline for Visual Question Answering. arXiv preprint arXiv:1512.02167, 2015.
|
| 301 |
+
|
| 302 |
+
# Appendix
|
| 303 |
+
|
| 304 |
+
A EXPERIMENT DETAILS
|
| 305 |
+
|
| 306 |
+
A.1 PREPROCESSING
|
| 307 |
+
|
| 308 |
+
We follow the preprocessing procedure of Kim et al. (2016b). Here, we remark some details of it, and changes.
|
| 309 |
+
|
| 310 |
+
# A.1.1 QUESTION EMBEDDING
|
| 311 |
+
|
| 312 |
+
The $9 0 . 4 5 \%$ of questions for the 2K-most frequent answers are used. The vocabulary size of questions is 15,031. GRU (Cho et al., 2014) is used for question embedding. Based on earlier studies (Noh et al., 2016; Kim et al., 2016b), a word embedding matrix and a GRU are initialized with Skip-thought Vector pre-trained model (Kiros et al., 2015). As a result, question vectors have 2,400 dimensions.
|
| 313 |
+
|
| 314 |
+
For efficient computation of variable-length questions, Kim et al. (2016a) is used for the GRU. Moreover, for regularization, Bayesian Dropout (Gal, 2015) which is implemented in Leonard et al. (2015) is applied while ´ training.
|
| 315 |
+
|
| 316 |
+
# A.2 VISION EMBEDDING
|
| 317 |
+
|
| 318 |
+
ResNet-152 networks (He et al., 2016) are used for feature extraction. The dimensionality of an input image is $3 \times 4 4 8 \times 4 4 8$ . The outputs of the last convolution layer is used, which have $2 , 0 4 8 \times 1 4 \times 1 4$ dimensions.
|
| 319 |
+
|
| 320 |
+
# A.3 HYPERPARAMETERS
|
| 321 |
+
|
| 322 |
+
The hyperparameters used in MLB of Table 2 are described in Table 4. The batch size is 100, and the number of iterations is fixed to 250K. For data augmented models, a simplified early stopping is used, starting from 250K to 350K-iteration for every 25K iterations (250K, 275K, 300K, 325K, and 350K; at most five points) to avoid exhaustive submissions to VQA test-dev evaluation server. RMSProp (Tieleman & Hinton, 2012) is used for optimization.
|
| 323 |
+
|
| 324 |
+
Though, the size of joint embedding size $d$ is borrowed from Kim et al. (2016b), a grid search on $d$ confirms this choice in our model as shown in Table 5.
|
| 325 |
+
|
| 326 |
+
Table 4: Hyperparameters used in MLB (single model in Table 2).
|
| 327 |
+
|
| 328 |
+
<table><tr><td>SYMBOL</td><td>VALUE</td><td>DESCRIPTION</td></tr><tr><td>S</td><td>14</td><td></td></tr><tr><td>N</td><td>2,400</td><td>attention lattice size</td></tr><tr><td>M</td><td>2.048</td><td>question embedding size channel size of extracted visual features</td></tr><tr><td>d</td><td>1,200</td><td>joint embedding size</td></tr><tr><td>G</td><td>2</td><td>number of glimpses</td></tr><tr><td>||</td><td>2,000</td><td>number of candidate answers</td></tr><tr><td>n</td><td>3e-4</td><td>learning rate</td></tr><tr><td>入</td><td>0.99997592083</td><td>learning rate decay factor at every iteration</td></tr><tr><td>p</td><td>0.5</td><td>dropout rate</td></tr><tr><td>0</td><td>±10</td><td>gradient clipping threshold</td></tr></table>
|
| 329 |
+
|
| 330 |
+
# A.4 MODEL SCHEMA
|
| 331 |
+
|
| 332 |
+
Figure 1 shows a schematic diagram of MLB, where ◦ denotes Hadamard product, and $\Sigma$ denotes a linear combination of visual feature vectors using coefficients, which is the output of softmax function. If $G > 1$ , the softmax function is applied to each row vectors of an output matrix (Equation 8), and we concatenate the resulting vectors of the $G$ linear combinations (Equation 9).
|
| 333 |
+
|
| 334 |
+
# A.5 ENSEMBLE OF SEVEN MODELS
|
| 335 |
+
|
| 336 |
+
The test-dev results for individual models consisting of our ensemble model is presented in Table 6.
|
| 337 |
+
|
| 338 |
+
Table 5: The effect of joint embedding size $d$
|
| 339 |
+
|
| 340 |
+
<table><tr><td colspan="6">Open-Ended</td></tr><tr><td>d</td><td>SIZE</td><td>ALL</td><td>Y/N</td><td>NUM</td><td>ETC</td></tr><tr><td>800</td><td>45.0M</td><td>64.89</td><td>84.08</td><td>38.15</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>54.55</td></tr><tr><td>1000</td><td>48.4M</td><td>65.06</td><td>84.18</td><td>38.01</td><td>54.85</td></tr><tr><td>1200</td><td>51.9M</td><td>65.08</td><td>84.14</td><td>38.21</td><td>54.87</td></tr><tr><td>1400</td><td>55.4M</td><td>64.94</td><td>84.13</td><td>38.00</td><td>54.64</td></tr><tr><td>1600</td><td>58.8M</td><td>65.02</td><td>84.15</td><td>37.79</td><td>54.85</td></tr></table>
|
| 341 |
+
|
| 342 |
+

|
| 343 |
+
Figure 1: A schematic diagram of MLB. Replicate module copies an question embedding vector to match with $S ^ { 2 }$ visual feature vectors. Conv modules indicate $1 \times 1$ convolution to transform a given channel space, which is computationally equivalent to linear projection for channels.
|
| 344 |
+
|
| 345 |
+
Table 6: The individual models used in our ensemble model in Table 3.
|
| 346 |
+
|
| 347 |
+
<table><tr><td colspan="2"></td><td colspan="4">Open-Ended</td></tr><tr><td>MODEL</td><td>GLIMPSE</td><td>ALL</td><td>Y/N</td><td>NUM</td><td>ETC</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>MLB MLB</td><td>22</td><td>64.89 65.08</td><td>84.13 84.14</td><td>37.85 38.21</td><td>54.57 54.87</td></tr><tr><td>MLB</td><td>4</td><td>65.01</td><td>84.09</td><td>37.66</td><td>54.88</td></tr><tr><td>MLB-VG</td><td>2</td><td>65.76</td><td>83.64</td><td>37.57</td><td>56.86</td></tr><tr><td>MLB-VG</td><td>2</td><td>65.84</td><td>83.87</td><td>37.87</td><td>56.76</td></tr><tr><td>MLB-VG</td><td>3</td><td>66.05</td><td>83.88</td><td>38.13</td><td>57.13</td></tr><tr><td>MLB-VG</td><td>4</td><td>66.09</td><td>83.59</td><td>38.32</td><td>57.42</td></tr><tr><td>Ensemble</td><td></td><td>66.77</td><td>84.54</td><td>39.21</td><td>57.81</td></tr></table>
|
| 348 |
+
|
| 349 |
+
# B UNDERSTANDING OF MULTIMODAL COMPACT BILINEAR POOLING
|
| 350 |
+
|
| 351 |
+
In this section, the algorithm of multimodal compact bilinear pooling (MCB) (Gao et al., 2016; Fukui et al., 2016) is described as a kind of hashing tick (Chen et al., 2015).
|
| 352 |
+
|
| 353 |
+
$\mathbf { x } \in \mathbb { R } ^ { n _ { x } }$ and $\mathbf { y } \in \mathbb { R } ^ { n _ { y } }$ are the given inputs, $\Phi ( \mathbf { x } , \mathbf { y } ) \in \mathbb { R } ^ { d }$ is the output. Random variables $\mathbf { h } _ { x } \in \mathbb { N } ^ { n _ { x } }$ and $\mathbf { h } _ { y } \in \mathbb { N } ^ { n _ { y } }$ are uniformly sampled from $\{ 1 , \ldots , d \}$ , and $\mathbf { s } _ { x } \in \mathbb { Z } ^ { n _ { x } }$ and $\mathbf { s } _ { y } \in \mathbb { Z } ^ { n _ { y } }$ are uniformly sampled from $\{ - 1 , 1 \}$ . Then, Count Sketch projection function $\Psi$ (Charikar et al., 2002) projects $\mathbf { x }$ and $\mathbf { y }$ to intermediate representations $\Psi ( \mathbf { x } , \mathbf { h } _ { \boldsymbol { x } } , \mathbf { s } _ { \boldsymbol { x } } ) \in \mathbb { R } ^ { d }$ and $\boldsymbol { \Psi } ( \mathbf { y } , \mathbf { h } _ { y } , \mathbf { s } _ { y } ) \in \mathbb { R } ^ { d }$ , which is defined as:
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
\Psi ( \mathbf { v } , \mathbf { h } , \mathbf { s } ) _ { i } : = \sum _ { j : h _ { j } = i } s _ { j } \cdot v _ { j }
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
Notice that both $\mathbf { h }$ and s remain as constants after initialization (Fukui et al., 2016).
|
| 360 |
+
|
| 361 |
+
The probability of $h _ { x j } = i$ and $h _ { y j } = i$ for the given $j$ is $1 / d ^ { 2 }$ . Hence, the expected number of bilinear terms in $\Psi ( \mathbf { x } , \mathbf { h } _ { x } , \mathbf { s } _ { x } ) _ { i } \Psi ( \mathbf { y } , \mathbf { h } _ { y } , \mathbf { s } _ { y } ) _ { i }$ is $\dot { ( } n _ { x } n _ { y } ) / d ^ { 2 }$ . Since, the output $\Phi ( \mathbf { x } , \mathbf { y } )$ is a result of circular convolution of $\Psi ( \mathbf { x } , \mathbf { h } _ { x } , \mathbf { s } _ { x } )$ and $\Psi ( \mathbf { y } , \mathbf { h } _ { y } , \mathbf { s } _ { y } )$ , the expected number of bilinear terms in $\Phi ( \mathbf { x } , \mathbf { y } ) _ { i }$ is $( n _ { x } n _ { y } ) / d$ . Likewise, the probability of that a bilinear term is allocated in $\Phi ( \mathbf { x } , \mathbf { y } ) _ { i }$ is $1 / d$ . The probability distribution of the number of bilinear terms in $\Phi ( \mathbf { x } , \mathbf { y } ) _ { i }$ follows a multinomial distribution, whose mean is $( n _ { x } n _ { y } ) / d$ and variance is $( n _ { x } n _ { y } ) ( d - 1 ) / d ^ { 2 }$ .
|
| 362 |
+
|
| 363 |
+
Linear projection after the multimodal compact bilinear pooling provides weights on the bilinear terms, in a way that a shared weight is assigned to $\Phi ( \bar { \mathbf { x } } , \mathbf { y } ) _ { i }$ , which has $( n _ { x } n _ { y } ) / d$ bilinear terms in expectation, though each bilinear term can have a different sign induced by both ${ \bf s } _ { x }$ and $\mathbf { s } _ { y }$ .
|
| 364 |
+
|
| 365 |
+
HashedNets (Chen et al., 2015) propose a method to compress neural networks using a low-cost hashing function (Weinberger et al., 2009), which is the same function of $\Psi ( \mathbf { v } , \mathbf { h } , \mathbf { s } )$ . They randomly group a portion of connections in neural networks to share a single weight. We speculate that multimodal compact bilinear pooling uses the hashing tick to reduce the number of full bilinear weights with the rate of $d / ( n _ { x } n _ { y } )$ . However, this approximation is limited to two-way interaction, compared with three-way factorization in our method.
|
| 366 |
+
|
| 367 |
+
# C REPLACEMENT OF LOW-RANK BILINEAR POOLING
|
| 368 |
+
|
| 369 |
+
For the explicit comparison with compact bilinear pooling, we explicitly substitute compact bilinear pooling for low-rank bilinear pooling to control everything else, which means that the rest of the model architecture is exactly the same.
|
| 370 |
+
|
| 371 |
+
According to Fukui et al. (2016), we use MCB followed by Signed Square Root, L2-Normalization, Dropout $( p { = } 0 . 1 )$ , and linear projection from 16,000-dimension to the target dimension. Also, Dropout $\scriptstyle ( p = 0 . 3 )$ for a question embedding vector. Note that an overall architecture for multimodal learning of both is the same. Experimental details are referenced from the implementation 4 of Fukui et al. (2016).
|
| 372 |
+
|
| 373 |
+
For test-dev split, our version of MCB gets $6 1 . 4 8 \%$ for overall accuracy (yes/no: $8 2 . 4 8 \%$ , number: $3 7 . 0 6 \%$ , and other: $4 9 . 0 7 \%$ ) vs. $6 5 . 0 8 \%$ (ours, MLB in Table 1). Additionally, if the nonlinearity in getting attention distributions is increased as the original MCB does using ReLU, we get $6 2 . 1 1 \%$ for overall accuracy (yes/no: $8 2 . 5 5 \%$ , number: $3 7 . 1 8 \%$ , and other: $5 0 . 3 0 \%$ ), which is still the below of our performance 5.
|
| 374 |
+
|
| 375 |
+
We do not see it as a decisive evidence of the better performance of MLB, but as a reference (the comparison of test-dev results may be also unfair.), since an optimal architecture and hyperparameters may be required for each method.
|
| 376 |
+
|
| 377 |
+
# D RELATED WORKS
|
| 378 |
+
|
| 379 |
+
D.1 MULTIMODAL RESIDUAL NETWORKS
|
| 380 |
+
|
| 381 |
+
MRN (Kim et al., 2016b) is an implicit attentional model using multimodal residual learning with Hadamard product which does not have any explicit attention mechanism.
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\begin{array} { r l } & { \mathcal { F } ^ { ( k ) } ( \mathbf { q } , \mathbf { v } ) = \sigma ( \mathbf { W } _ { \mathbf { q } } ^ { ( k ) } \mathbf { q } ) \circ \sigma ( \mathbf { W } _ { 2 } ^ { ( k ) } \sigma ( \mathbf { W } _ { 1 } ^ { ( k ) } \mathbf { v } ) ) } \\ & { \quad H _ { L } ( \mathbf { q } , \mathbf { v } ) = \mathbf { W } _ { \mathbf { q } ^ { \prime } } \mathbf { q } + \displaystyle \sum _ { l = 1 } ^ { L } \mathbf { W } _ { \mathcal { F } ^ { ( l ) } } \mathcal { F } ^ { ( l ) } ( H _ { l - 1 } , \mathbf { v } ) } \end{array}
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
where $\mathbf { W } _ { * }$ are parameter matrices, $L$ is the number of learning blocks, $H _ { 0 } = \mathbf { q }$ , $\mathbf { W _ { q ^ { \prime } } } = \Pi _ { l = 1 } ^ { L } \mathbf { W } _ { \mathbf { q ^ { \prime } } } ^ { ( l ) }$ , an d $\mathbf { W } _ { \mathcal { F } ^ { ( l ) } } = \Pi _ { m = l + 1 } ^ { L } \mathbf { W } _ { \mathbf { q } ^ { \prime } } ^ { ( m ) }$ . Notice that these equations can be generalized by Equation 7.
|
| 388 |
+
|
| 389 |
+
However, an explicit attention mechanism allows the use of lower-level visual features than fully-connected layers, and, more importantly, spatially selective learning. Recent state-of-the-art methods use a variant of an explicit attention mechanism in their models (Lu et al., 2016; Noh & Han, 2016; Fukui et al., 2016). Note that shortcut connections of MRN are not used in the proposed Multimodal Low-rank Bilinear (MLB) model. Since, it does not have any performance gain due to not stacking multiple layers in MLB. We leave the study of residual learning for MLB for future work, which may leverage the excellency of bilinear models as suggested in Wu et al. (2016a).
|
| 390 |
+
|
| 391 |
+
# D.2 HIGHER-ORDER BOLTZMANN MACHINES
|
| 392 |
+
|
| 393 |
+
A similar model can be found in a study of Higher-Order Boltzmann Machines (Memisevic & Hinton, 2007; 2010). They suggest a factoring method for the three-way energy function to capture correlations among input, output, and hidden representations.
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\begin{array} { l } { { \displaystyle - E ( { \bf y } , { \bf h } ; { \bf x } ) = \sum _ { f } \big ( \sum _ { i } x _ { i } w _ { i f } ^ { x } \big ) \big ( \sum _ { j } y _ { j } w _ { j f } ^ { y } \big ) \big ( \sum _ { k } h _ { k } w _ { k f } ^ { h } \big ) + \sum _ { k } w _ { k } ^ { h } h _ { k } + \sum _ { j } w _ { j } ^ { y } y _ { j } } \ ~ } \\ { { \displaystyle = \big ( { \bf x } ^ { T } { \bf W } ^ { x } \circ { \bf y } ^ { T } { \bf W } ^ { y } \circ { \bf h } ^ { T } { \bf W } ^ { h } \big ) \mathbb { 1 } + { \bf h } ^ { T } { \bf w } ^ { h } + { \bf y } ^ { T } { \bf w } ^ { y } } } \end{array}
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
Setting aside of bias terms, the $I \times J \times K$ parameter tensor of unfactored Higher-Order Boltzmann Machines is replaced with three matrices, $\mathbf { W } ^ { x } \in \mathbb { R } ^ { I \times F }$ , $\mathbf { W } ^ { y } \in \mathbb { R } ^ { J \times F }$ , and $\mathbf { W } ^ { h } \in \mathbb { R } ^ { K \times F }$ .
|
| 400 |
+
|
| 401 |
+
# D.3 MULTIPLICATIVE INTEGRATION WITH RECURRENT NEURAL NETWORKS
|
| 402 |
+
|
| 403 |
+
Most of recurrent neural networks, including vanilla RNNs, Long Short Term Memory networks (Hochreiter & Schmidhuber, 1997) and Gated Recurrent Units (Cho et al., 2014), share a common expression as follows:
|
| 404 |
+
|
| 405 |
+
$$
|
| 406 |
+
\phi ( \mathbf { W _ { X } } + \mathbf { U _ { h } } + \mathbf { b } )
|
| 407 |
+
$$
|
| 408 |
+
|
| 409 |
+
where $\phi$ is a non-linear function, $\mathbf { W } \in \mathbb { R } ^ { d \times n }$ , $\mathbf { x } \in \mathbb { R } ^ { n }$ , $\mathbf { U } \in \mathbb { R } ^ { d \times m }$ , $\mathbf { h } \in \mathbb { R } ^ { m }$ , and $\mathbf { b } \in \mathbb { R } ^ { d }$ is a bias vector.
|
| 410 |
+
Note that, usually, $\mathbf { x }$ is an input state vector and $\mathbf { h }$ is an hidden state vector in recurrent neural networks.
|
| 411 |
+
|
| 412 |
+
Wu et al. (2016c) propose a new design to replace the additive expression with a multiplicative expression using Hadamard product as
|
| 413 |
+
|
| 414 |
+
$$
|
| 415 |
+
\phi ( \mathbf { W } \mathbf { x } \circ \mathbf { U } \mathbf { h } + \mathbf { b } ) .
|
| 416 |
+
$$
|
| 417 |
+
|
| 418 |
+
Moreover, a general formulation of this multiplicative integration can be described as
|
| 419 |
+
|
| 420 |
+
$$
|
| 421 |
+
\phi ( \pmb { \alpha } \circ \mathbf { W } \mathbf { x } \circ \mathbf { U } \mathbf { h } + \mathbf { W } \mathbf { x } \circ \pmb { \beta } _ { 1 } + \mathbf { U } \mathbf { h } \circ \pmb { \beta } _ { 2 } + \mathbf { b } )
|
| 422 |
+
$$
|
| 423 |
+
|
| 424 |
+
which is reminiscent of full model in Section 3.1.
|
md/train/rJevYoA9Fm/rJevYoA9Fm.md
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The Singular Values of Convolutional Layers
|
| 2 |
+
|
| 3 |
+
Hanie Sedghi, Vineet Gupta and Philip M. Long
|
| 4 |
+
|
| 5 |
+
Google Brain
|
| 6 |
+
Mountain View, CA 94043
|
| 7 |
+
{hsedghi,vineet,plong}@google.com
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
We characterize the singular values of the linear transformation associated with a standard 2D multi-channel convolutional layer, enabling their efficient computation. This characterization also leads to an algorithm for projecting a convolutional layer onto an operator-norm ball. We show that this is an effective regularizer; for example, it improves the test error of a deep residual network using batch normalization on CIFAR-10 from $6 . 2 \%$ to $5 . 3 \%$ .
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Exploding and vanishing gradients (Hochreiter, 1991; Hochreiter et al., 2001; Goodfellow et al., 2016) are fundamental obstacles to effective training of deep neural networks. Many deep networks used in practice are layered. We can think of such networks as the composition of a number of feature transformations, followed by a linear classifier on the final layer of features. The singular values of the Jacobian of a layer bound the factor by which it increases or decreases the norm of the backpropagated signal. If these singular values are all close to 1, then gradients neither explode nor vanish. These singular values also bound these factors in the forward direction, which affects the stability of computations, including whether the network produces the dreaded “Nan”. Moreover, it has been proven (Bartlett et al., 2017) that the generalization error for a network is bounded by the Lipschitz constant of the network, which in turn can be bounded by the product of the operator norms of the Jacobians of the layers. Cisse et al. (2017) discussed robustness to adversarial examples as a result of bounding the operator norm.
|
| 16 |
+
|
| 17 |
+
These considerations have led authors to regularize networks by driving down the operator norms of network layers (Drucker and Le Cun, 1992; Hein and Andriushchenko, 2017; Yoshida and Miyato, 2017; Miyato et al., 2018). Orthogonal initialization (Saxe et al., 2013; Pennington et al., 2017) and Parseval networks (Cisse et al., 2017) are motivated by similar considerations.
|
| 18 |
+
|
| 19 |
+
Convolutional layers (LeCun et al., 1998) are key components of modern deep networks. They compute linear transformations of their inputs. The Jacobian of a linear transformation is always equal to the linear transformation itself. Because of the central importance of convolutional layers to the practice of deep learning, and the fact that the singular values of the linear transformation computed by a convolutional layer are the key to its contribution to exploding and vanishing gradients, we study these singular values. Up until now, authors seeking to control the operator norm of convolutional layers have resorted to approximations (Yoshida and Miyato, 2017; Miyato et al., 2018; Gouk et al., 2018a). In this paper, we provide an efficient way to compute the singular values exactly — this opens the door to various regularizers.
|
| 20 |
+
|
| 21 |
+
We consider the convolutional layers commonly applied to image analysis tasks. The input to a typical layer is a feature map, with multiple channels for each position in an $n \times n$ field. If there are $m$ channels, then the input as a whole is a $m \times n \times n$ tensor. The output is also an $n \times n$ field with multiple channels per position1. Each channel of the output is obtained by taking a linear combination of the values of the features in all channels in a local neighborhood centered at the corresponding position in the input feature map. Crucially, the same linear combination is used for all positions in the feature map. The coefficients are compiled in the kernel of the convolution. If the neighborhood is a $k \times k$ region, a kernel $K$ is a $k \times k \times m \times m$ tensor. The projection $K _ { : , : , c , }$ : gives the coefficients that determine the cth channel of the output, in terms of the values found in all of the channels of all positions in it neighborhood; $K _ { : , : , c , d }$ gives the coefficients to apply to the dth input channel, and $K _ { p , q , c , d }$ is the coefficient to apply to this input at in the position in the field offset horizontally by $p$ and vertically by $q$ . For ease of exposition, we assume that feature maps and local neighborhoods are square and that the number of channels in the output is equal to the number of channels in the input - the extension to the general case is completely straightforward.
|
| 22 |
+
|
| 23 |
+
To handle edge cases in which the offsets call for inputs that are off the feature maps, practical convolutional layers either do not compute outputs (reducing the size of the feature map), or pad the input with zeros. The behavior of these layers can be approximated by a layer that treats the input as if it were a torus; when the offset calls for a pixel that is off the right end of the image, the layer “wraps around” to take it from the left edge, and similarly for the other edges. The quality of this approximation has been heavily analyzed in the case of one-dimensional signals (Gray, 2006). Consequently, theoretical analysis of convolutions that wrap around has been become standard. This is the case analyzed in this paper.
|
| 24 |
+
|
| 25 |
+
Summary of Results: Our main result is a characterization of the singular values of a convolutional layer in terms of the kernel tensor $K$ . Our characterization enables these singular values to be computed exactly in a simple and practically fast way, using $O ( n ^ { 2 } m ^ { 2 } ( m + \log n ) )$ time. For comparison, the brute force solution that performs SVD on the matrix that encodes the convolutional layer’s linear transformation would take $O ( ( n ^ { 2 } m ) ^ { 3 } ) = O ( n ^ { 6 } m ^ { 3 } )$ time, and is impractical for commonly used network sizes. As another point of comparison, simply to compute the convolution takes $O ( n ^ { 2 } m ^ { 2 } k ^ { 2 } )$ time. We prove that the following two lines of NumPy correctly compute the singular values.
|
| 26 |
+
|
| 27 |
+
def SingularValues(kernel, input_shape): transforms $=$ np.fft.fft2(kernel, input_shape, axes $=$ [0, 1]) return np.linalg.svd(transforms, compute_uv=False)
|
| 28 |
+
|
| 29 |
+
Here kernel is any $k \times k \times m \times m$ tensor2 and input_shape is the shape of the feature map to be convolved. A TensorFlow implementation is similarly simple.
|
| 30 |
+
|
| 31 |
+
Timing tests, reported in Section 4.1, confirm that this characterization speeds up the computation of singular values by multiple orders of magnitude – making it usable in practice. The algorithm first performs $m ^ { 2 }$ FFTs, and then it performs ${ { \bar { n } } ^ { 2 } }$ SVDs. The FFTs, and then the SVDs, may be executed in parallel. Our TensorFlow implementation runs a lot faster than the NumPy implementation (see Figure 1); we think that this parallelism is the cause. We used our code to compute the singular values of the convolutional layers of the official ResNet-v2 model released with TensorFlow (He et al., 2016). The results are described in Appendix C.
|
| 32 |
+
|
| 33 |
+
Exposing the singular values of a convolutional layer opens the door to a variety of regularizers for these layers, including operator-norm regularizers. In Section 4.2, we evaluate an algorithm that periodically projects each convolutional layer onto a operator-norm ball. Using the projections improves the test error from $6 . 2 \%$ to $5 . 3 \%$ on CIFAR-10. We evaluate bounding the operator norm with and without batchnorm and we see that regularizing the operator norm helps, even in the presence of batch normalization. Moreover, operator-norm regularization and batch normalization are not redundant, and neither dominates the other. They complement each other.
|
| 34 |
+
|
| 35 |
+
Related work: Prior to our work, authors have responded to the difficulty of computing the singular values of convolutional layers in various ways. Cisse et al. (2017) constrained the matrix to have orthogonal rows and scale the output of each layer by a factor of $( 2 k + 1 ) ^ { - \frac { 1 } { 2 } }$ , for $k \times k$ kernels. Gouk et al. (2018a;b) proposed regularizing using a per-mini-batch approximation to the operator norm. They find the largest ratio between the input and output of a layer in the minibatch, and then scale down the transformation (thereby scaling down all of the singular values, not just the largest ones) so that the new value of this ratio obeys a constraint.
|
| 36 |
+
|
| 37 |
+
Yoshida and Miyato (2017) used an approximation of the operator norm of a reshaping of $K$ in place of the operator norm for the linear transformation associated with $K$ in their experiments. They reshape the given $k \times k \times m \times m$ into a $m k ^ { 2 } \times m$ matrix, and compute its largest singular value using a power iteration method, and use this as a substitute for the operator norm. While this provides a useful heuristic for regularization, the largest singular value of the reshaped matrix is often quite different from the operator norm of the linear transform associated with $K$ . Furthermore if we want to regularize using projection onto an operator-norm ball, we need the whole spectrum of the linear transformation (see Section 3). The reshaped $K$ has only $m$ singular values, whereas the linear transformation has $m n ^ { 2 }$ singular values of which $m n ^ { 2 } / 2$ are distinct except in rare degenerate cases. It is possible to project the reshaped $K$ onto an operator-norm ball by taking its SVD and clipping its singular values — we conducted experiments with this projection and report the results in Section 4.4.
|
| 38 |
+
|
| 39 |
+
A close relative of our main result was independently discovered by Bibi et al. (2019, Lemma 2).
|
| 40 |
+
|
| 41 |
+
Overview of the Analysis: If the signal is 1D and there is a single input and output channel, then the linear transformation associated with a convolution is encoded by a circulant matrix, i.e., a matrix whose rows are circular shifts of a single row (Gray, 2006). For example, for a row $a = ( a _ { 1 } , a _ { 2 } , a _ { 3 } )$ , the circulant matrix $\mathrm { c i r c } ( a )$ generated by $a$ is $\left( \begin{array} { l l l } { a _ { 0 } } & { a _ { 1 } } & { a _ { 2 } } \\ { a _ { 2 } } & { a _ { 0 } } & { a _ { 1 } } \\ { a _ { 1 } } & { a _ { 2 } } & { a _ { 0 } } \end{array} \right)$ . In the special case of a 2D signal with a single input channel and single output channel, the linear transformation is doubly block circulant (see (Goodfellow et al., 2016)). Such a matrix is made up of a circulant matrix of blocks, each of which in turn is itself circulant. Finally, when there are $m$ input channels and $m$ output channels, there are three levels to the hierarchy: there is a $m \times m$ matrix of blocks, each of which is doubly block circulant. Our analysis extends tools from the literature built for circulant (Horn and Johnson, 2012) and doubly circulant (Chao, 1974) matrices to analyze the matrices with a third level in the hierarchy arising from the convolutional layers used in deep learning. One key point is that the eigenvectors of a circulant matrix are Fourier basis vectors: in the 2D, one-channel case, the matrix whose columns are the eigenvectors is $F \otimes F$ , for the matrix $F$ whose columns form the Fourier basis. Multiplying by this matrix is a 2D Fourier transform. In the multi-channel case, we show that the singular values can be computed by (a) finding the eigenvalues of each of the $m ^ { 2 }$ doubly circulant matrices (of dimensions $n ^ { 2 } \times n ^ { 2 }$ ) using a 2D Fourier transform, (b) by forming multiple $m \times m$ matrices, one for each eigenvalue, by picking out the $i$ -th eigenvalue of each of the $n ^ { 2 } \times n ^ { 2 }$ blocks, for $i \in [ 1 . . n ^ { 2 } ]$ . The union of all of the singular values of all of those $m \times m$ matrices is the multiset of singular values of the layer.
|
| 42 |
+
|
| 43 |
+
Notation: We use upper case letters for matrices, lower case for vectors. For matrix $M , M _ { i }$ ,: represents the $i$ -th row and $M _ { : , j }$ represents the $j$ -th column; we will also use the analogous notation for higher-order tensors. The operator norm of $M$ is denoted by $| | { \cal M } | | _ { 2 }$ . For $n \in \mathbb { N }$ , we use $[ n ]$ to denote the set $\{ 0 , 1 , \ldots , n - 1 \}$ (instead of usual $\{ 1 , \ldots , n \} )$ . We will index the rows and columns of matrices using elements of $[ n ]$ , i.e. numbering from 0. Addition of row and column indices will be done mod $n$ unless otherwise indicated. (Tensors will be treated analogously.) Let $\sigma ( \cdot )$ be the mapping from a matrix to (the multiset of) its singular values. 3
|
| 44 |
+
|
| 45 |
+
Let $\omega = \exp ( 2 \pi i / n )$ , where $i = \sqrt { - 1 }$ . (Because we need a lot of indices in this paper, our use of √ $i$ to define $\omega$ is the only place in the paper where we will use $i$ to denote $\sqrt { - 1 }$ .)
|
| 46 |
+
|
| 47 |
+
Let $F$ be the $n \times n$ matrix that represents the discrete Fourier transform: $F _ { i j } = \omega ^ { i j }$ . We use $I _ { n }$ to denote the identity matrix of size $n \times n$ . For $i \in [ n ]$ , we use $e _ { i }$ to represent the ith basis vector in $\mathbb { R } ^ { n }$ We use $\otimes$ to represent the Kronecker product between two matrices (which also refers to the outer product of two vectors).
|
| 48 |
+
|
| 49 |
+
# 2 Analysis
|
| 50 |
+
|
| 51 |
+
# 2.1 One filter
|
| 52 |
+
|
| 53 |
+
As a warmup, we focus on the case that the number $m$ of input channels and output channels is 1. In this case, the filter coefficients are simply a $k \times k$ matrix. It will simplify notation, however, if we embed this $k \times k$ matrix in an $n \times n$ matrix, by padding with zeroes (which corresponds to the fact that the offsets with those indices are not used). Let us refer to this $n \times n$ matrix also as $K$ .
|
| 54 |
+
|
| 55 |
+
An $n ^ { 2 } \times n ^ { 2 }$ matrix $A$ is doubly block circulant if $A$ is a circulant matrix of $n \times n$ blocks that are in turn circulant.
|
| 56 |
+
|
| 57 |
+
For a matrix $X$ , let $\operatorname { v e c } ( X )$ be the vector obtained by stacking the columns of $X$ .
|
| 58 |
+
|
| 59 |
+
Lemma 1 (see Jain (1989) Section 5.5, Goodfellow et al. (2016) page 329) For any filter coefficients $K$ , the linear transform for the convolution by $K$ is represented by the following doubly block circulant matrix:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r } { A = \left[ \begin{array} { c c c c } { \mathrm { c i r c } ( K _ { 0 , : } ) } & { \mathrm { c i r c } ( K _ { 1 , : } ) } & { \ldots } & { \mathrm { c i r c } ( K _ { n - 1 , : } ) } \\ { \mathrm { c i r c } ( K _ { n - 1 , : } ) } & { \mathrm { c i r c } ( K _ { 0 , : } ) } & { \ldots } & { \mathrm { c i r c } ( K _ { n - 2 , : } ) } \\ { \vdots } & { \vdots } & { \vdots } & { \vdots } \\ { \mathrm { c i r c } ( K _ { 1 , : } ) } & { \mathrm { c i r c } ( K _ { 2 , : } ) } & { \ldots } & { \mathrm { c i r c } ( K _ { 0 , : } ) } \end{array} \right] . } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
That is, $i f X$ is an $n \times n$ matrix, and $Y$ is the result of a 2-d convolution of $X$ with $K$ , i.e.
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\forall i j , Y _ { i j } = \sum _ { p \in [ n ] } \sum _ { q \in [ n ] } X _ { i + p , j + q } K _ { p , q }
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
then $\operatorname { v e c } ( Y ) = A \operatorname { v e c } ( X ) .$
|
| 72 |
+
|
| 73 |
+
So now we want to determine the singular values of a doubly block circulant matrix.
|
| 74 |
+
|
| 75 |
+
We will make use of the characterization of the eigenvalues and eigenvectors of doubly block circulant matrices, which uses the following definition: $Q \stackrel { \mathrm { d e f } } { = } \frac { 1 } { n } \left( F \otimes F \right)$ .
|
| 76 |
+
|
| 77 |
+
Theorem 2 (Jain (1989) Section 5.5) For any $n ^ { 2 } \times n ^ { 2 }$ doubly block circulant matrix $A$ , the eigenvectors of $A$ are the columns of $Q$ .
|
| 78 |
+
|
| 79 |
+
To get singular values in addition to eigenvalues, we need the following two lemmas.
|
| 80 |
+
|
| 81 |
+
Lemma 3 (Jain (1989) Section 5.5) $Q$ is unitary.
|
| 82 |
+
|
| 83 |
+
Using Theorem 2 and Lemma 3, we can get the eigenvalues as the diagonal elements of $Q ^ { * } A Q$ .
|
| 84 |
+
|
| 85 |
+
Lemma 4 The matrix $A$ defined in equation $^ { l }$ is normal, i.e., $A ^ { T } A = A A ^ { T }$ .
|
| 86 |
+
|
| 87 |
+
# Proof:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
A A ^ { T } = A A ^ { * } = Q ^ { * } D Q Q ^ { * } D ^ { * } Q = Q ^ { * } D D ^ { * } Q = Q ^ { * } D ^ { * } D Q = Q ^ { * } D ^ { * } Q Q ^ { * } D Q = A ^ { * } A = A ^ { T } A .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
The following theorem characterizes the singular values of $A$ as a simple function of $K$ . As we will see, a characterization of the eigenvalues plays a major role. Chao (1974) provided a more technical characterization of the eigenvalues which may be regarded as making partial progress toward Theorem 5. However, we provide a proof from first principles, since it is the cleanest way we know to prove the theorem.
|
| 94 |
+
|
| 95 |
+
Theorem 5 For the matrix $A$ defined in equation $I$ , the eigenvalues of $A$ are the entries of $F ^ { T } K F$ and its singular values are their magnitudes. That is, the singular values of $A$ are
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\left\{ \left| ( F ^ { T } K F ) _ { u , v } \right| \ : \ u , v \in [ n ] \right\} .
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
Proof: By Theorems 2 and Lemma 3, the eigenvalues of $A$ are the diagonal elements of $Q ^ { * } A Q =$ $\mathring { \neg } ( F ^ { * } \otimes \bar { F } ^ { * } ) A ( F \otimes F )$ . If we view $( F ^ { * } \otimes F ^ { * } ) A ( F \otimes F )$ as a compound $n \times n$ matrix of $n \times n$ blocks, for $u , v \in [ n ]$ , the $( u n + v )$ th diagonal element is the $v$ th element of the $u$ th diagonal block. Let us first evaluate the uth diagonal block. Using $i , j$ to index blocks, we have
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\begin{array} { l } { { ( Q ^ { * } A Q ) _ { u u } = \displaystyle \frac { 1 } { n ^ { 2 } } \sum _ { i , j \in [ n ] } ( F ^ { * } \otimes F ^ { * } ) _ { u i } A _ { i j } ( F \otimes F ) _ { j u } = \displaystyle \frac { 1 } { n ^ { 2 } } \sum _ { i , j \in [ n ] } \omega ^ { - u i } F ^ { * } \mathrm { c i r c } ( K _ { j - i , \cdot } ) \omega ^ { j u } F } } \\ { { = \displaystyle \frac { 1 } { n ^ { 2 } } \sum _ { i , j \in [ n ] } \omega ^ { u ( j - i ) } F ^ { * } \mathrm { c i r c } ( K _ { j - i , \cdot } ) F . } } \end{array}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
To get the $v$ th element of the diagonal of (4), we may sum the vth elements of the diagonals of each of its terms. Toward this end, we have
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
( F ^ { * } \mathrm { c i r c } ( K _ { j - i , : } ) F ) _ { v v } = \sum _ { r , s \in [ n ] } \omega ^ { - v r } \mathrm { c i r c } ( K _ { j - i , : } ) _ { r s } \omega ^ { s v } = \sum _ { r , s \in [ n ] } \omega ^ { v ( s - r ) } K _ { j - i , s - r } .
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
Substituting into (4), we get $\begin{array} { r } { \frac { 1 } { n ^ { 2 } } \sum _ { i , j , r , s \in [ n ] } \omega ^ { u ( j - i ) } \omega ^ { v ( s - r ) } K _ { j - i , s - r } . } \end{array}$ . Collecting terms where $j - i =$ $p$ and $s - r = q$ , this is $\begin{array} { r } { \sum _ { p , q \in [ n ] } \omega ^ { u p } \omega ^ { v q } K _ { p , q } = ( F ^ { T } K F ) _ { u v } } \end{array}$ .
|
| 114 |
+
|
| 115 |
+
Since the singular values of any normal matrix are the magnitudes of its eigenvalues (Horn and Johnson (2012) page 158), applying Lemma 4 completes the proof. □
|
| 116 |
+
|
| 117 |
+
Note that $F ^ { T } K F$ is the 2D Fourier transform of $K$ , and recall that $| | A | | _ { 2 }$ is the largest singular value of $A$ .
|
| 118 |
+
|
| 119 |
+
# 2.2 Multi-channel convolution
|
| 120 |
+
|
| 121 |
+
Now, we consider case where the number $m$ of channels may be more than one. Assume we have a 4D kernel tensor $K$ with element $K _ { p , q , c , d }$ giving the connection strength between a unit in channel $d$ of the input and a unit in channel $c$ of the output, with an offset of $p$ rows and $q$ columns between the input unit and the output unit. The input $X \in \mathbb { R } ^ { m \times n \times n }$ ; element $X _ { d , i , j }$ is the value of the input unit within channel $d$ at row $i$ and column $j$ . The output $Y \in \mathbb { R } ^ { m \times n \times n }$ has the same format as $X$ , and is produced by
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
Y _ { c r s } = \sum _ { d \in [ m ] } \sum _ { p \in [ n ] } \sum _ { q \in [ n ] } X _ { d , r + p , s + q } K _ { p , q , c , d } .
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
By inspection, $\operatorname { v e c } ( Y ) = M \operatorname { v e c } ( X )$ , where $M$ is as follows
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
{ \cal M } = \left[ \begin{array} { c c c c } { { B _ { 0 0 } } } & { { B _ { 0 1 } } } & { { \dots } } & { { B _ { 0 ( m - 1 ) } } } \\ { { B _ { 1 0 } } } & { { B _ { 1 1 } } } & { { \dots } } & { { B _ { 1 ( m - 1 ) } } } \\ { { \vdots } } & { { \vdots } } & { { \ddots } } & { { \vdots } } \\ { { B _ { ( m - 1 ) 0 } } } & { { B _ { ( m - 1 ) 1 } } } & { { \dots } } & { { B _ { ( m - 1 ) ( m - 1 ) } } } \end{array} \right]
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
and each $B _ { c d }$ is a doubly block circulant matrix from Lemma 1 corresponding to the portion $K _ { : , : , c , d }$ of $K$ that concerns the effect of the $d$ -th input channel on the $c$ -th output channel. (We can think of each output in the multichannel case as being a sum of single channel filters parameterized by one of the $K _ { : , : , c , d }$ ’s.)
|
| 134 |
+
|
| 135 |
+
The following is our main result.
|
| 136 |
+
|
| 137 |
+
Theorem 6 For any $K \in \mathbb { R } ^ { n \times n \times m \times m }$ , let $M$ is the matrix encoding the linear transformation computed by a convolutional layer parameterized by $K$ , defined as in (6). For each $u , v \in [ n ] \times [ n ]$ , let $P ^ { ( u , v ) }$ be the $m \times m$ matrix given by $P _ { c d } ^ { ( u , v ) } = ( F ^ { T } K _ { : , : , c , d } F ) _ { u v }$ . Then
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\sigma ( M ) = \bigcup _ { u \in [ n ] , v \in [ n ] } \sigma \left( P ^ { ( u , v ) } \right) .
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
The rest of this section is devoted to proving Theorem 6 through a series of lemmas.
|
| 144 |
+
|
| 145 |
+
The analysis of Section 2.1 implies that for all $c , d \in [ m ]$ , $D _ { c d } \stackrel { \mathrm { d e f } } { = } Q ^ { * } B _ { c d } Q$ is diagonal. Define
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\begin{array} { r } { L \stackrel { \mathrm { d e f } } { = } \left[ \begin{array} { c c c c } { D _ { 0 0 } } & { D _ { 0 1 } } & { . . . } & { D _ { 0 ( m - 1 ) } } \\ { D _ { 1 0 } } & { D _ { 1 1 } } & { . . . } & { D _ { 1 ( m - 1 ) } } \\ { \vdots } & { \vdots } & { . . . } & { \vdots } \\ { D _ { ( m - 1 ) 0 } } & { D _ { ( m - 1 ) 1 } } & { . . . } & { D _ { ( m - 1 ) ( m - 1 ) } } \end{array} \right] . } \end{array}
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
Lemma 7 $M$ and $L$ have the same singular values.
|
| 152 |
+
|
| 153 |
+
Proof: We have
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
\begin{array} { r l } & { M = \left[ \begin{array} { c c c } { B _ { 0 0 } } & { \ldots } & { B _ { 0 ( m - 1 ) } } \\ { \vdots } & { \vdots } & { \vdots } \\ { B _ { ( m - 1 ) 0 } } & { \ldots } & { B _ { ( m - 1 ) ( m - 1 ) } } \end{array} \right] = \left[ \begin{array} { c c c } { Q D _ { 0 0 } Q ^ { * } } & { \ldots } & { Q D _ { 0 ( m - 1 ) } Q ^ { * } } \\ { \vdots } & { \vdots } & { \vdots } \\ { Q D _ { ( m - 1 ) 0 } Q ^ { * } } & { \ldots } & { Q D _ { ( m - 1 ) ( m - 1 ) } Q ^ { * } } \end{array} \right] } \\ & { \quad \quad = R \left[ \begin{array} { c c c } { D _ { 0 0 } } & { \ldots } & { D _ { 0 ( m - 1 ) } } \\ { \vdots } & { \vdots } & { \vdots } \\ { D _ { ( m - 1 ) 0 } } & { \ldots } & { D _ { ( m - 1 ) ( m - 1 ) } } \end{array} \right] R ^ { * } = R L R ^ { * } , } \end{array}
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
where $R \stackrel { \mathrm { d e f } } { = } I _ { m } \otimes Q$ . Note that $R$ is unitary because
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
R R ^ { * } = ( I _ { m } \otimes Q ) ( I _ { m } \otimes Q ^ { * } ) = ( I _ { m } I _ { m } ) \otimes ( Q Q ^ { * } ) = I _ { m n ^ { 2 } } ;
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
this implies that $M$ and $L$ have the same singular values.
|
| 166 |
+
|
| 167 |
+
So now we have as a subproblem characterizing the singular values of a block matrix whose blocks are diagonal. To express the the characterization, it helps to reshape the nonzero elements of $L$ into a $m \times \overline { { m \times n ^ { 2 } } }$ tensor $G$ as follows: $G _ { c d w } = ( D _ { c d } ) _ { w w }$ .
|
| 168 |
+
|
| 169 |
+
Theorem 8 $\sigma ( L ) = \bigcup _ { w \in [ n ^ { 2 } ] } \sigma \left( G _ { : , : , w } \right) .$ .
|
| 170 |
+
|
| 171 |
+
Proof: Choose an arbitrary $w \in [ n ^ { 2 } ]$ , and a (scalar) singular value $\sigma$ of $G _ { : , : , w }$ whose left singular vector is $x$ and whose right singular vector is $y$ , so that $G _ { : , : , w } y = \sigma x$ . Recall that $e _ { w } \in \mathbb { R } ^ { n ^ { 2 } }$ is a standard basis vector.
|
| 172 |
+
|
| 173 |
+
We claim that $L ( y \otimes e _ { w } ) = \sigma ( x \otimes e _ { w } )$ . Since $D _ { c d }$ is diagonal, $D _ { c d } e _ { w } = ( D _ { c d } ) _ { w w } e _ { w } = G _ { c d w } e _ { w }$ Thus we have $\begin{array} { r } { ( L ( y \otimes e _ { w } ) ) _ { c } = \sum _ { d \in [ m ] } D _ { c d } y _ { d } e _ { w } = ( \sum _ { d \in [ m ] } G _ { c d w } y _ { d } ) e _ { w } = ( G _ { : , : , w } y ) _ { c } e _ { w } = \sigma x _ { c } e _ { w } , } \end{array}$ which shows that
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
{ \boldsymbol { \zeta } } ( y \otimes e _ { w } ) = \left[ { \begin{array} { c c c c } { D _ { 0 0 } } & { \ldots } & { D _ { 0 ( m - 1 ) } } \\ { D _ { 1 0 } } & { \ldots } & { D _ { 1 ( m - 1 ) } } \\ { \vdots } & { \ldots } & { \vdots } \\ { D _ { ( m - 1 ) 0 } } & { \ldots } & { D _ { ( m - 1 ) ( m - 1 ) } } \end{array} } \right] \left[ { \begin{array} { c } { y _ { 0 } e _ { w } } \\ { \vdots } \\ { y _ { m - 1 } e _ { w } } \end{array} } \right] = \left[ { \begin{array} { c } { \sigma x _ { 0 } e _ { w } } \\ { \vdots } \\ { \sigma x _ { m - 1 } e _ { w } } \end{array} } \right] = \sigma ( x \otimes e _ { w } ) .
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
If $\tilde { \sigma }$ is another singular value of $G _ { : , : , w }$ with a left singular vector $\tilde { x }$ and a right singular vector $\tilde { y }$ , then $\langle ( x \otimes e _ { w } ) , ( \tilde { x } \otimes e _ { w } ) \rangle = \langle x , \tilde { x } \rangle = 0$ and, similarly $\langle ( y \otimes e _ { w } ) , ( \tilde { y } \otimes e _ { w } ) \rangle = 0$ . Also, $\langle ( x \otimes e _ { w } ) , ( x \otimes e _ { w } ) \rangle = 1$ and $\langle ( y \otimes e _ { w } ) , ( y \otimes e _ { w } ) \rangle = 1$ .
|
| 180 |
+
|
| 181 |
+
For any $x$ and $\tilde { x }$ , whether they are equal or not, if $w \ne \tilde { w }$ , then $\langle ( x \otimes e _ { w } ) , ( \tilde { x } \otimes e _ { \tilde { w } } ) \rangle = 0$ , simply because their non-zero components do not overlap.
|
| 182 |
+
|
| 183 |
+
Thus, by taking the Kronecker product of each singular vector of $G _ { : , : , w }$ with $e _ { w }$ and assembling the results for various $w$ , we may form a singular value decomposition of $L$ whose singular values are $\cup _ { w \in [ n ^ { 2 } ] } \sigma ( G _ { : , : , w } ) .$ . This completes the proof. □
|
| 184 |
+
|
| 185 |
+
Using Lemmas 7 and Theorem 8, we are now ready to prove Theorem 6.
|
| 186 |
+
|
| 187 |
+
Proof (of Theorem 6). Recall that, for each input channel $c$ and output channel $d$ , the diagonal elements of $D _ { c , d }$ are the eigenvalues of $B _ { c , d }$ . By Theorem 5, this means that the diagonal elements of $D _ { c , d }$ are
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
\{ ( F ^ { T } K _ { : , : , c , d } F ) _ { u , v } : u , v \in [ n ] \} .
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
The elements of (9) map to the diagonal elements of $D _ { c , d }$ as follows:
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
G _ { c d w } = ( D _ { c , d } ) _ { w w } = ( F ^ { T } K _ { : , : , c , d } F ) _ { \lfloor w / m \rfloor , w \mod m }
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
and thus
|
| 200 |
+
|
| 201 |
+
$$
|
| 202 |
+
G _ { : , : , w } = \left( ( F ^ { T } K _ { : , : , c , d } F ) _ { \lfloor w / m \rfloor , w \mod m } \right) _ { c d }
|
| 203 |
+
$$
|
| 204 |
+
|
| 205 |
+
which in turn implies
|
| 206 |
+
|
| 207 |
+
$$
|
| 208 |
+
\bigcup _ { w \in [ n ^ { 2 } ] } \sigma ( G _ { : , : , w } ) = \cup _ { u \in [ n ] , v \in [ n ] } \sigma \left( \left( ( F ^ { T } K _ { : , : , c , d } F ) _ { u , v } \right) _ { c d } \right) .
|
| 209 |
+
$$
|
| 210 |
+
|
| 211 |
+
Applying Lemmas 7 and 8 completes the proof.
|
| 212 |
+
|
| 213 |
+
# 3 Regularization
|
| 214 |
+
|
| 215 |
+
We now show how to use the spectrum computed above to project a convolution onto the set of convolutions with bounded operator norm. We exploit the following key fact.
|
| 216 |
+
|
| 217 |
+
Proposition 9 (Lefkimmiatis et al. (2013), Proposition 1) Let $A \in \mathbb { R } ^ { n \times n }$ , and let $A = U D V ^ { \top }$ be its singular value decomposition. Let $\tilde { A } = U \tilde { D } \bar { V } ^ { \top }$ , where, for all $i \in [ n ] , \tilde { D } _ { i i } = \operatorname* { m i n } ( D _ { i i } , c )$ and $B = \{ X \mid | X | | _ { 2 } \leq c \}$ . Then $\tilde { A }$ is the projection of $A$ onto $\boldsymbol { B }$ ; i.e. ${ \tilde { A } } = \underset { X \in \mathcal { B } } { \arg \operatorname* { m i n } } \ | | A - X | | _ { F } .$ .
|
| 218 |
+
|
| 219 |
+
This implies that the desired projection can be obtained by clipping the singular values of linear transformation associated with a convolutional layer to the interval $[ 0 , c ]$ . Note that the eigenvectors remained the same in the proposition, hence the projected matrix is still generated by a convolution. However, after the projection, the resulting convolution neighborhood may become as large as $n \times n$ . On the other hand, we can project this convolution onto the set of convolutions with $k \times k$ neighborhoods, by zeroing out all other coefficients. NumPy code for this is in Appendix A.
|
| 220 |
+
|
| 221 |
+
Repeatedly alternating the two projections would give a point in the intersection of the two sets, i.e., a $k \times k$ convolution with bounded operator norm (Cheney and Goldstein (1959) Theorem 4, Boyd and Dattorro (2003) Section 2), and the projection onto that intersection could be found using the more complicated Dykstra’s projection algorithm (Boyle and Dykstra, 1986).
|
| 222 |
+
|
| 223 |
+
When we wish to control the operator norm during an iterative optimization process, however, repeating the alternating projections does not seem to be worth it – we found that the first two projections already often produced a convolutional layer with an operator norm close to the desired value. Furthermore, because SGD does not change the parameters very fast, we can think of a given pair of projections as providing a warm start for the next pair.
|
| 224 |
+
|
| 225 |
+
In practice, we run the two projections once every few steps, thus letting the projection alternate with the training.
|
| 226 |
+
|
| 227 |
+
# 4 Experiments
|
| 228 |
+
|
| 229 |
+
First, we validated Theorem 6 with unit tests in which the output of the code given in the introduction is compared with evaluating the singular values by constructing the full matrix encoding the linear transformation corresponding to the convolutional layer and computing its SVD.
|
| 230 |
+
|
| 231 |
+
# 4.1 Timing
|
| 232 |
+
|
| 233 |
+
We generated 4D tensors of various shapes with random standard normal values, and computed their singular values using the full matrix method, the NumPy code given above and the equivalent TensorFlow code. For small tensors, the NumPy code was faster than TensorFlow, but for larger tensors, the TensorFlow code was able to exploit the parallelism in the algorithm and run much faster on a GPU. The timing results are shown in Figure 1.
|
| 234 |
+
|
| 235 |
+
# 4.2 Regularization
|
| 236 |
+
|
| 237 |
+
We next explored the effect of regularizing the convolutional layers by clipping their operator norms as described in Section 3. We ran the CIFAR-10 benchmark with a standard 32 layer residual network with 2.4M training parameters; (He et al., 2016). This network reached a test error rate of $6 . 2 \%$ after 250 epochs, using a learning rate schedule determined by a grid search (shown by the gray plot in Figure 2). We then evaluated an algorithm that, every 100 steps, clipped the norms of the convolutional layers to various different values between 0.1 and 3.0. As expected, clipping to 2.5 and 3.0 had little impact on the performance, since the norms of the convolutional layers were between 2.5 and 2.8. Clipping to 0.1 yielded a surprising $6 . 7 \%$ test error, whereas clipping to 0.5 and 1.0 yielded test errors of $5 . 3 \%$ and $5 . 5 \%$ respectively (shown in Figure 2). A plot of test error against training time is provided in Figure 4 in Appendix B, showing that the projections did not slow down the training very much.
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
Figure 1: Time used to compute singular values. The left graph is for a $3 \times 3$ convolution on a $1 6 \times 1 6$ image with the number of input/output channels on the $x$ -axis. The right graph is for a $1 1 \times 1 1$ convolution on a $6 4 \times 6 4$ image (no curve for full matrix method is shown as this method could not complete in a reasonable time for these inputs).
|
| 241 |
+
|
| 242 |
+

|
| 243 |
+
Figure 2: Training loss and test error for ResNet model (He et al., 2016) for CIFAR-10.
|
| 244 |
+
|
| 245 |
+
# 4.3 Robustness to changes in hyperparameters
|
| 246 |
+
|
| 247 |
+
The baseline algorithm studied in the previous subsection used batch normalization. Batch normalization tends to make the network less sensitive to linear transformations with large operator norms. However, batch normalization includes trainable scaling parameters (called $\gamma$ in the original paper) that are applied after the normalization step. The existence of these parameters lead to a complicated interaction between batch normalization and methods like ours that act to control the norm of the linear transformation applied before batch normalization.
|
| 248 |
+
|
| 249 |
+
Because the effect of regularizing the operator norm is more easily understood in the absence of batch normalization, we also performed experiments with a baseline that did not use batch normalization.
|
| 250 |
+
|
| 251 |
+
Another possibility that we wanted to study was that using a regularizer may make the process overall more stable, enabling a larger learning rate. We were generally interested in whether operator-norm regularization made the training process more robust to the choice of hyperparameters.
|
| 252 |
+
|
| 253 |
+
In one experiment, we started with the same baseline as the previous subsection, but disabled batch normalization. This baseline started with a learning rate of 0.1, which was multiplied by a factor 0.95 after every epoch. We tried all combinations of the following hyperparameters: (a) the norm of the ball projected onto (no projection, 0.5, 1.0, 1.5, 2.0); (b) the initial learning rate (0.001, 0.003, 0.01, 0.03, 0.1); (c) the minibatch size (32, 64); (d) the number of epochs per decay of the learning rate (1,2,3). We tried each of the 150 combinations of the hyperparameters, trained for 100 epochs, and measured the test error. The results are plotted in Figure 3a. The operator norm regularization improved the best result, and also made the process more robust to the choice of hyperparameters.
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Figure 3: A scatterplot of the test errors obtained with different hyperparameter combinations, and different operator-norm regularizers.
|
| 257 |
+
|
| 258 |
+
We conducted a similar experiment in the presence of batch normalization, except using learning rates 0.01, 0.03, 0.1, 0.2, and 0.3. Those results are shown in Figure 3b. Regularizing the operator norm helps, even in the presence of batch normalization.
|
| 259 |
+
|
| 260 |
+
It appears that operator-norm regularization and batch normalization are not redundant, and neither dominates the other. We were surprised by this.
|
| 261 |
+
|
| 262 |
+
# 4.4 Comparison with reshaping $K$
|
| 263 |
+
|
| 264 |
+
In Section 1 we mentioned that Yoshida and Miyato (2017) approximated the linear transformation induced by $K$ by reshaping $K$ . This leads to an alternate regularization method — we compute the spectrum of the reshaped $K$ , and project it onto a ball using clipping, as above. We implemented this an experimented with it using the same network and hyperparameters as in Section 4.2 and found the following.
|
| 265 |
+
|
| 266 |
+
• We clipped the singular values of the reshaped $K$ every 100 steps. We tried various constants for the clipped value (0.05, 0.1, 0.2, 0.5, 1.0), and found that the best accuracy we achieved, using 0.2, was the same as the accuracy we achieved in Section 4.2. • We clipped the singular values of the reshaped $K$ to these same values every step, and found that the best accuracy achieved was slightly worse than the accuracy achieved in the previous step. We observed similar behavior when we clipped norms using our method. • Most surprisingly, we found that clipping norms by our method on a GPU was about $2 5 \%$ faster than clipping the singular values of the reshaped $K$ — when we clipped after every step, on the same machine, 10000 batches of CIFAR10 took 14490 seconds when we clipped the reshaped $K$ , whereas they took 11004 seconds with our exact method! One possible explanation is parallelization — clipping reshaped $K$ takes $O ( m ^ { 3 } k ^ { 2 } )$ flops, whereas our method does $m ^ { 2 }$ FFTs, followed by $\bar { n ^ { 2 } } m \times m$ SVDs, which takes $O ( m ^ { 3 } n ^ { 2 } )$ flops, but these can be parallelized and completed in as little as $O ( n ^ { 2 } \log n + m ^ { 3 } )$ time.
|
| 267 |
+
|
| 268 |
+
Clearly this is only one dataset, and the results may not generalize to other sets. However it does suggest that finding the full spectrum of the convolutional layer may be no worse than computing heuristic approximations, both in classification accuracy and speed.
|
| 269 |
+
|
| 270 |
+
# 5 Acknowledgements
|
| 271 |
+
|
| 272 |
+
We thank Tomer Koren, Nishal Shah, Yoram Singer and Chiyuan Zhang for valuable conversations.
|
| 273 |
+
|
| 274 |
+
# References
|
| 275 |
+
|
| 276 |
+
P. L. Bartlett, D. J. Foster, and M. J. Telgarsky. Spectrally-normalized margin bounds for neural networks. In NIPS, pages 6240–6249, 2017.
|
| 277 |
+
|
| 278 |
+
Adel Bibi, Bernard Ghanem, Vladlen Koltun, and Rene Ranftl. Deep layers as stochastic solvers. ICLR, 2019.
|
| 279 |
+
|
| 280 |
+
S. Boyd and J. Dattorro. Alternating projections, 2003. https://web.stanford.edu/class/ee392o/alt_proj.pdf.
|
| 281 |
+
|
| 282 |
+
J. P. Boyle and R. L. Dykstra. A method for finding projections onto the intersection of convex sets in hilbert spaces. In Advances in order restricted statistical inference, pages 28–47. Springer, 1986.
|
| 283 |
+
|
| 284 |
+
C. Chao. A note on block circulant matrices. Kyungpook Mathematical Journal, 14:97–100, 1974.
|
| 285 |
+
|
| 286 |
+
W. Cheney and A. A. Goldstein. Proximity maps for convex sets. Proceedings of the American Mathematical Society, 10(3):448–450, 1959. ISSN 00029939, 10886826. URL http://www.jstor.org/stable/ 2032864.
|
| 287 |
+
|
| 288 |
+
M. Cisse, P. Bojanowski, E. Grave, Y. Dauphin, and N. Usunier. Parseval networks: Improving robustness to adversarial examples. ICML, 2017.
|
| 289 |
+
|
| 290 |
+
H. Drucker and Y. Le Cun. Improving generalization performance using double backpropagation. IEEE Transactions on Neural Networks, 3(6):991–997, 1992.
|
| 291 |
+
|
| 292 |
+
I. Goodfellow, Y. Bengio, and A. Courville. Deep Learning. MIT Press, 2016. http://www. deeplearningbook.org.
|
| 293 |
+
|
| 294 |
+
H. Gouk, E. Frank, B. Pfahringer, and M. Cree. Regularisation of neural networks by enforcing lipschitz continuity. arXiv preprint arXiv:1804.04368, 2018a.
|
| 295 |
+
|
| 296 |
+
H. Gouk, B. Pfahringer, E. Frank, and M. Cree. MaxGain: Regularisation of neural networks by constraining activation magnitudes. arXiv preprint arXiv:1804.05965, 2018b.
|
| 297 |
+
|
| 298 |
+
R. M. Gray. Toeplitz and circulant matrices: A review. Foundations and Trends® in Communications and Information Theory, 2(3):155–239, 2006.
|
| 299 |
+
|
| 300 |
+
K. He, X. Zhang, S. Ren, and J. Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision, pages 630–645. Springer, 2016. http://download.tensorflow.org/models/official/resnet_v2_imagenet_checkpoint.tar.gz; downloaded on on 5/1/18.
|
| 301 |
+
|
| 302 |
+
M. Hein and M. Andriushchenko. Formal guarantees on the robustness of a classifier against adversarial manipulation. In NIPS, pages 2266–2276, 2017.
|
| 303 |
+
|
| 304 |
+
S. Hochreiter. Untersuchungen zu dynamischen neuronalen netzen. Diploma, Technische Universität München, 91:1, 1991.
|
| 305 |
+
|
| 306 |
+
S. Hochreiter, Y. Bengio, P. Frasconi, J. Schmidhuber, et al. Gradient flow in recurrent nets: the difficulty of learning long-term dependencies, 2001.
|
| 307 |
+
|
| 308 |
+
R. A. Horn and C. R. Johnson. Matrix Analysis. Cambridge University Press, New York, NY, USA, 2nd edition, 2012. ISBN 0521548233, 9780521548236.
|
| 309 |
+
|
| 310 |
+
A. K. Jain. Fundamentals of digital image processing. Englewood Cliffs, NJ: Prentice Hall„ 1989.
|
| 311 |
+
|
| 312 |
+
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 313 |
+
|
| 314 |
+
S. Lefkimmiatis, J. P. Ward, and M. Unser. Hessian Schatten-norm regularization for linear inverse problems. IEEE transactions on image processing, 22(5):1873–1888, 2013.
|
| 315 |
+
|
| 316 |
+
T. Miyato, T. Kataoka, M. Koyama, and Y. Yoshida. Spectral normalization for generative adversarial networks. ICLR, 2018.
|
| 317 |
+
|
| 318 |
+
J. Pennington, S. Schoenholz, and S. Ganguli. Resurrecting the sigmoid in deep learning through dynamical isometry: theory and practice. In Advances in neural information processing systems, pages 4788–4798, 2017.
|
| 319 |
+
|
| 320 |
+
A. M. Saxe, J. L. McClelland, and S. Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv preprint arXiv:1312.6120, 2013.
|
| 321 |
+
|
| 322 |
+
Y. Yoshida and T. Miyato. Spectral norm regularization for improving the generalizability of deep learning. arXiv preprint arXiv:1705.10941, 2017.
|
| 323 |
+
|
| 324 |
+
# A NumPy code for operator norm projection
|
| 325 |
+
|
| 326 |
+
def Clip_OperatorNorm(kernel, input_shape, clip_to): transform_coefficients $=$ np.fft.fft2(kernel, input_shape, axes $\displaystyle { \varepsilon }$ [0, 1]) U, D, $\texttt { V } =$ np.linalg.svd(transform_coefficients, compute_uv $\mathbf { \bar { \Pi } } = \mathbf { \bar { \Pi } }$ True, full_matrices $\underline { { \underline { { \mathbf { \Pi } } } } }$ False) D_clipped $=$ np.minimum(D, clip_to)
|
| 327 |
+
|
| 328 |
+
if kernel.shape[2] $>$ kernel.shape[3]:
|
| 329 |
+
|
| 330 |
+
clipped_transform_coefficients $=$ np.matmul(U, D_clipped[..., None] \* V) else:
|
| 331 |
+
|
| 332 |
+
clipped_transform_coefficients $=$ np.matmul(U \* D_clipped[..., None, :], V) clipped_kernel $=$ np.fft.ifft2(clipped_transform_coefficients, axes $=$ [0, 1]).real return clipped_kernel[np.ix_(\*[range(d) for d in kernel.shape])]
|
| 333 |
+
|
| 334 |
+
# B Test error vs. training time
|
| 335 |
+
|
| 336 |
+
Figure 4 shows the plots of test error vs. training time in our CIFAR-10 experiment.
|
| 337 |
+
|
| 338 |
+

|
| 339 |
+
Figure 4: Test error vs. training time for ResNet model (He et al., 2016) for CIFAR-10.
|
| 340 |
+
|
| 341 |
+
C The official pre-trained ResNet model
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure 5: Plot of the singular values of the linear operators associated with the convolutional layers of the pretrained "ResNet V2" from the TensorFlow website.
|
| 345 |
+
|
| 346 |
+
The singular values of the convolutional layers from the official “Resnet $\mathbf { V } 2 ^ { \mathbf { \mathfrak { s } } }$ pre-trained model (He et al., 2016) are plotted in Figure 5. The singular values are ordered by value. Only layers with kernels larger than $1 \times 1$ are plotted. The curves are plotted with a mixture of red and green; layers closer to the input are plotted with colors with a greater share of red. The transformations with the largest operator norms are closest to the inputs. As the data has undergone more rounds of processing, as we proceed through the layers, the number of non-negligible singular values increases for a while, but at the end, it tapers off.
|
| 347 |
+
|
| 348 |
+

|
| 349 |
+
Figure 6: Plot of the ratio of singular values to maximum singular value of the linear operators associated with the convolutional layers of the pretrained "ResNet V2" from the TensorFlow website.
|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
Figure 7: Plot of the ratio of singular values to maximum singular value of the linear operators associated with the convolutional layers of the pretrained "ResNet V2" normalized by size of the convolution.
|
| 353 |
+
|
| 354 |
+
In Figure 5, we plotted the singular values ordered by value. It can be observed that while singular values in the first layer are much larger than the rest, many layers have a lot of singular values that are pretty big. For example, most of the layers have at least 10000 singular values that are at least 1. To give a complementary view, Figure 6 presents a plot of the ratios of the singular values in each layer with the largest singular value in that layer. We see that the effective rank of the convolutional layers is larger closer to the inputs.
|
| 355 |
+
|
| 356 |
+
Figure 6 shows that different convolutional layers have significantly different numbers of non-negligible singular values. A question that may arise is to what extent this was due to the fact that different layers simply are of different sizes, so that the total number of their singular values, tiny or not, was different. To look into this, instead of plotting the singular value ratios as a function of the rank of the singular values, as in the Figure 6, we normalized the values on the horizontal axis by dividing by the total number of singular values. The result is shown in Figure 7.
|
md/train/rJg4YGWRb/rJg4YGWRb.md
ADDED
|
@@ -0,0 +1,344 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ATTENTION-BASED GRAPH NEURAL NETWORK FORSEMI-SUPERVISED LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recently popularized graph neural networks achieve the state-of-the-art accuracy on a number of standard benchmark datasets for graph-based semi-supervised learning, improving significantly over existing approaches. These architectures alternate between a propagation layer that aggregates the hidden states of the local neighborhood and a fully-connected layer. Perhaps surprisingly, we show that a linear model, that removes all the intermediate fully-connected layers, is still able to achieve a performance comparable to the state-of-the-art models. This significantly reduces the number of parameters, which is critical for semi-supervised learning where number of labeled examples are small. This in turn allows a room for designing more innovative propagation layers. Based on this insight, we propose a novel graph neural network that removes all the intermediate fullyconnected layers, and replaces the propagation layers with attention mechanisms that respect the structure of the graph. The attention mechanism allows us to learn a dynamic and adaptive local summary of the neighborhood to achieve more accurate predictions. In a number of experiments on benchmark citation networks datasets, we demonstrate that our approach outperforms competing methods. By examining the attention weights among neighbors, we show that our model provides some interesting insights on how neighbors influence each other.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
One of the major bottlenecks in applying machine learning in practice is collecting sizable and reliable labeled data, essential for accurate predictions. One way to overcome the problem of limited labeled data is semi-supervised learning, using additional unlabeled data that might be freely available. In this paper, we are interested in a scenario when this additional unlabeled data is available in a form of a graph. The graph provides underlying pairwise relations among the data points, both labeled and unlabeled.
|
| 12 |
+
|
| 13 |
+
Of particular interest are those applications where the presence or absence of an edge between two data points is determined by nature, for instance as a result of human activities or natural relations. As a concrete example, consider a citation network. Each node in the graph is a published research paper, associated with a bag-of-words feature vector. An (directed) edge indicates a citation link. Presence of an edge indicates that the authors of a paper have consciously determined to refer to the other paper, and hence captures some underlying relation that might not be inferred from the bag-of-words feature vectors alone. Such external graph data are available in several applications of interest, such as classifying users connected via a social network, items and customers connected by purchase history, users and movies connected by viewing history, and entities in a knowledge graph connected by relationships. In this paper, we are interested in the setting where the graph is explicitly given and represents additional information not present in the feature vectors.
|
| 14 |
+
|
| 15 |
+
The goal of such graph-based semi-supervised learning problems is to classify the nodes in a graph using a small subset of labeled nodes and all the node features. There is a long line of literature on this topic since Blum & Chawla (2001) which seeks graph cuts that preserve the known labels and Zhu et al. (2003) which uses graph Laplacian to regularize the nearby nodes to have similar labels. However, Kipf & Welling (2016) recently demonstrated that the existing approaches can be significantly improved upon on a number of standard benchmark datasets, using an innovative neural network architecture on graph-based data known collectively as graph neural networks.
|
| 16 |
+
|
| 17 |
+
Inspired by this success, we seek to understand the reason behind the power of graph neural networks, to guide our design of a novel architecture for semi-supervised learning on graphs. To this end, we first found that a linear classifier of multinomial logistic regression achieves the accuracy comparable to the best known graph neural network. This linear classifier removes all intermediate non-linear activation layers, and only keeps the linear propagation function from neighbors in graph neural networks. This suggests the importance of aggregation information form the neighbors in the graph. This further motivates us to design a new way of aggregating neighborhood information through attention mechanism since, intuitively, neighbors might not be equally important. This proposed attention-based graph neural network captures this intuition and $( a )$ greatly reduces the model complexity, with only a single scalar parameter at each intermediate layer; $( b )$ discovers dynamically and adaptively which nodes are relevant to the target node for classification; and $( c )$ improves upon state-of-the-art methods in terms of accuracy on standard benchmark datasets. Further, the learned attention strengths provide some form of interpretability. They provide insights on why a particular prediction is made on a target node and which neighbors are more relevant in making that decision.
|
| 18 |
+
|
| 19 |
+
# 2 RELATED WORK
|
| 20 |
+
|
| 21 |
+
Given a graph $G ( V , E )$ with a set of $n$ nodes $V$ and a set of edges $E$ , we let $X _ { i } \in \mathbb { R } ^ { d _ { x } }$ denote the feature vector at node $i$ and let $Y _ { i }$ denote the true label. We use $Y _ { L }$ to denote the labels that are revealed to us for a subset $L \subset V$ . We let $X = [ X _ { 1 } , \ldots , X _ { n } ]$ denote all features, labeled and unlabeled.
|
| 22 |
+
|
| 23 |
+
Traditionally, semi-supervised learning using both labeled and un-labled data has been solved using two different approaches - Graph Laplacian based algorithms solving for locally consistent solutions (Zhou et al., 2004b) and Expectation Maximization based algorithms (Nigam et al., 2006) where true-labels of the unlabeled data points are considered as the latent variables of a generative model.
|
| 24 |
+
|
| 25 |
+
Graph Laplacian regularization. Based on the assumption that nearby nodes in a graph are more likely to have the same labels, the graph information has been used as explicit regularization:
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
\begin{array} { r c l } { { \mathcal L } ( X , Y _ { L } ) } & { { = } } & { { { \mathcal L } _ { \mathrm { l a b e l } } ( X _ { L } , Y _ { L } ) + \lambda { \mathcal L } _ { G } ( X ) ~ , } } \end{array}
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
where $\begin{array} { r } { \mathcal { L } _ { \mathrm { l a b e l } } = \sum _ { i \in L } l ( Y _ { i } , f ( X _ { i } ) ) } \end{array}$ is the standard supervised loss for some loss functions $l$ and $\mathcal { L } _ { G }$ is the graph-based regularization, for example $\begin{array} { r } { \mathcal { L } _ { G } = \sum _ { ( i , j ) \in E } \| f ( X _ { i } ) - f ( X _ { j } ) \| ^ { 2 } } \end{array}$ , which is called the graph Laplacian regularization. Earlier approaches are non-parametric and searches over all $f$ considering it as a look-up table. Most popular one is the Label Propagation (Zhu & Ghahramani, 2002) that forces the estimated labels to agree in the labeled instances and uses weighted graph Laplacian. This innovative formulation admits a closed form solution which makes it practically attractive with very low computationally cost. ManiReg (Belkin et al., 2006) replaces supervised loss with that of a support vector machine. ICA (Lu & Getoor, 2003) generalizes LP by allowing more general local updates. A more thorough survey on using non-neural network methods for semi-supervised learning can be found in (Chapelle et al., 2009).
|
| 32 |
+
|
| 33 |
+
More recent approaches are parametric, using deep neural networks. SemiEmb (Weston et al., 2012) was the first to use a deep neural network to model $f ( x )$ and minimize the above loss. Planetoid (Yang et al., 2016) significantly improves upon the existing graph regularization approaches by replacing the regularization by another loss based on skip-grams (defined below). In a slightly different context, Buchnik & Cohen (2017) show that the accuracy of these approaches can be further improved by bootstrapping these models sequentially.
|
| 34 |
+
|
| 35 |
+
Unsupervised node embedding for semi-supervised learning. Several approaches have been proposed to embed the nodes in some latent Euclidean space using only the connectivity in graph $G$ . Once the embedding is learned, standard supervised learning is applied on those embedded features to train a model. Inspired by the success of word2vec (Le & Mikolov, 2014), several approaches define “skip-grams” on graphs as the neighborhood (context) of a node on the graph and tries to maximize the posterior probability of observing those skip-grams. DeepWalk (Perozzi et al., 2014) and node2vec (Grover & Leskovec, 2016) use random walks as skip-grams, LINE (Tang et al., 2015) uses local proximities, LASAGNE (Faerman et al., 2017) uses the Personalized PageRank random walk. Graph2Gauss (A. Bojchevski, 2017) represents a node as a Gaussian distribution, and minimizes the divergence between connected pairs. Yang et al. (2017) provide a post-processing scheme that takes any node embedding and attempts to improve it by by taking the weighted sum of the given embeddings with Personalized PageRank weights. The strength of these approaches is universality, as the node embedding does not depend on the particular task at hand (and in particular the features or the labels). However, as they do not use the node features and the training only happens after embedding, they cannot meet the performance of the state-of-the-art approaches (see DeepWalk in Table 2).
|
| 36 |
+
|
| 37 |
+
Graph Neural Network (GNN). Graph neural networks are extensions of neural networks to structured data encoded as a graph. Originally introduced as extensions of recurrent neural networks, GNNs apply recurrent layers to each node with additional local averaging layer (Gori et al., 2005; Scarselli et al., 2009). However, as the weights are shared across all nodes, GNNs can also be interpreted as extensions of convolutional neural networks on a 2D grid to general graphs. Typically, a message aggregation step followed by some neural network architecture is iteratively applied. The model parameters are trained on (semi-)supervised examples with labels. We give a typical example of a GNN in Section 3, but several diverse variations have been proposed in (Bruna et al., 2013; Duvenaud et al., 2015; Li et al., 2015; Henaff et al., 2015; Sukhbaatar et al., 2016; Bronstein et al., 2016; Defferrard et al., 2016; Dai et al., 2016; Atwood & Towsley, 2016; Niepert et al., 2016; Such et al., 2017; Hamilton et al., 2017; Schlichtkrull et al., 2017; Such et al., 2017). GNNs have been successfully applied in diverse applications such as molecular activation prediction (Gilmer et al., 2017), community detection (Bruna & Li, 2017), matrix completion (Berg et al., 2017), combinatorial optimization (Dai et al., 2017; Nowak et al., 2017), and detecting similar binary codes (Xu et al., 2017).
|
| 38 |
+
|
| 39 |
+
In particular, for the benchmark datasets that we consider in this paper, Kipf & Welling (2016) proposed a simple but powerful architecture called Graph Convolutional Network (GCN) that achieves the state-of-the-art accuracy. In the following section, $( a )$ we show that the performance of GCN can be met by a linear classifier; and $( b )$ use this insight to introduce novel graph neural networks that compare favourably against the state-of-the-art approaches on benchmark datasets.
|
| 40 |
+
|
| 41 |
+
# 3 DISSECTION OF GRAPH NEURAL NETWORK
|
| 42 |
+
|
| 43 |
+
In this section, we propose a novel Graph Neural Network (GNN) model which we call Attentionbased Graph Neural Network (AGNN), and compare its performance to state-of-the-art models on benchmark citation networks in Section 5. We seek a model $Z = f ( X , A ) \in \mathbb { R } ^ { n \times d _ { y } }$ that predicts at each node one of the $d _ { y }$ classes. $Z _ { i c }$ is the estimated probability that the label at node $i \in [ n ]$ is $c \in [ d _ { y } ]$ given the features $X$ and the graph $A$ . The data features $X \in \mathbb { R } ^ { n \times d _ { x } }$ has at each row $d _ { x }$ features for each node, and $A \in \{ 0 , 1 \} ^ { \bar { n } \times \bar { n } }$ is the adjacency matrix of $G$ .
|
| 44 |
+
|
| 45 |
+
The forward pass in a typical GNN alternates between a propagation layer and a single layer perceptron. Let $t$ be the layer index. We use $H ^ { ( t ) } \in \mathbb { R } ^ { n \times d _ { h } }$ to denote the current (hidden) states, with the $i$ -th row $H _ { i } ^ { ( t ) }$ as the $d _ { h }$ dimensional hidden state of node $i$ . A propagation layer with respect to a propagation matrix $P \in \mathbb { R } ^ { n \times n }$ is defined as
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\tilde { H } ^ { ( t ) } = P H ^ { ( t ) } .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
For example, the natural random walk1 $P = D ^ { - 1 } A$ gives $\begin{array} { r } { \tilde { H } _ { i } ^ { ( t ) } = ( 1 / | N ( i ) | ) \sum _ { j \in N ( i ) } H _ { j } ^ { ( t ) } } \end{array}$ . The neighborhood of node $i$ is denoted by $N ( i )$ , and $D = \mathrm { d i a g ( A { \bf 1 } ) }$ . This is a simple local averaging common in consensus or random walk based approaches. Typical propagation layer respects the adjacency pattern in $A$ , performing a variation of such local averaging. GNNs encode the graph structure of $A$ into the model via this propagation layer, which can be also interpreted as performing a graph convolution operation as discussed in Kipf & Welling (2016). Next, a single layer perceptron is applied on each node separately and the weights $W ^ { ( t ) }$ are shared across all the nodes:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
{ \cal H } ^ { ( t + 1 ) } = \sigma ( \tilde { H } ^ { ( t ) } W ^ { ( t ) } ) \ ,
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $W ^ { ( t ) } \in \mathbb { R } ^ { d _ { h _ { t + 1 } } \times d _ { h _ { t } } }$ is the weight matrix and $\sigma ( \cdot )$ is an entry-wise activation function. This weight sharing reduces significantly the number of parameters to be trained, and encodes the invariance property of graph data, i.e. two nodes that are far apart but have the similar neighboring features and structures should be classified similarly. There are several extensions to this model as discussed in the previous section, but this standard graph neural network has proved powerful in several problems over graphs, e.g. (Bruna & Li, 2017; Berg et al., 2017; Dai et al., 2017).
|
| 58 |
+
|
| 59 |
+
Graph Convolutional Network (GCN). Kipf & Welling (2016) introduced a simple but powerful architecture, and achieved the state-of-the-art performance in benchmark citation networks (see Table 2). GCN is a special case of GNN which stacks two layers of specific propagation and perceptron:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r c l } { { { \cal H } ^ { ( 1 ) } } } & { { = } } & { { \mathrm { R e L U } \big ( ( P X ) { \cal W } ^ { ( 0 ) } \big ) ~ , } } \\ { { Z ~ = } } & { { f ( X , { \cal A } ) } } & { { = } } & { { \mathrm { s o f t m a x } \big ( ( P { \cal H } ^ { ( 1 ) } ) { \cal W } ^ { ( 1 ) } \big ) ~ , } } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
with a choice of $P = \tilde { D } ^ { - 1 / 2 } \tilde { A } \tilde { D } ^ { - 1 / 2 }$ , where ${ \tilde { A } } = A + \mathbb { I }$ , I is the identity matrix, $\tilde { D } = \mathrm { d i a g } ( \tilde { A } \mathbf { 1 } )$ and $\mathbb { 1 }$ is the all-ones vector. $\mathrm { R e L U } ( a ) = \operatorname* { m a x } \{ 0 , a \}$ is an entry-wise rectified linear activation function, and softmax $\cdot ( [ a _ { 1 } , \dots , a _ { k } ] ) = ( 1 / Z ) [ \exp ( a _ { 1 } ) , \dots , \exp ( a _ { k } ) ]$ with $\begin{array} { r } { Z = \sum _ { i } \exp ( a _ { i } ) } \end{array}$ is applied rowwise. Hence, the output is the predicted likelihoods on the $d _ { y }$ dimensional probability simplex. The weights $W ^ { ( 0 ) }$ and $W ^ { ( 1 ) }$ are trained to minimize the cross-entropy loss over all labeled examples $L$ :
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\begin{array} { r c l } { \mathcal { L } } & { = } & { \displaystyle - \sum _ { i \in L } \sum _ { c = 1 } ^ { d _ { y } } Y _ { i c } \ln Z _ { i c } . } \end{array}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
Graph Linear Network (GLN). To better understand GCN, we remove the intermediate nonlinear activation units from GCN, which gives Graph Linear Network defined as
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r c l } { { Z } } & { { = } } & { { f ( X , A ) } } & { { = } } & { { \mathrm { s o f t m a x } \big ( ( \mathrm { P ^ { 2 } X } ) { \mathrm { W } } ^ { ( 0 ) } { \mathrm { W } } ^ { ( 1 ) } \big ) \ , } } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
with the same choice of $P = \tilde { D } ^ { - 1 / 2 } \tilde { A } \tilde { D } ^ { - 1 / 2 }$ as in GCN. The weights $W ^ { ( 0 ) }$ and $W ^ { ( 1 ) }$ have the same dimensions as GCN and are trained on a cross entropy loss in (2). The two propagation layers simply take (linear) local average of the raw features weighted by their degrees, and at the output layer a simple linear classifier (multinomial logistic regression) is applied. This allows us to separate the gain in the linear propagation layer and the non-linear perceptron layer.
|
| 78 |
+
|
| 79 |
+
Comparing the differences in performances in Table 2, we show that, perhaps surprisingly, GLN achieves an accuracy comparable to the that of the best GNN, and sometimes better. This suggests that, for citation networks, the strength of the general GNN architectures is in the propagation layer and not in the perceptron layer. On the other hand, the propagation layers are critical in achieving the desired performance, as is suggested in Table 2. There are significant gaps in accuracy for those approaches not using the graph, i.e. T-SVM, and also those that use the graph differently, such as Label Propagation (LP) and Planetoid. Based on this observation, we propose replacing the propagation layer of GLN with an attention mechanism and test it on the benchmark datasets.
|
| 80 |
+
|
| 81 |
+
# 4 ATTENTION-BASED GRAPH NEURAL NETWORK (AGNN).
|
| 82 |
+
|
| 83 |
+
The original propagation layer in GCN and several other graph neural networks such as (Defferrard et al., 2016; Atwood & Towsley, 2016; Monti et al., 2016; Such et al., 2017) use a static (does not change over the layers) and non-adaptive (does not take into account the states of the nodes) propagation, e.g. $P _ { i j } = 1 / \sqrt { | N ( i ) | | N ( j ) | }$ . Such propagations are not able to capture which neighbor is more relevant to classifying a target node, which is critical in real data where not all edges imply the same types or strengths of relations.
|
| 84 |
+
|
| 85 |
+
We need novel dynamic and adaptive propagation layers, capable of capturing the relevance of different edges, which leads to more complex graph neural networks with more parameters. However, training such complex models is challenging in the semi-supervised setting, as the typical number of samples we have for each class is small; it is 20 in the standard benchmark dataset. This is evidenced in Table 2 where more complex graph neural network models by Verma et al. (2017), Monti et al. (2016), and Such et al. (2017) do not improve upon the simple GCN.
|
| 86 |
+
|
| 87 |
+
On the other hand, our experiments with GLN suggests that we can remove all the perceptron layers and focus only on improving the propagation layers. To this end, we introduce a novel Attentionbased Graph Neural Network (AGNN). AGNN is simple; it only has a single scalar parameter $\beta ^ { ( t ) }$ at each intermediate layer. AGNN captures relevance; the proposed attention mechanism over neighbors in (5) learns which neighbors are more relevant and weighs their contributions accordingly. This builds on the long line of successes of attention mechanisms in summarizing long sentences or large images, by capturing which word or part-of-image is most relevant ( $\mathrm { { X u } }$ et al., 2015; Graves et al., 2014; Bahdanau et al., 2014). Particularly, we use the attention formulation similar to the one used in Graves et al. (2014).2 It only has one parameter and we found this is important for successfully training the model when the number of labels is small as in our semi-supervised learning setting.
|
| 88 |
+
|
| 89 |
+
# 4.1 AGNN MODEL
|
| 90 |
+
|
| 91 |
+
We start with a word-embedding layer that maps a bag-of-words representation of a document into an averaged word embedding, and the word embedding $W ^ { ( 0 ) } \in \mathbb { R } ^ { d _ { x } \times d _ { h } }$ is to be trained as a part of the model:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\begin{array} { r c l } { { H ^ { ( 1 ) } } } & { { = } } & { { \mathrm { R e L U } ( X W ^ { ( 0 ) } ) . } } \end{array}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
This is followed by layers of attention-guided propagation layers parameterized by $\beta ^ { ( t ) } \in \mathbb { R }$ at each layer,
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { r c l } { { H ^ { ( t + 1 ) } } } & { { = } } & { { P ^ { ( t ) } H ^ { ( t ) } , } } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where the propagation matrix $P ^ { ( t ) } \in \mathbb { R } ^ { n \times n }$ is also a function of the input states $H ^ { ( t ) }$ and is zero for absent edges such that the output row-vector of node $i$ is
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
H _ { i } ^ { ( t + 1 ) } = \sum _ { j \in N ( i ) \cup \{ i \} } P _ { i j } ^ { ( t ) } H _ { j } ^ { ( t ) } ,
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
with $P _ { i } ^ { ( t ) } = \mathrm { s o f t m a x } \Big ( [ \beta ^ { ( t ) } \cos ( H _ { i } ^ { ( t ) } , H _ { j } ^ { ( t ) } ) ] _ { j \in N ( i ) \cup \{ i \} } \Big )$ and $\cos ( x , y ) = x ^ { T } y / \| x \| \| y \|$ with the $L _ { 2 }$ norm $\lVert x \rVert$ , for $t \in \{ 1 , \ldots , \ell \}$ and an integer $\ell$ . Here $\ell$ is the number of propagation layers. Note that the new propagation above is dynamic; propagation changes over the layers with differing $\beta ^ { ( t ) }$ and also the hidden states. It is also adaptive; it learns to weight more relevant neighbors higher. We add the self-loop in the propagation to ensure that the features and the hidden states of the node itself are not lost in the propagation process. The output layer has a weight $W ^ { ( 1 ) } \in \mathbb { R } ^ { d _ { h } \times d _ { y } }$ :
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
Z ~ = ~ f ( X , A ) ~ = ~ \mathrm { s o f t m a x } \big ( H ^ { ( \ell + 1 ) } W ^ { ( 1 ) } \big ) \ .
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
The weights $W ^ { ( 0 ) } , W ^ { ( 1 ) }$ , and $\beta ^ { ( t ) }$ ’s are trained on a cross entropy loss in (2). To ease the notations, we have assumed that the input feature vectors to the first and last layers are augmented with a scalar constant of one, so that the standard bias term can be included in the parameters $W ^ { ( 0 ) }$ and $W ^ { ( 1 ) }$ .
|
| 116 |
+
|
| 117 |
+
The softmax function at attention ensures that the propagation layer $P ^ { ( t ) }$ row-sums to one. The attention from node $j$ to node $i$ is
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\begin{array} { r c l } { P _ { i j } ^ { ( t ) } } & { = } & { ( 1 / C ) e ^ { \beta ^ { ( t ) } \cos ( H _ { i } ^ { ( t ) } , H _ { j } ^ { ( t ) } ) } , } \end{array}
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
$\begin{array} { r } { C = \sum _ { j \in N ( i ) \cup \{ i \} } e ^ { \beta ^ { ( t ) } \cos ( H _ { i } ^ { ( t ) } , H _ { j } ^ { ( t ) } ) } } \end{array}$ eβ(t) cos(H(t)i ,H(t)j ) which captures how relevant j is to i, as measured by the cosine of the angle between the corresponding hidden states. We show how we can interpret the attentions in Section 5.2 and show that the attention selects neighbors with the same class to be more relevant. On the standard benchmark datasets on citation networks, we show in Section 5 that this architecture achieves the best performance in Table 2.
|
| 124 |
+
|
| 125 |
+
Here we note that independently from this work attention over sets has been proposed as “neighborhood attention” (Duan et al., 2017; Hoshen, 2017) for a different application. The main difference of AGNN with respect to these work is the fact that in AGNN attention is computed over a neighborhood of a node on a graph, whereas in these work attention over set of all entities is used to construct a “soft neighborhood”.
|
| 126 |
+
|
| 127 |
+
# 5 EXPERIMENTS ON BENCHMARK CITATION NETWORKS
|
| 128 |
+
|
| 129 |
+
On standard benchmark datasets of three citation networks, we test our proposed AGNN model on semi-supervised learning tasks. We test on a fixed split of labeled/validation/test sets from Yang et al. (2016) and compare against baseline methods in Table 2. We also test it on random splits of the same sizes in Table 3, and random splits with larger number of labeled nodes in Table 4.
|
| 130 |
+
|
| 131 |
+
Benchmark Datasets. A citation network dataset consists of documents as nodes and citation links as directed edges. Each node has a human annotated topic from a finite set of classes and a feature vector. We consider three datasets3. For CiteSeer and Cora datasets, the feature vector has binary entries indicating the presence/absence of the corresponding word from a dictionary. For PubMed dataset, the feature vector has real-values entries indicating Term Frequency-Inverse Document Frequency (TF-IDF) of the corresponding word from a dictionary. Although the networks are directed, we use undirected versions of the graphs for all experiments, as is common in all baseline approaches.
|
| 132 |
+
|
| 133 |
+
Labeled nodes
|
| 134 |
+
Table 1: Citation Network Dataset
|
| 135 |
+
|
| 136 |
+
<table><tr><td>Dataset</td><td>Nodes</td><td>Edges</td><td>Classes</td><td>Features</td><td>Table 2</td><td>Table 3</td><td>Table 4</td><td></td></tr><tr><td>CiteSeer</td><td>3,327</td><td>4,732</td><td>6</td><td>3,703</td><td>120</td><td>120</td><td>2,218</td><td>2,994</td></tr><tr><td>Cora</td><td>2,708</td><td>5,429</td><td>7</td><td>1,433</td><td>140</td><td>140</td><td>1,805</td><td>2,437</td></tr><tr><td>PubMed</td><td>19,717</td><td>44,328</td><td>3</td><td>500</td><td>60</td><td>60</td><td>13,145</td><td>17,745</td></tr></table>
|
| 137 |
+
|
| 138 |
+
Experimental setup. The accuracy of the baseline methods are all taken from existing literature. If a baseline result is not reported in the existing literature, we intentionally left those cells empty in the table for fairness, as opposed to running those experiments ourselves on untuned hyperparameters. We train and test only the two models we propose: GLN for comparisons and our proposed AGNN model. We do not use the validation set labels in training, but use them for optimizing hyperparameters like dropout rate, learning rate, and $L _ { 2 }$ -regularization factor. For AGNN, we use a fixed number of $d _ { h } = 1 6$ units in the hidden layers and use 4 propagation layers $\ell = 4$ ) for CiteSeer and Pubmed and 3 propagation layers $\ell = 3$ ) for Cora as defined in (7). For GLN, we use 2 propagation layers as defined in (1). We row-normalize the input feature vectors, as is standard in the literature. The tables below show the average accuracy with the standard error over 100 training instances with random weight initializations. We implement our model on TensorFlow (Abadi et al., 2016), and the computational complexity of evaluating AGNN is $O ( \ell d _ { h } | E | + d _ { x } d _ { h } n )$ . Detailed desription of the experiments is provided in Appendix B.
|
| 139 |
+
|
| 140 |
+
# 5.1 PREDICTION ACCURACY
|
| 141 |
+
|
| 142 |
+
Fixed data splits. In this first experiment, we use the fixed data splits from Yang et al. (2016) as they are the standard benchmark data splits in literature. All experiments are run on the same fixed split of 20 labeled nodes for each class, 500 nodes for validation, 1,000 nodes for test, and the rest of nodes as unlabeled data. Perhaps surprisingly, the linear classifier GLN we proposed in (3) achieves performance comparable to or exceeding the state-of-the-art performance of GCN. This leads to our novel attention-based model AGNN defined in (6), which achieves the best accuracy on all datasets with a gap larger than the standard error. The classification accuracy of all the baseline methods are collected from (Yang et al., 2016; Kipf & Welling, 2016; Such et al., 2017; Monti et al., 2016; Buchnik & Cohen, 2017; Verma et al., 2017).
|
| 143 |
+
|
| 144 |
+
In semi-supervised learning on graphs, it is critical to utilize both the structure of the graph and the node features. Methods not using all the given data achieve performance far from the stateof-the-art. Supervised methods–Single and Multi-layer Perceptrons–only use the labeled examples $( Y _ { L } , X _ { L } )$ . Semi-supervised methods, e.g. T-SVM, only use the labeled and unlabeled examples $Y _ { L }$ , and $X$ . Skip-gram based approaches, such as DeepWalk, ignores the node features $X$ and only use the labels $Y _ { L }$ and the graph $G$ .
|
| 145 |
+
|
| 146 |
+
Table 2: Classification accuracy with a fixed split of data from (Yang et al., 2016).
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Input</td><td>Method</td><td>CiteSeer</td><td>Cora</td><td>PubMed</td></tr><tr><td rowspan="2">YL,XL</td><td>Singlelayer Perceptron</td><td>57.2</td><td>57.4</td><td>69.8</td></tr><tr><td>Multilayer Perceptron</td><td>64.0</td><td>57.5</td><td>71.4</td></tr><tr><td>YL,X</td><td>T-SVM (Joachims, 1999)</td><td>64.0</td><td>57.5</td><td>62.2</td></tr><tr><td>YL,G</td><td>DeepWalk (Perozzi et al., 2014) node2vec (Grover & Leskovec,2016)</td><td>43.2 54.7</td><td>67.2 74.9</td><td>65.3 75.3</td></tr><tr><td rowspan="14">YL,X,G</td><td>LP (Zhu et al., 2003)</td><td>45.3</td><td>68.0</td><td>63.0</td></tr><tr><td>ICA (Lu & Getoor,2003)</td><td>69.1</td><td>75.1</td><td>73.9</td></tr><tr><td>ManiReg (Belkin et al.,2006)</td><td>60.1</td><td>59.5</td><td>70.7</td></tr><tr><td>SemiEmb (Weston et al., 2012)</td><td>59.6</td><td>59.0</td><td>71.1</td></tr><tr><td>DCNN (Atwood & Towsley,2016)</td><td></td><td>76.8</td><td>73.0</td></tr><tr><td>Planetoid (Yang et al., 2016)</td><td>64.7</td><td>75.7</td><td>77.2</td></tr><tr><td>MoNet (Monti et al., 2016)</td><td></td><td>81.7</td><td>78.8</td></tr><tr><td>Graph-CNN (Such et al., 2017)</td><td></td><td>76.3</td><td></td></tr><tr><td>DynamicFilter (Verma et al., 2017)</td><td></td><td>81.6</td><td>79.0</td></tr><tr><td>Bootstrap (Buchnik & Cohen,2017)</td><td>53.6</td><td>78.4</td><td>78.8</td></tr><tr><td>GCN (Kipf & Welling,2016)</td><td>70.3</td><td>81.5</td><td>79.0</td></tr><tr><td>GLN</td><td>70.9±.05</td><td>81.2±.05</td><td>78.9±.05</td></tr><tr><td>AGNN (this paper)</td><td>71.7±.08</td><td>82.6±.09</td><td>79.9±.07</td></tr></table>
|
| 149 |
+
|
| 150 |
+
A breakthrough result of Planetoid by Yang et al. (2016) significantly improved upon the existing skip-gram based method of DeepWalk and node2vec and the Laplacian regularized methods of ManiReg and SemiEmb. Kipf & Welling (2016) was the first to apply a graph neural network to citation datasets, and achieved the state-of-the-art performance with GCN. Other variations of graph neural networks immediately followed, achieving comparable performance with MoNet, GraphCNN, and DynamicFilter. Bootstrap uses a Laplacian regularized approach of (Zhou et al., 2004a) as a sub-routine with bootstrapping to feed high-margin predictions as seeds.
|
| 151 |
+
|
| 152 |
+
Random splits. Next, following the setting of Buchnik & Cohen (2017), we run experiments keeping the same size in labeled, validation, and test sets as in Table 2, but now selecting those nodes uniformly at random. This, along with the fact that different topics have different number of nodes in it, means that the labels might not be spread evenly across the topics. For 20 such randomly drawn dataset splits, average accuracy is shown in Table 3 with the standard error. As we do not force equal number of labeled data for each class, we observe that the performance degrades for all methods compared to Table 2, except for DeepWalk. AGNN achieves the best performance consistently. Here, we note that Kipf & Welling (2016) does a similar but different experiment using GCN, where random labeled nodes are evenly spread across topics so that each topic has exactly 20 labeled examples. As this difference in sampling might affect the accuracy, we do not report those results in this table.
|
| 153 |
+
|
| 154 |
+
Table 3: Classification accuracy with random splits of the data.
|
| 155 |
+
|
| 156 |
+
<table><tr><td>Method</td><td>CiteSeer</td><td>Cora</td><td>PubMed</td></tr><tr><td>DeepWalk (Perozzi et al., 2014)</td><td>47.2</td><td>70.2</td><td>72.0</td></tr><tr><td>node2vec (Grover&Leskovec,2016)</td><td>47.3</td><td>72.9</td><td>72.4</td></tr><tr><td>Bootstrap (Buchnik & Cohen,2017)</td><td>50.3</td><td>78.2</td><td>75.6</td></tr><tr><td>GLN</td><td>68.4±0.45</td><td>80.0±0.43</td><td>77.7±0.63</td></tr><tr><td>AGNN (this paper)</td><td>69.8±0.35</td><td>81.0±0.34</td><td>78.0±0.46</td></tr></table>
|
| 157 |
+
|
| 158 |
+
Larger training set. Following the setting of Such et al. (2017), we run experiments with larger number of labeled data on Cora dataset. We perform $k$ -fold cross validation experiments for $k =$ 3 and 10, by uniformly and randomly dividing the nodes into $k$ equal sized partitions and then performing $k$ runs of training by masking the labels of each of the $k$ partitions followed by validation on the masked nodes. Finally the average validation accuracy across $k$ runs is reported. We run 10 trials of this experiment and reports the mean and standard error of the average $k$ -fold validation accuracy. Compared to Table 2, the performance increases with the size of the training set, and AGNN consistently outperforms the current state-of-the-art architecture for this experiment.
|
| 159 |
+
|
| 160 |
+
Table 4: Classification accuracy with larger sets of labelled nodes.
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Method</td><td>3-fold Split</td><td>10-fold split</td></tr><tr><td>Graph-CNN (Such et al., 2017)</td><td>87.55±1.38</td><td>89.18±1.96</td></tr><tr><td>GLN</td><td>87.98±0.08</td><td>88.24±0.07</td></tr><tr><td>AGNN (this paper)</td><td>89.07±0.08</td><td>89.60±0.09</td></tr></table>
|
| 163 |
+
|
| 164 |
+
# 5.2 QUALITATIVE ANALYSIS
|
| 165 |
+
|
| 166 |
+
One useful aspect of incorporating attention into a model is that it provides some form of interpretation capability (Bahdanau et al., 2014). The learned $P _ { i j } ^ { ( t ) }$ ’s in Eq. (7) represent the attention from node $j$ to node $i$ , and provide insights on how relevant node $j$ is in classifying node $i$ . In Figure 1, we provide statistics of this attention over all adjacent pairs of nodes for Cora and CiteSeer datasets. We refer to Figure 3 for similar statistics on PubMed. In Figure 1, we show average attention from a node in topic $c _ { 2 }$ (column) to a node in topic $c _ { 1 }$ (row), which we call the relevance from $c _ { 2 }$ to $c _ { 1 }$ and is defined as
|
| 167 |
+
|
| 168 |
+
$$
|
| 169 |
+
\mathrm { R e l e v a n c e } ( c _ { 2 } \to c _ { 1 } ) = \frac { 1 } { | S _ { c _ { 1 } , c _ { 2 } } | } \sum _ { ( i , j ) \in S _ { c _ { 1 } , c _ { 2 } } } R ( j \to i ) ,
|
| 170 |
+
$$
|
| 171 |
+
|
| 172 |
+
for edge-wise relevance score defined as
|
| 173 |
+
|
| 174 |
+
$$
|
| 175 |
+
R ( j \to i ) = \left( P _ { i j } ^ { ( t ) } - \frac { 1 } { | N ( i ) | + 1 } \right) \Biggl / \frac { 1 } { | N ( i ) | + 1 } ,
|
| 176 |
+
$$
|
| 177 |
+
|
| 178 |
+
where $| N ( i ) |$ is the degree of node $i$ , and $S _ { c _ { 1 } , c _ { 2 } } = \{ ( i , j ) \in E ^ { s }$ and $Y _ { i } = c _ { 1 } , Y _ { j } = c _ { 2 } \}$ where $E ^ { s } =$ $E \cup \{ ( i , i )$ for $i \in V \}$ is the edge set augmented with self-loops to include all the attentions learned. If we are not using any attention, then the typical propagation will be uniform $P _ { i j } = 1 / ( | N ( i ) | + 1 )$ , in which case the above normalized attention is zero. We are measuring for each edge the variation of attention $P _ { i j }$ from uniform $1 / ( | N ( i ) | + 1 )$ as a multiplicative error, normalized by $1 / ( | N ( i ) | + 1 )$ . We believe this is the right normalization, as attention should be measure in relative strength to others in the same neighborhood, and not in absolute additive differences. We are measuring this multiplicative variation of the attention, averaged over the ordered pairs of classes.
|
| 179 |
+
|
| 180 |
+
Figure 1 shows the relevance score for CiteSeer and Cora datasets. (PubMed is shown in Appendix A.) For both datasets, the diagonal entries are dominant indicating that the attention is learning to put more weight to those in the same class. A higher value of Relevance $' c _ { 2 } c _ { 1 } ,$ ) indicates that, on average, a node in topic $c _ { 1 }$ pays more attention to a neighbor in topic $c _ { 2 }$ than neighbors from other topics. For CiteSeer dataset (Figure 1 left), we are showing the average attention at the first propagation layer, $P ^ { ( t = 1 ) }$ , for illustration. In the off-diagonals, the most influential relations are $\mathrm { H C I } { } .$ Agents, Agents ${ \bf \Gamma } \to { \bf M L }$ , Agents $\mathrm { \Gamma \to H C I }$ , and ML Agents, and the least influential relations are $\mathrm { A I } { } \mathrm { I R }$ and DB $\bf \Pi _ { \Pi } { } \bf M \cal L$ . Note that these are papers in computer science from late 90s to early 2000s. For Cora dataset (Figure 1 right), we are showing the relevance score of the second propagation layer, $P ^ { ( t = 2 ) }$ , for illustration. In the off-diagonals, the most influential relations are $\mathrm { C B } { } \mathrm { P M }$ , $\mathrm { P M } \to \mathrm { C B }$ , Rule $\mathrm { \Gamma } \to \mathrm { P M }$ , and $\mathrm { P M } \to$ Rule, and the least influential relations are $\mathbf { G A } { } \mathbf { P M }$ and $\mathrm { P M } \to \mathrm { R L }$ . This dataset has papers in computer science from the 90s. We note that these relations are estimated solely based on the available datasets for that period of time and might not accurately reflect the relations for the entire academic fields. We also consider these relations as a static property in this analysis. If we have a larger corpus over longer period of time, it is possible to learn the influence conditioned on the period and visualize how these relations change.
|
| 181 |
+
|
| 182 |
+
Next, we analyze the edges with high and low relevance scores. We remove the self-loops and then sort the edges according to the relevance score defined in Eq. (9). We take the top 100 and bottom 100 edges and with respect to their relevance scores, and report the fraction of the edges which are connecting nodes from the same class. Table 5 shows the result on the benchmark datasets for the relevance scores calculated using the last propagation layer. This suggests that our architecture learns to put higher attention between nodes of the same class.
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 1: Relevance score in Eq. (8) from a neighbor node with column-class to a center node in row-class. For example the average normalized attention to Agents from HCI is $= - 0 . 1 4 1$ , largest off-diagonal entry in CiteSeer. The average attention to Probabilistic Methods (PM) from Case Based (CB) is 0.017, largest off-diagonal entry in Cora.
|
| 186 |
+
|
| 187 |
+
<table><tr><td></td><td>CiteSeer</td><td>Cora</td><td>PubMed</td></tr><tr><td>Top 100</td><td>0.69</td><td>0.64</td><td>0.69</td></tr><tr><td>Bottom 100</td><td>0.34</td><td>0.09</td><td>0.13</td></tr></table>
|
| 188 |
+
|
| 189 |
+
Table 5: Fraction of edges from top 100 most relevant edges and bottom 100 least relevant edges which are connecting two distinct nodes from the same class.
|
| 190 |
+
|
| 191 |
+
Finally, we analyze those nodes in the test sets that were mistaken by GCN but correctly classified by AGNN, and show how our attention mechanism weighted the contribution of its local neighborhood, and show three illustrative examples in Figure 2. More examples of this local attention network (including the legends for the color coding of the topics) are provided in Appendix A. We show a entire 2-hop neighborhood of a target node (marked by a thick outline) from the test set of the fixed data splits of Citeseer, Cora, or Pubmed. The colors denote the true classes of the nodes (including the target) in the target’s neighborhood, some of which are unknown to the models at the training time. The radius of a node $j$ is proportional to the attention to the target node $i$ aggregated over all the layers, i.e. $( P ^ { ( t = 4 ) } P ^ { ( t = 3 ) } P ^ { ( t = 2 ) } P ^ { ( t = 1 ) } ) _ { i j }$ for CiteSeer. The size of the target node reflects its self-attention defined in a similar way. The first example on the left is node 8434 from PubMed. AGNN correctly classifies the target node as light blue, whereas GCN mistakes it for yellow, possibly because it is connected to more yellow nodes. Not only has the attention mechanism learned to put more weight to its light blue 1-hop neighbor, but put equally heavy weights to a path of light blue neighbors some of which are not immediately connected to the target node. The second example in the middle is node 1580 from PubMed. AGNN correctly classifies it as yellow, whereas GCN mistakes it for a red, possibly because it only has two neighbors. Not only has the attention mechanism learned to put more weight to the yellow neighbor, but it has weighted the yellow neighbor (who is connected to many yellow nodes and perhaps has more reliable hidden states representing the true yellow class) even more than itself.
|
| 192 |
+
|
| 193 |
+
The last example on the right is node 1512 from CiteSeer. AGNN correctly classifies it as light blue, whereas GCN mistakes it for a white. This is a special example as those two nodes are completely isolated. Due to the static and non-adaptive propagation of GCN, it ends up giving the same prediction for such isolated pairs. If the pair has two different true classes, then it always fails on at least on one of them (in this case the light blue node). However, AGNN is more flexible in adapting to such graph topology and puts more weight to the target node itself, correctly classifying both.
|
| 194 |
+
|
| 195 |
+
# 6 CONCLUSIONS
|
| 196 |
+
|
| 197 |
+
In this paper, we present an attention-based graph neural network model for semi-supervised classification on a graph. We demonstrate that our method consistently outperforms competing methods on the standard benchmark citation network datasets. We also show that the learned attention also provides interesting insights on how neighbors influence each other. In training, we have tried more complex attention models. However, due to the increased model complexity the training was not stable and does not give higher accuracy. We believe that for semi-supervised setting with such a limited number of labeled examples, reducing model complexity is important. Note that we are able to train deeper (4-layers) models compared to a shallower (2-layers) model of GCN, in part due to the fact that we remove the non-linear layers and reduce the model complexity significantly. In comparison, deeper GCN models are known to be unstable and do not give the performance of shallower GCNs (Kipf & Welling, 2016).
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 2: We show three selected target nodes in the test set that are mistaken by GCN but correctly classified by AGNN. We denote this target node by the node with a thick outline (node 8434 from PubMed on the left, node 1580 from PubMed in the middle, and node 1512 from CiteSeer on the right). We show the strength of attention from a node in the 2-hop neighborhood to the target node by the size of the corresponding node. Colors represent the hidden true classes (nodes with the same color belong to the same topic). None of the nodes in the figure was in the training set, hence none of the colors were revealed. Still, we observe that AGNN has managed to put more attention to those nodes in the same (hidden) classes, allowing the trained model to find the correct labels.
|
| 201 |
+
|
| 202 |
+
# REFERENCES
|
| 203 |
+
|
| 204 |
+
S. Gunnemann A. Bojchevski. Deep gaussian embedding of attributed graphs: Unsupervised inductive learning via ranking. arXiv preprint arXiv:1707.03815, 2017.
|
| 205 |
+
Martin Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016.
|
| 206 |
+
J. Atwood and D. Towsley. Diffusion-convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 1993–2001, 2016.
|
| 207 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 208 |
+
Mikhail Belkin, Partha Niyogi, and Vikas Sindhwani. Manifold regularization: A geometric framework for learning from labeled and unlabeled examples. Journal of machine learning research, 7 (Nov):2399–2434, 2006.
|
| 209 |
+
R. van den Berg, T. N. Kipf, and M. Welling. Graph convolutional matrix completion. arXiv preprint arXiv:1706.02263, 2017.
|
| 210 |
+
Avrim Blum and Shuchi Chawla. Learning from labeled and unlabeled data using graph mincuts. In ICML ’01 Proceedings of the Eighteenth International Conference on Machine Learning, 2001.
|
| 211 |
+
Michael M Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst. Geometric deep learning: going beyond euclidean data. arXiv preprint arXiv:1611.08097, 2016.
|
| 212 |
+
J. Bruna and X. Li. Community detection with graph neural networks. arXiv preprint arXiv:1705.08415, 2017.
|
| 213 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013.
|
| 214 |
+
|
| 215 |
+
Eliav Buchnik and Edith Cohen. Bootstrapped graph diffusions: Exposing the power of nonlinearity. arXiv preprint arXiv:1703.02618, 2017.
|
| 216 |
+
|
| 217 |
+
Olivier Chapelle, Bernhard Scholkopf, and Alexander Zien. Semi-supervised learning (chapelle, o. et al., eds.; 2006)[book reviews]. IEEE Transactions on Neural Networks, 20(3):542–542, 2009.
|
| 218 |
+
|
| 219 |
+
H. Dai, B. Dai, and L. Song. Discriminative embeddings of latent variable models for structured data. In International Conference on Machine Learning, pp. 2702–2711, 2016.
|
| 220 |
+
|
| 221 |
+
Hanjun Dai, Elias B Khalil, Yuyu Zhang, Bistra Dilkina, and Le Song. Learning combinatorial optimization algorithms over graphs. arXiv preprint arXiv:1704.01665, 2017.
|
| 222 |
+
|
| 223 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks ¨ on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, pp. 3837–3845, 2016.
|
| 224 |
+
|
| 225 |
+
Yan Duan, Marcin Andrychowicz, Bradly Stadie, Jonathan Ho, Jonas Schneider, Ilya Sutskever, Pieter Abbeel, and Wojciech Zaremba. One-shot imitation learning. arXiv preprint arXiv:1703.07326, 2017.
|
| 226 |
+
|
| 227 |
+
David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alan´ Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In Advances in neural information processing systems, pp. 2224–2232, 2015.
|
| 228 |
+
|
| 229 |
+
Evgeniy Faerman, Felix Borutta, Kimon Fountoulakis, and Michael W Mahoney. Lasagne: Locality and structure aware graph node embedding. arXiv preprint arXiv:1710.06520, 2017.
|
| 230 |
+
|
| 231 |
+
Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. arXiv preprint arXiv:1704.01212, 2017.
|
| 232 |
+
|
| 233 |
+
Marco Gori, Gabriele Monfardini, and Franco Scarselli. A new model for learning in graph domains. In Neural Networks, 2005. IJCNN’05. Proceedings. 2005 IEEE International Joint Conference on, volume 2, pp. 729–734. IEEE, 2005.
|
| 234 |
+
|
| 235 |
+
Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014.
|
| 236 |
+
|
| 237 |
+
A. Grover and J. Leskovec. node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 855–864. ACM, 2016.
|
| 238 |
+
|
| 239 |
+
W. L. Hamilton, R. Ying, and J. Leskovec. Inductive representation learning on large graphs. arXiv preprint arXiv:1706.02216, 2017.
|
| 240 |
+
|
| 241 |
+
Mikael Henaff, Joan Bruna, and Yann LeCun. Deep convolutional networks on graph-structured data. arXiv preprint arXiv:1506.05163, 2015.
|
| 242 |
+
|
| 243 |
+
Yedid Hoshen. Vain: Attentional multi-agent predictive modeling. In Advances in Neural Information Processing Systems, pp. 2698–2708, 2017.
|
| 244 |
+
|
| 245 |
+
Thorsten Joachims. Transductive inference for text classification using support vector machines. In ICML, volume 99, pp. 200–209, 1999.
|
| 246 |
+
|
| 247 |
+
T. N. Kipf and M. Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
|
| 248 |
+
|
| 249 |
+
Q. Le and T. Mikolov. Distributed representations of sentences and documents. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), pp. 1188–1196, 2014.
|
| 250 |
+
|
| 251 |
+
Y. Li, D. Tarlow, M. Brockschmidt, and R. Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015.
|
| 252 |
+
|
| 253 |
+
Qing Lu and Lise Getoor. Link-based classification. In Proceedings of the 20th International Conference on Machine Learning (ICML-03), pp. 496–503, 2003.
|
| 254 |
+
|
| 255 |
+
Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodola, Jan Svoboda, and Michael M\` Bronstein. Geometric deep learning on graphs and manifolds using mixture model cnns. arXiv preprint arXiv:1611.08402, 2016.
|
| 256 |
+
|
| 257 |
+
M. Niepert, M. Ahmed, and K. Kutzkov. Learning convolutional neural networks for graphs. In Proceedings of the 33rd annual international conference on machine learning. ACM, 2016.
|
| 258 |
+
|
| 259 |
+
Kamal Nigam, Andrew McCallum, and Tom Mitchell. Semi-supervised text classification using em. Semi-Supervised Learning, pp. 33–56, 2006.
|
| 260 |
+
|
| 261 |
+
A. Nowak, S. Villar, A. S. Bandeira, and J. Bruna. A note on learning algorithms for quadratic assignment with graph neural networks. arXiv preprint arXiv:1706.07450, 2017.
|
| 262 |
+
|
| 263 |
+
B. Perozzi, R. Al-Rfou, and S. Skiena. Deepwalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 701–710. ACM, 2014.
|
| 264 |
+
|
| 265 |
+
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, 2009.
|
| 266 |
+
|
| 267 |
+
M. Schlichtkrull, T. N. Kipf, P. Bloem, R. van den Berg, I. Titov, and M. Welling. Modeling relational data with graph convolutional networks. arXiv preprint arXiv:1703.06103, 2017.
|
| 268 |
+
|
| 269 |
+
Felipe Petroski Such, Shagan Sah, Miguel Dominguez, Suhas Pillai, Chao Zhang, Andrew Michael, Nathan Cahill, and Raymond Ptucha. Robust spatial filtering with graph convolutional neural networks. arXiv preprint arXiv:1703.00792, 2017.
|
| 270 |
+
|
| 271 |
+
Sainbayar Sukhbaatar, arthur szlam, and Rob Fergus. Learning multiagent communication with backpropagation. In Advances in Neural Information Processing Systems 29, pp. 2244–2252. 2016.
|
| 272 |
+
|
| 273 |
+
Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, and Qiaozhu Mei. Line: Large-scale information network embedding. In Proceedings of the 24th International Conference on World Wide Web, pp. 1067–1077. ACM, 2015.
|
| 274 |
+
|
| 275 |
+
Nitika Verma, Edmond Boyer, and Jakob Verbeek. Dynamic filters in graph convolutional networks. arXiv preprint arXiv:1706.05206, 2017.
|
| 276 |
+
|
| 277 |
+
Jason Weston, Fred´ eric Ratle, Hossein Mobahi, and Ronan Collobert. Deep learning via semi- ´ supervised embedding. In Neural Networks: Tricks of the Trade, pp. 639–655. Springer, 2012.
|
| 278 |
+
|
| 279 |
+
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhudinov, Rich Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In International Conference on Machine Learning, pp. 2048–2057, 2015.
|
| 280 |
+
|
| 281 |
+
Xiaojun Xu, Chang Liu, Qian Feng, Heng Yin, Le Song, and Dawn Song. Neural networkbased graph embedding for cross-platform binary code similarity detection. arXiv preprint arXiv:1708.06525, 2017.
|
| 282 |
+
|
| 283 |
+
Cheng Yang, Maosong Sun, Zhiyuan Liu, and Cunchao Tu. Fast network embedding enhancement via high order proximity approximation. In Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, IJCAI, pp. 19–25, 2017.
|
| 284 |
+
|
| 285 |
+
Z. Yang, W. W. Cohen, and R. Salakhutdinov. Revisiting semi-supervised learning with graph embeddings. arXiv preprint arXiv:1603.08861, 2016.
|
| 286 |
+
|
| 287 |
+
Denny Zhou, Olivier Bousquet, Thomas N Lal, Jason Weston, and Bernhard Scholkopf. Learning ¨ with local and global consistency. In Advances in neural information processing systems, pp. 321–328, 2004a.
|
| 288 |
+
|
| 289 |
+
Denny Zhou, Olivier Bousquet, Thomas N Lal, Jason Weston, and Bernhard Scholkopf. Learning ¨ with local and global consistency. In Advances in neural information processing systems, pp. 321–328, 2004b.
|
| 290 |
+
|
| 291 |
+
Xiaojin Zhu and Zoubin Ghahramani. Learning from labeled and unlabeled data with label propagation. 2002.
|
| 292 |
+
|
| 293 |
+
Xiaojin Zhu, Zoubin Ghahramani, and John D Lafferty. Semi-supervised learning using gaussian fields and harmonic functions. In Proceedings of the 20th International conference on Machine learning (ICML-03), pp. 912–919, 2003.
|
| 294 |
+
|
| 295 |
+
# APPENDIX
|
| 296 |
+
|
| 297 |
+
# A ADDITIONAL EXPERIMENTS ON INTERPRETABILITY OF ATTENTION
|
| 298 |
+
|
| 299 |
+
PubMed dataset has only 3 classes, and the relevance score is shown in the figure below.
|
| 300 |
+
|
| 301 |
+

|
| 302 |
+
Figure 3: Average attention in Eq. (8) from a column class to a row class
|
| 303 |
+
|
| 304 |
+
We show examples of 2-hop local neighborhood of nodes that are mistaken by GCN but correctly classified by AGNN.
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 4: Examples from CiteSeer dataset of attention strength in the local neighborhood of a target node (in thick outline) from the test set that is mistaken by GCN but correctly classified by AGNN. Colors are true classes and node sizes are proportional to the attention strength from a neighbor to the target node. Labeled nodes from training set are marked with ‘\*’.
|
| 308 |
+
|
| 309 |
+
# B EXPERIMENT AND ARCHITECT DETAILS
|
| 310 |
+
|
| 311 |
+
In this section we will list all the choices made in training and tuning of hyper-parameters. The parameters are chosen as to maximize the validation. All the models use Adam optimization algorithm with full-batchs, as standard in other works on GNNs (Kipf & Welling, 2016; Such et al., 2017). We also a weight decay term to the objective function for all the learnable weights. We add dropout to the first and last layers of all models.
|
| 312 |
+
|
| 313 |
+
In Table 6. we show the hyper-parameters used in training the AGNN models for various settings and datasets. For Cora dataset the architecture consist of $\ell = 3$ propagation layers, but the first propagation layer $P ^ { ( t = 1 ) }$ is non-trainable and the variable $\beta ^ { ( t = 1 ) }$ value is fixed at zero. While training these AGNN models we maintain the validation accuracy for each iteration and finally choose the trained model parameters from the iteration where average validation accuracy of previous 4 epochs is maximized. For the $k$ -fold cross validation setting we take the epoch with maximum validation accuracy.
|
| 314 |
+
|
| 315 |
+

|
| 316 |
+
Figure 5: Examples from Cora dataset of attention strength in the local neighborhood of a target node (in thick outline) from the test set that is mistaken by GCN but correctly classified by AGNN. Colors are true classes and node sizes are proportional to the attention strength from a neighbor to the target node. Labeled nodes from training set are marked with ‘\*’.
|
| 317 |
+
|
| 318 |
+

|
| 319 |
+
Figure 6: Examples from Pubmed dataset of attention strength in the local neighborhood of a target node (in thick outline) from the test set that is mistaken by GCN but correctly classified by AGNN. Colors are true classes and node sizes are proportional to the attention strength from a neighbor to the target node. Labeled nodes from training set are marked with ‘\*’.
|
| 320 |
+
|
| 321 |
+
Table 6: Hyper-parameters for AGNN model
|
| 322 |
+
|
| 323 |
+
<table><tr><td rowspan="2"> Setting</td><td rowspan="2">Dataset</td><td rowspan="2">Propagation layers (l)</td><td rowspan="2">Hidden state dimension (dh)</td><td rowspan="2">Learning Rate</td><td rowspan="2">Weight Decay</td><td rowspan="2">Dropout</td><td rowspan="2">Epochs</td></tr><tr><td></td></tr><tr><td>Fixed Split</td><td>CiteSeer</td><td>4</td><td>16</td><td>0.005</td><td>0.0005</td><td>0.5</td><td>1000</td></tr><tr><td>Fixed Split</td><td>Cora</td><td>3</td><td>16</td><td>0.01</td><td>0.0005</td><td>0.5</td><td>1000</td></tr><tr><td>Fixed Split</td><td>PubMed</td><td>4</td><td>16</td><td>0.008</td><td>0.001</td><td>0.5</td><td>400</td></tr><tr><td>Rand. Split</td><td>CiteSeer</td><td>4</td><td>16</td><td>0.01</td><td>0.0005</td><td>0.5</td><td>1000</td></tr><tr><td>Rand. Split</td><td>Cora</td><td>3</td><td>16</td><td>0.01</td><td>0.0005</td><td>0.5</td><td>1000</td></tr><tr><td>Rand. Split</td><td>PubMed</td><td>4</td><td>16</td><td>0.008</td><td>0.001</td><td>0.5</td><td>1000</td></tr><tr><td>Cross Val.</td><td>Cora</td><td>3</td><td>16</td><td>0.04</td><td>0.0005</td><td>0.25</td><td>500</td></tr></table>
|
| 324 |
+
|
| 325 |
+
For the Graph Linear Network (GLN) as define in (3), we use the same hyper-parameters as GCN (Kipf & Welling, 2016) for all the experimental settings: hidden dimension of 16, learning rate of 0.01, weight decay of $5 \times 1 0 ^ { - 4 }$ , dropout of 0.5, 200 epochs and early stopping criteria with a window size of 10.
|
| 326 |
+
|
| 327 |
+
# C PERFORMANCE VERSUS NUMBER OF PROPAGATION LAYERS
|
| 328 |
+
|
| 329 |
+
In this section we provide experimental results justifying the choice of number of propagation layers for each dataset. We use the same data split and hyper-parameters (except number of propagation layer) as in the fixed data splits setting in Section 5.1. Similar to other settings the first propagation layer for Cora dataset is non-trainable with $\beta ^ { ( t = 1 ) } = 0$ . Tables 7 gives the average (over 10 trials) testing accuracy respectively for various choices of number of propagation layers. We note that different datasets require different number of propagation layers for best performance.
|
| 330 |
+
|
| 331 |
+
Table 7: Average testing error of AGNN for different number of Propagation Layers.
|
| 332 |
+
|
| 333 |
+
<table><tr><td>Propagation Layers ()</td><td>CiteSeer</td><td>Cora</td><td>PubMed</td></tr><tr><td>1</td><td>69.08</td><td>80.52</td><td>78.31</td></tr><tr><td>2</td><td>70.83</td><td>83.07</td><td>79.66</td></tr><tr><td>3</td><td>71.06</td><td>82.62</td><td>79.56</td></tr><tr><td>4</td><td>71.70</td><td>82.24</td><td>80.10</td></tr><tr><td>5</td><td>71.37</td><td>82.07</td><td>80.13</td></tr></table>
|
| 334 |
+
|
| 335 |
+
D PERFORMANCE OF GCN ON OTHER DATASET SPLITS.
|
| 336 |
+
Table 8: Classification accuracy with random splits of the data.
|
| 337 |
+
|
| 338 |
+
<table><tr><td>Method</td><td>CiteSeer</td><td>Cora</td><td>PubMed</td></tr><tr><td>DeepWalk (Perozzi et al., 2014)</td><td>47.2</td><td>70.2</td><td>72.0</td></tr><tr><td>node2vec (Grover & Leskovec,2016)</td><td>47.3</td><td>72.9</td><td>72.4</td></tr><tr><td>Bootstrap (Buchnik & Cohen,2017)</td><td>50.3</td><td>78.2</td><td>75.6</td></tr><tr><td>GCN</td><td>66.9±0.50</td><td>79.2±0.46</td><td>77.5±0.61</td></tr><tr><td>GLN</td><td>68.4±0.45</td><td>80.0±0.43</td><td>77.7±0.63</td></tr><tr><td>AGNN (this paper)</td><td>69.8±0.35</td><td>81.0±0.34</td><td>78.0±0.46</td></tr></table>
|
| 339 |
+
|
| 340 |
+
Here we provide the performance of GCN on random splits and larger training set dataset splits from Section 5.1. We relegate these tables to the appendix since they were not present in Kipf & Welling (2016). We conducted the experiments with the same hyper-parameters as chosen by Kipf & Welling (2016) for the fixed split. In Tables 8 and 9 we provide average testing accuracy and standard error over 20 and 10 runs on random splits and larger training set respectively.
|
| 341 |
+
|
| 342 |
+
Table 9: Classification accuracy with larger sets of labelled nodes.
|
| 343 |
+
|
| 344 |
+
<table><tr><td>Method</td><td>3-fold Split</td><td>10-fold split</td></tr><tr><td>Graph-CNN (Such et al., 2017)</td><td>87.55±1.38</td><td>89.18±1.96</td></tr><tr><td>GCN</td><td>87.23±0.21</td><td>87.78±0.04</td></tr><tr><td>GLN</td><td>87.98±0.08</td><td>88.24±0.07</td></tr><tr><td>AGNN (this paper)</td><td>89.07±0.08</td><td>89.60±0.09</td></tr></table>
|
md/train/rJg76kStwH/rJg76kStwH.md
ADDED
|
@@ -0,0 +1,484 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EFFICIENT PROBABILISTIC LOGIC REASONING WITH GRAPH NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Yuyu Zhang1, Xinshi Chen1, Yuan Yang1, Arun Ramamurthy2, Bo $\mathbf { L i ^ { 3 } }$ , Yuan $\mathbf { Q } \mathbf { i } ^ { 4 }$ & Le Song1,4 1Georgia Institute of Technology 2Siemens Corporate Technology 3University of Illinois at Urbana Champaign 4Ant Financial {yuyu,xinshi.chen,yyang754}@gatech.edu arun.ramamurthy@siemens.com,lbo@illinois.edu yuan.qi@antfin.com,lsong@cc.gatech.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Markov Logic Networks (MLNs), which elegantly combine logic rules and probabilistic graphical models, can be used to address many knowledge graph problems. However, inference in MLN is computationally intensive, making the industrialscale application of MLN very difficult. In recent years, graph neural networks (GNNs) have emerged as efficient and effective tools for large-scale graph problems. Nevertheless, GNNs do not explicitly incorporate prior logic rules into the models, and may require many labeled examples for a target task. In this paper, we explore the combination of MLNs and GNNs, and use graph neural networks for variational inference in MLN. We propose a GNN variant, named ExpressGNN, which strikes a nice balance between the representation power and the simplicity of the model. Our extensive experiments on several benchmark datasets demonstrate that ExpressGNN leads to effective and efficient probabilistic logic reasoning.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Knowledge graphs collect and organize relations and attributes about entities, which are playing an increasingly important role in many applications, including question answering and information retrieval. Since knowledge graphs may contain incorrect, incomplete or duplicated records, additional processing such as link prediction, attribute classification, and record de-duplication is typically needed to improve the quality of knowledge graphs and derive new facts.
|
| 12 |
+
|
| 13 |
+
Markov Logic Networks (MLNs) were proposed to combine hard logic rules and probabilistic graphical models, which can be applied to various tasks on knowledge graphs (Richardson & Domingos, 2006). The logic rules incorporate prior knowledge and allow MLNs to generalize in tasks with small amount of labeled data, while the graphical model formalism provides a principled framework for dealing with uncertainty in data. However, inference in MLN is computationally intensive, typically exponential in the number of entities, limiting the real-world application of MLN. Also, logic rules can only cover a small part of the possible combinations of knowledge graph relations, hence limiting the application of models that are purely based on logic rules.
|
| 14 |
+
|
| 15 |
+
Graph neural networks (GNNs) have recently gained increasing popularity for addressing many graph related problems effectively (Dai et al., 2016; Li et al., 2016; Kipf & Welling, 2017; Schlichtkrull et al., 2018). GNN-based methods typically require sufficient labeled instances on specific end tasks to achieve good performance, however, knowledge graphs have the long-tail nature (Xiong et al., 2018), i.e., a large portion the relations in only are a few triples. Such data scarcity problem among long-tail relations poses tough challenge for purely data-driven methods.
|
| 16 |
+
|
| 17 |
+
In this paper, we explore the combination of the best of both worlds, aiming for a method which is data-driven yet can still exploit the prior knowledge encoded in logic rules. To this end, we design a simple variant of graph neural networks, named ExpressGNN, which can be efficiently trained in the variational EM framework for MLN. An overview of our method is illustrated in Fig. 1. ExpressGNN and the corresponding reasoning framework lead to the following desiderata:
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Overview of our method for combining MLN and GNN using the variational EM framework.
|
| 21 |
+
|
| 22 |
+
• Efficient inference and learning: ExpressGNN can be viewed as the inference network for MLN, which scales up MLN inference to much larger knowledge graph problems.
|
| 23 |
+
• Combining logic rules and data supervision: ExpressGNN can leverage the prior knowledge encoded in logic rules, as well as the supervision from graph structured data.
|
| 24 |
+
Compact and expressive model: ExpressGNN may have small number of parameters, yet it is sufficient to represent mean-field distributions in MLN.
|
| 25 |
+
• Capability of zero-shot learning: ExpressGNN can deal with the zero-shot learning problem where the target predicate has few or zero labeled instances.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
Statistical relational learning. There is an extensive literature relating the topic of logic reasoning. Here we only focus on the approaches that are most relevant to statistical relational learning on knowledge graphs. Logic rules can compactly encode the domain knowledge and complex dependencies. Thus, hard logic rules are widely used for reasoning in earlier attempts, such as expert systems (Ignizio, 1991) and inductive logic programming (Muggleton & De Raedt, 1994). However, hard logic is very brittle and has difficulty in coping with uncertainty in both the logic rules and the facts in knowledge graphs. Later studies have explored to introduce probabilistic graphical model in logic reasoning, seeking to combine the advantages of relational and probabilistic approaches. Representative works including Relational Markov Networks (RMNs; Taskar et al. (2007)) and Markov Logic Networks (MLNs; Richardson & Domingos (2006)) were proposed in this background.
|
| 30 |
+
|
| 31 |
+
Markov Logic Networks. MLNs have been widely studied due to the principled probabilistic model and effectiveness in a variety of reasoning tasks, including entity resolution (Singla & Domingos, 2006a), social networks (Zhang et al., 2014), information extraction (Poon & Domingos, 2007), etc. MLNs elegantly handle the noise in both logic rules and knowledge graphs. However, the inference and learning in MLNs is computationally expensive due to the exponential cost of constructing the ground Markov network and the NP-complete optimization problem. This hinders MLNs to be applied to industry-scale applications. Many works appear in the literature to improve the original MLNs in both accuracy (Singla & Domingos, 2005; Mihalkova & Mooney, 2007) and efficiency (Singla & Domingos, 2006b; 2008; Poon & Domingos, 2006; Khot et al., 2011; Bach et al., 2015). Nevertheless, to date, MLNs still struggle to handle large-scale knowledge bases in practice. Our framework ExpressGNN overcomes the scalability challenge of MLNs by efficient stochastic training algorithm and compact posterior parameterization with graph neural networks.
|
| 32 |
+
|
| 33 |
+
Graph neural networks. Graph neural networks (GNNs; Dai et al. (2016); Kipf & Welling (2017)) can learn effective representations of nodes by encoding local graph structures and node attributes. Due to the compactness of model and the capability of inductive learning, GNNs are widely used in modeling relational data (Schlichtkrull et al., 2018; Battaglia et al., 2018). Recently, Qu et al. (2019) proposed Graph Markov Neural Networks (GMNNs), which employs GNNs together with conditional random fields to learn object representations. These existing works are simply data-driven, and not able to leverage the domain knowledge or human prior encoded in logic rules. To the best of our knowledge, ExpressGNN is the first work that connects GNNs with first-order logic rules to combine the advantages of both worlds.
|
| 34 |
+
|
| 35 |
+
Knowledge graph embedding. Another line of research for knowledge graph reasoning is in the family of knowledge graph embedding methods, such as TransE (Bordes et al., 2013), NTN (Socher et al., 2013), DistMult (Kadlec et al., 2017), ComplEx (Trouillon et al., 2016), and RotatE (Sun et al., 2019). These methods design various scoring functions to model relational patterns for knowledge graph reasoning, which are very effective in learning the transductive embeddings of both entities and relations. However, these methods are not able to leverage logic rules, which can be crucial in some relational learning tasks, and have no consistent probabilistic model. Compared to these methods, ExpressGNN has consistent probabilistic model built in the framework, and can incorporate knowledge from logic rules. A recent concurrent work Qu & Tang (2019) has proposed probabilistic Logic Neural Network (pLogicNet), which integrates knowledge graph embedding methods with MLNs with EM framework. Compared to pLogicNet which uses a flattened embedding table as the entity representation, our work explicitly captures the structure knowledge encoded in the knowledge graph with GNNs and supplement the knowledge from logic formulae for the prediction task.
|
| 36 |
+
|
| 37 |
+
# 3 PRELIMINARY
|
| 38 |
+
|
| 39 |
+
Knowledge Graph. A knowledge graph is a tuple $\boldsymbol { \mathcal { K } } = ( \mathcal { C } , \mathcal { R } , \mathcal { O } )$ consisting of a set $\mathcal { C } = \{ c _ { 1 } , \ldots , c _ { M } \}$ of $M$ entities, a set $\mathcal { R } =$ $\{ r _ { 1 } , \hdots , r _ { N } \}$ of $N$ relations, and a collection $\mathcal { O } = \{ o _ { 1 } , \ldots , o _ { L } \}$ of $L$ observed facts. In the language of first-order logic, entities are also called constants. For instance, a constant can be a person or an object. Relations are also called predicates. Each predicate is a logic function defined over $\mathcal { C }$ , i.e., $r ( \cdot ) : \mathcal { C } \times \ldots \times \mathcal { C } \mapsto \{ 0 , 1 \}$ . In general, the arguments of predicates are asymmetric. For instance, for the predicate $r ( c , c ^ { \prime } ) : = \mathtt { L } ( c , c ^ { \prime } )$ (L for Like) which checks whether $c$ likes $c ^ { \prime }$ , the arguments $c$ and $c ^ { \prime }$ are not exchangeable.
|
| 40 |
+
|
| 41 |
+
With a particular set of entities assigned to the arguments, the predicate is called a ground predicate, and each ground predicate $\mathbf { \equiv } \mathbf { a }$ binary random variable, which will be used to define MLN. For a $d$ -ary predicate, there are $M ^ { d }$ ways to ground it. We denote an assignment as $a _ { r }$ . For instance, with $\boldsymbol { a } _ { r } = ( \boldsymbol { c } , \boldsymbol { c } ^ { \prime } )$ , we can simply write a ground predicate $r ( c , c ^ { \prime } )$ as $r ( a _ { r } )$ . Each observed fact in knowledge bases is a truth value $\{ 0 , 1 \}$ assigned to a ground predicate. For instance, a fact $o$ can be $[ \mathrm { L } ( c , c ^ { \prime } ) = 1 ]$ . The number of observed facts is typically much smaller than that of unobserved facts. We adopt the open-world paradigm and treat these unobserved facts $\equiv$ latent variables.
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 2: Bottom: A knowledge base as a factor graph. $\{ A , C , D \}$ are entities, and F (Friend) and S (Smoke) are predicates. Top: Markov Logic Network (MLN) with formula $f ( c , c ^ { \prime } ) : = \lnot \mathrm { s } ( c ) \lor$ $\neg \mathrm { { E } } ( c , c ^ { \prime } )$ ∨ $\mathrm { \Sigma } \mathrm { S } ( c ^ { \prime } )$ . Shaded circles correspond to latent variables.
|
| 45 |
+
|
| 46 |
+
As a clearer representation, we express a knowledge base $\kappa$ by a bipartite graph $\mathcal { G } _ { K } = ( \mathcal { C } , \mathcal { O } , \mathcal { E } )$ , where nodes on one side of the graph correspond to constants $\mathcal { C }$ and nodes on the other side correspond to observed facts $\mathcal { O }$ , which is called factor in this case. The set of $T$ edges, $\mathcal { E } = \{ e _ { 1 } , \ldots , e _ { T } \}$ , connect constants and the observed facts. More specifically, an edge $e = ( c , o , i )$ between node $c$ and $o$ exists, if the ground predicate associated with $o$ uses $c$ as an argument in its $i$ -th argument position (Fig. 2).
|
| 47 |
+
|
| 48 |
+
Markov Logic Networks. MLNs use logic formulae to define potential functions in undirected graphical models. A logic formula $f ( \cdot ) : \mathcal { C } \times \ldots \times \mathcal { C } \mapsto \{ 0 , 1 \}$ is a binary function defined via the composition of a few predicates. For instance, a logic formula $\bar { \boldsymbol { f } } ( \boldsymbol { c } , \boldsymbol { c } ^ { \prime } )$ can be
|
| 49 |
+
|
| 50 |
+
$\mathtt { S m o k e } ( c ) \wedge \mathtt { F r i d e n d } ( c , c ^ { \prime } ) \Rightarrow \mathtt { S m o k e } ( c ^ { \prime } ) \iff \neg \mathtt { S m o k e } ( c ) \vee \neg \mathtt { F r i d e n d } ( c , c ^ { \prime } ) \vee \mathtt { S m o k e } ( c ^ { \prime } ) ,$ where $\neg$ is negation and the equivalence is established by De Morgan’s law. Similar to predicates, we denote an assignment of constants to the arguments of a formula $f$ as $a _ { f }$ , and the entire collection of consistent assignments of constants as $\mathcal { A } _ { f } = \{ a _ { f } ^ { 1 } , a _ { f } ^ { 2 } , . . . \}$ . A formula with constants assigned to all of its arguments is called a ground formula. Given these logic representations, MLN can be defined as a joint distribution over all observed facts $\mathcal { O }$ and unobserved facts $\mathcal { H }$ as
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\begin{array} { r } { P _ { w } \left( \boldsymbol { \mathcal { O } } , \mathcal { H } \right) : = \frac { 1 } { Z ( w ) } \exp \bigg ( \sum _ { f \in \mathcal { F } } w _ { f } \sum _ { a _ { f } \in \mathcal { A } _ { f } } \phi _ { f } \big ( a _ { f } \big ) \bigg ) , } \end{array}
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $Z ( w )$ is the partition function summing over all ground predicates and $\phi _ { f } ( \cdot )$ is the potential function defined by a formula $f$ as illustrated in Fig. 2. One form of $\phi _ { f } ( \cdot )$ can simply be the truth value of the logic formula $f$ . For instance, if the formula is $f ( c , c ^ { \prime } ) : = \neg { \mathrm { S } } ( c ) \lor \neg \mathrm { F } ( c , c ^ { \prime } ) \lor \mathrm { S } ( c ^ { \prime } )$ , then $\phi _ { f } ( c , c ^ { \prime } )$ can simply take value 1 when $f ( c , c ^ { \prime } )$ is true and 0 otherwise. Other more sophisticated $\phi _ { f }$ can also be designed, which have the potential to take into account complex entities, such as images or texts, but will not be the focus of this paper. The weight $w _ { f }$ can be viewed as the confidence score of the formula $f$ : the higher the weight, the more accurate the formula is.
|
| 57 |
+
|
| 58 |
+
Difference between KG and MLN. We note that the graph topology of knowledge graphs and MLN can are very different, although MLN is defined on top of knowledge graphs. Knowledge graphs are typically very sparse, where the number of edges (observed relations) is typically linear in the number of entities. However, the graphs associated with MLN are much denser, where the number of nodes can be quadratic or more in the number of entities, and the number of edges (dependency between variables) is also high-order polynomials in the number of entities.
|
| 59 |
+
|
| 60 |
+
# 4 VARIATIONAL EM FOR MARKOV LOGIC NETWORKS
|
| 61 |
+
|
| 62 |
+
In this section, we introduce the variational EM framework for MLN inference and learning, where we will use ExpressGNN as a key component (detailed in Sec. 5). Markov Logic Networks model the joint probabilistic distribution of all observed and latent variables, as defined in Eq. 1. This model can be trained by maximizing the log-likelihood of all the observed facts $\log { P _ { w } ( \mathcal { O } ) }$ . However, it is intractable to directly maximize the objective, since it requires to compute the partition function $Z ( w )$ and integrate over all variables $\mathcal { O }$ and $\mathcal { H }$ . We instead optimize the variational evidence lower bound (ELBO) of the data log-likelihood, as follows
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { r } { \log P _ { w } \left( \mathcal { O } \right) \geqslant \mathcal { L } _ { \mathtt { E L B O } } \big ( Q _ { \theta } , P _ { w } \big ) : = \mathbb { E } _ { Q _ { \theta } ( \mathcal { H } | \mathcal { O } ) } \Big [ \log P _ { w } \left( \mathcal { O } , \mathcal { H } \right) \Big ] - \mathbb { E } _ { Q _ { \theta } ( \mathcal { H } | \mathcal { O } ) } \Big [ \log Q _ { \theta } \left( \mathcal { H } | \mathcal { O } \right) \Big ] , } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $Q _ { \theta } \left( \mathcal { H } \mid \mathcal { O } \right)$ is a variational posterior distribution of the latent variables given the observed ones. The equality in Eq. 2 holds if the variational posterior $Q _ { \boldsymbol { \theta } } \left( \mathcal { H } | \mathcal { O } \right)$ equals to the true posterior $P _ { w } \left( \mathcal { H } | \mathcal { O } \right)$ . We then use the variational EM algorithm (Ghahramani et al., 2000) to effectively optimize the ELBO. The variational EM algorithm consists of an expectation step (E-step) and a maximization step (M-step), which will be called in an alternating fashion to train the model: 1) In the E-step (Sec. 4.1), we infer the posterior distribution of the latent variables, where $P _ { w }$ is fixed and $Q _ { \theta }$ is optimized to minimize the KL divergence between $Q _ { \boldsymbol { \theta } } \left( \mathcal { H } | \mathcal { O } \right)$ and $P _ { w } \left( \mathcal { H } | \mathcal { O } \right)$ ; 2) In the M-step (Sec. 4.2), we learn the weights of the logic formulae in MLN, where $Q _ { \theta }$ is fixed and $P _ { w }$ is optimized to maximize the data log-likelihood.
|
| 69 |
+
|
| 70 |
+
# 4.1 E-STEP: INFERENCE
|
| 71 |
+
|
| 72 |
+
In the E-step, which is also known as the inference step, we are minimizing the KL divergence between the variational posterior distribution $Q _ { \boldsymbol { \theta } } \left( \mathcal { H } | \mathcal { O } \right)$ and the true posterior distribution $P _ { w } \left( \mathcal { H } | \mathcal { O } \right)$ . The exact inference of MLN is computationally intractable and proven to be NP-complete (Richardson & Domingos, 2006). Therefore, we choose to approximate the true posterior with a mean-field distribution, since the mean-field approximation has been demonstrated to scale up large graphical models, such as latent Dirichlet allocation for modeling topics from large text corpus (Hoffman et al., 2013). In the mean-field variational distribution, each unobserved ground predicate $r ( a _ { r } ) \in \mathcal { H }$ is independently inferred as follows:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\begin{array} { r } { Q _ { \theta } ( \mathcal { H } | \mathcal { O } ) : = \prod _ { r ( a _ { r } ) \in \mathcal { H } } Q _ { \theta } ( r ( a _ { r } ) ) , } \end{array}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where each factorized distribution $Q _ { \theta } ( r ( a _ { r } ) )$ follows the Bernoulli distribution. We parameterize the variational posterior $Q _ { \theta }$ with deep learning models as our neural inference network. The design of the inference network is very important and has a lot of considerations, since we need a compact yet expressive model to accurately approximate the true posterior distribution. We employ graph neural networks with tunable embeddings as our inference network (detailed in Sec. 5), which can trade-off between the model compactness and expressiveness.
|
| 79 |
+
|
| 80 |
+
With the mean-field approximation, $\mathcal { L } _ { \mathrm { E L B O } } ( Q _ { \theta } , P _ { w } )$ defined in Eq. 2 can be reorganized as below:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\Big ( \sum _ { f \in \mathcal { F } } w _ { f } \sum _ { a _ { f } \in A _ { f } } \mathbb { E } _ { Q _ { \theta } ( \# | \mathcal { O } ) } \Big [ \phi _ { f } ( a _ { f } ) \Big ] - \log Z ( w ) \Big ) - \Big ( \sum _ { r ( a _ { r } ) \in \mathcal { H } } \mathbb { E } _ { Q _ { \theta } ( r ( a _ { r } ) ) } \Big [ \log Q _ { \theta } ( r ( a _ { r } ) ) \Big ] \Big ] \Big ) ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $w _ { f }$ is fixed in the $\mathrm { E }$ -step and thus the partition function $Z ( w )$ can be treated as a constant. We notice that the first term $\mathbb { E } _ { Q _ { \theta } ( \mathcal { H } | \mathcal { O } ) } [ \log P _ { w } \left( \mathcal { O } , \mathcal { H } \right) ]$ has the summation over all formulae and all possible assignments to each formula. Thus this double summation may involve a large number of terms. The second term $\mathbb { E } _ { Q _ { \theta } ( \mathcal { H } | \mathcal { O } ) } [ \log Q _ { \theta } \left( \mathcal { H } | \mathcal { O } \right) ]$ is the sum of entropy of the variational posterior distributions $Q _ { \theta } ( r ( a _ { r } ) )$ , which also involves a large number of terms since the summation ranges over all possible latent variables. Typically, the number of latent facts in database is much larger than the number of observed facts. Thus, both terms in the objective function pose the challenge of intractable computational cost.
|
| 87 |
+
|
| 88 |
+
To address this challenge, we sample mini-batches of ground formulae to break down the exponential summations by approximating it with a sequence of summations with a controllable number of terms. More specifically, in each optimization iteration, we first sample a batch of ground formulae. For each ground formula in the sampled batch, we compute the first term in Eq. 4 by taking the expectation of the corresponding potential function with respect to the posterior of the involved latent variables. The mean-field approximation enables us to decompose the global expectation over the entire MLN into local expectations over ground formulae. Similarly, for the second term in Eq. 4, we use the posterior of the latent variables in the sampled batch to compute a local sum of entropy.
|
| 89 |
+
|
| 90 |
+
For tasks that have sufficient labeled data as supervision, we can add a supervised learning objective to enhance the inference network, as follows:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\begin{array} { r } { { \mathcal { L } } _ { \mathrm { l a b e l } } ( Q _ { \theta } ) = \sum _ { r ( a _ { r } ) \in { \mathcal { O } } } \log Q _ { \theta } ( r ( a _ { r } ) ) . } \end{array}
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
This objective is complementary to the ELBO on predicates that are not well covered by logic rules but have sufficient observed facts. Therefore, the overall E-step objective function becomes:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\begin{array} { r } { \mathcal { L } _ { \theta } = \mathcal { L } _ { \mathrm { E L B O } } ( Q _ { \theta } , P _ { w } ) + \lambda \mathcal { L } _ { \mathrm { l a b e l } } ( Q _ { \theta } ) , } \end{array}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where $\lambda$ is a hyperparameter to control the weight. This overall objective essentially combines the knowledge in logic rules and the supervision from labeled data.
|
| 103 |
+
|
| 104 |
+
# 4.2 M-STEP: LEARNING
|
| 105 |
+
|
| 106 |
+
In the M-step, which is also known as the learning step, we are learning the weights of logic formulae in Markov Logic Networks with the variational posterior $Q _ { \boldsymbol { \theta } } \left( \mathcal { H } | \mathcal { O } \right)$ fixed. The partition function $Z ( w )$ in Eq. 4 is not a constant anymore, since we need to optimize those weights in the M-step. There are exponential number of terms in the partition function $Z ( w )$ , which makes it intractable to directly optimize the ELBO. To tackle this problem, we adopt the widely used pseudo-log-likelihood (Richardson & Domingos, 2006) as an alternative objective for optimization, which is defined as:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\begin{array} { r } { P _ { w } ^ { * } ( \mathcal { O } , \mathcal { H } ) : = \mathbb { E } _ { Q _ { \theta } ( \mathcal { H } | \mathcal { O } ) } \left[ \sum _ { r ( a _ { r } ) \in \mathcal { H } } \log P _ { w } ( r ( a _ { r } ) \mid \mathbf { M } \mathbf { B } _ { r ( a _ { r } ) } ) \right] , } \end{array}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where $\mathrm { M B } _ { r ( a _ { r } ) }$ is the Markov blanket of the ground predicate $r ( a _ { r } )$ , i.e., the set of ground predicates that appear in some grounding of a formula with $r ( a _ { r } )$ . For each formula $i$ that connects $r ( a _ { r } )$ to its Markov blanket, we optimize the formula weight $w _ { i }$ by gradient descent, with the derivative:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\nabla _ { w _ { i } } \mathbb { E } _ { Q _ { \theta } } [ \log P _ { w } ( r ( a _ { r } ) \mid \mathbf { M B } _ { r ( a _ { r } ) } ) ] \simeq y _ { r ( a _ { r } ) } - P _ { w } ( r ( a _ { r } ) \mid \mathbf { M B } _ { r ( a _ { r } ) } ) ,
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $y _ { r ( a _ { r } ) } = 0$ or 1 if $r ( a _ { r } )$ is an observed fact, and $y _ { r ( a _ { r } ) } = Q _ { \theta } ( r ( a _ { r } ) )$ otherwise. With the independence property of Markov Logic Networks, the gradients of the logic formulae weights can be efficiently computed on the Markov blanket of each variable.
|
| 119 |
+
|
| 120 |
+
For the M-step, we design a different sampling scheme to make it computationally efficient. For each variable in the Markov blanket, we take the truth value if it’s observed and draw a sample from the variational posterior $Q _ { \theta }$ if it’s latent. In the M-step, the ELBO of a fully observed ground formula depends on the formula weight, thus we need to consider all the fully observed ground formulae. It is computationally intractable to use all possible ground predicates to compute the gradients in Eq. 8. To tackle this challenge, we simply consider all the ground formulae with at most one latent predicate, and pick up the ground predicate if its truth value determines the formula’s truth value. Therefore, we keep a small subset of ground predicates, each of which can directly determine the truth value of a ground formula. Intuitively, this small subset contains all representative ground predicates, and makes good estimation of the gradients with much cheaper computational cost.
|
| 121 |
+
|
| 122 |
+
# 5 INFERENCE NETWORK DESIGN: EXPRESSGNN
|
| 123 |
+
|
| 124 |
+
In the neural variational EM framework, the key component is the posterior model, or the inference network. We need to design the inference network that is both expressive and efficient to approximate the true posterior distribution. A recent concurrent work Qu & Tang (2019) uses a flattened embedding table as the entity representation to model the posterior. However, such simple posterior model is not able to capture the structure knowledge encoded in the knowledge graph. We employ graph neural networks with tunable embeddings to design our inference network. We also investigate the expressive power of GNN from theoretical perspective, which justifies our design.
|
| 125 |
+
|
| 126 |
+
Our inference network, named ExpressGNN, consists of three parts: the first part is a vanilla graph neural network (GNN), the second part uses tunable embeddings, and the third part uses the embeddings to define the variational posterior. For simplicity, we assume that each predicate has two arguments (i.e., consider only $r ( c , c ^ { \prime } ) _ { , } ^ { , }$ ). We design each part as follows:
|
| 127 |
+
|
| 128 |
+
• We build a GNN on the knowledge graph $\mathcal { G } _ { K }$ , which is much smaller than the ground graph of MLN (see comparison in Fig. 2). The computational graph of the GNN is given in Algorithm 1. The GNN parameters $\pmb { \theta } _ { 1 }$ and $\pmb { \theta } _ { 2 }$ are shared across the entire graph and independent of the number of entities. Therefore, the GNN is a compact model with $O ( d ^ { 2 } )$ parameters given $d$ dimensional embeddings, $\mu _ { c } \in \mathbb { R } ^ { d }$ .
|
| 129 |
+
• For each entity in the knowledge graph, we augment its GNN embedding with a tunable embedding $\boldsymbol { \omega } _ { c } \in \mathbb { R } ^ { k }$ as $\hat { \mu } _ { c } = [ \mu _ { c } , \omega _ { c } ]$ . The tunable embeddings increase the expressiveness of the model. As there are $M$ entities, the number of parameters in tunable embeddings is $O ( k M )$ .
|
| 130 |
+
• We use the augmented embeddings of $c _ { 1 }$ and $c _ { 2 }$ to define the variational posterior. Specifically, $Q _ { \theta } ( r ( c _ { 1 } , c _ { 2 } ) ) \stackrel { - } { = } \sigma ( \mathtt { M L P } _ { 3 } ( \hat { \mu } _ { c _ { 1 } } , \hat { \mu } _ { c _ { 2 } } , r ; \pmb { \theta } _ { 3 } ) )$ , where $\begin{array} { r } { \sigma ( \cdot ) = \frac { 1 } { 1 + \exp ( - \cdot ) } } \end{array}$ . The number of parameters in $\pmb { \theta } _ { 3 }$ is $O ( d + k )$ .
|
| 131 |
+
|
| 132 |
+
In summary, ExpressGNN can be viewed as a two-level encoding of the entities: the compact GNN assigns similar embeddings to similar entities in the knowledge graph, while the expressive tunable embeddings provide additional model capacity to encode entityspecific information beyond graph structures. The overall number of trainable parameters in ExpressGNN is $O ( d ^ { 2 } + k M )$ . By tuning the embedding size $d$ and $k$ , ExpressGNN can trade-off between the model compactness and expressiveness. For large-scale problems with a large number of entities ( $M$ is large), ExpressGNN can save a lot of parameters by reducing $k$ .
|
| 133 |
+
|
| 134 |
+
# Algorithm 1: GNN()
|
| 135 |
+
|
| 136 |
+
Initialize entity node: $\mu _ { c } ^ { ( 0 ) } = \mu _ { 0 }$ , $\forall c \in { \mathcal { C } }$ for $t = 0$ to $T - 1$ do . Compute message $\forall r ( c , c ^ { \prime } ) \in \mathcal { O }$ $m _ { c ^ { \prime } \to c } ^ { ( t ) } = \mathtt { M L P } _ { 1 } ( \mu _ { c ^ { \prime } } ^ { ( t ) } , r ; \pmb { \theta } _ { 1 } )$ $\forall c \in { \mathcal { C } }$ $m _ { c } ^ { ( t + 1 ) } = \mathtt { A G G } ( \{ m _ { c ^ { \prime } c } ^ { ( t ) } \} _ { c ^ { \prime } : r ( c , c ^ { \prime } ) \in \mathcal { O } } )$ . Update embedding ∀c ∈ C $\boldsymbol { \mu } _ { c } ^ { ( t + 1 ) } = \mathtt { M L P } _ { 2 } ( \boldsymbol { \mu } _ { c } ^ { ( t ) } , m _ { c } ^ { ( t + 1 ) } ; \boldsymbol { \theta } _ { 2 } )$
|
| 137 |
+
|
| 138 |
+
return embeddings $\{ \mu _ { c } ^ { ( T ) } \}$
|
| 139 |
+
|
| 140 |
+
# 5.1 EXPRESSIVE POWER OF GNN AS INFERENCE NETWORK
|
| 141 |
+
|
| 142 |
+
The combination of GNN and tunable embeddings makes the model sufficiently expressive to approximate the true posterior distributions. Here we provide theoretical analysis on the expressive power of GNN in the mean-field inference problem, and discuss the benefit of combining GNN and tunable embeddings in ExpressGNN.
|
| 143 |
+
|
| 144 |
+
Recent studies (Shervashidze et al., 2011; Xu et al., 2018) show that the vanilla GNN embeddings can represent the results of graph coloring, but fail to represent the results of the more strict graph isomorphism check, i.e., GNN produces the same embedding for some nodes that should be distinguished.
|
| 145 |
+
|
| 146 |
+
We first demonstrate this problem by a simple example:
|
| 147 |
+
|
| 148 |
+
Example. Fig. 3 involves four entities (A, B, E, F), two predicates (Friend: $\operatorname { F } ( \cdot , \cdot )$ , Like: $\mathbb { L } ( \cdot , \cdot ) ,$ ), and one formula $( \operatorname { F } ( c , c ^ { \prime } ) \Rightarrow$ $\mathbb { L } ( c , c ^ { \prime } ) )$ . In this example, MLN variables have different posteriors, but GNN embeddings result in the same posterior representation. More specifically,
|
| 149 |
+
|
| 150 |
+
• Entity $A$ and $B$ have opposite relations with $E$ , i.e., $\operatorname { F } ( A , E ) =$ 1 versus $\mathtt { F } ( B , E ) = 0$ in the knowledge graph, but running GNN on the knowledge graph will always produce the same embeddings for $A$ and $B$ , i.e., $\mu _ { A } = \mu _ { B }$ .
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 3: Bottom: A knowledge base with 0-1-0-1 loop. Top: MLN.
|
| 154 |
+
|
| 155 |
+
• $\mathbb { L } ( A , E )$ and $\mathbb { L } ( B , E )$ apparently have different posteriors. However, using GNN embeddings, $Q _ { \theta } ( \mathtt { L } ( A , E ) ) \ : = \ : \sigma \left( \mathtt { M L P } _ { 3 } ( \mu _ { A } , \mu _ { E } , \mathtt { L } ) \right)$ is always identical to $Q _ { \theta } ( \mathtt { L } ( B , E ) ) = \sigma \left( \mathtt { M L P } _ { 3 } ( \mu _ { B } , \mu _ { E } , \mathtt { L } ) \right)$ .
|
| 156 |
+
|
| 157 |
+
We can formally prove that solving the problem in the above example requires the graph embeddings to distinguish any non-isomorphic nodes in the knowledge graph. A formal statement is provided below (see Appendix E for the proof).
|
| 158 |
+
|
| 159 |
+
Definition 5.1. Two ordered sequences of nodes $\left( c _ { 1 } , \ldots , c _ { n } \right)$ and $( c _ { 1 } ^ { \prime } , \ldots , c _ { n } ^ { \prime } )$ are isomorphic in a graph $\mathcal { G } _ { K }$ if there exists an isomorphism $\pi : \mathcal G _ { K } \mathcal G _ { K }$ such that $\pi ( c _ { 1 } ) = c _ { 1 } ^ { \prime } , \ldots , \pi ( c _ { n } ) = c _ { n } ^ { \prime }$ .
|
| 160 |
+
|
| 161 |
+
Theorem 5.1. Two latent variables $r ( c _ { 1 } , \ldots , c _ { n } )$ and $r ( c _ { 1 } ^ { \prime } , \ldots , c _ { n } ^ { \prime } )$ have the same posterior distribution in any MLN if and only if the nodes $\left( c _ { 1 } , \cdots , c _ { n } \right)$ and $( c _ { 1 } ^ { \prime } , \cdots , c _ { n } ^ { \prime } )$ are isomorphic in the knowledge graph $\mathcal { G } _ { K }$ .
|
| 162 |
+
|
| 163 |
+
Implied by the theorem, to obtain an expressive enough representation for the posterior, we need a more powerful GNN variant. A recent work has proposed a powerful GNN variant (Maron et al., 2019), which can handle small graphs such as chemical compounds and protein structures, but it is computationally expensive due to the usage of high-dimensional tensors. As a simple yet effective solution, ExpressGNN augments the vanilla GNN with additional tunable embeddings, which is a trade-off between the compactness and expressiveness of the model.
|
| 164 |
+
|
| 165 |
+
In summary, ExpressGNN has the following nice properties:
|
| 166 |
+
|
| 167 |
+
• Efficiency: ExpressGNN directly works on the knowledge graph, instead of the huge MLN grounding graph, making it much more efficient than the existing MLN inference methods.
|
| 168 |
+
• Compactness: The compact GNN model with shared parameters can be very memory efficient, making ExpressGNN possible to handle industry-scale problems.
|
| 169 |
+
• Expressiveness: The GNN model can capture structure knowledge encoded in the knowledge graph. Meanwhile, the tunable embeddings can encode entity-specific information, which compensates for GNN’s deficiency in distinguishing non-isomorphic nodes.
|
| 170 |
+
Generalizability: With the GNN embeddings, ExpressGNN may generalize to new entities or even different but related knowledge graphs unseen during training time without the need for retraining.
|
| 171 |
+
|
| 172 |
+
# 6 EXPERIMENTS
|
| 173 |
+
|
| 174 |
+
Benchmark datasets. We evaluate ExpressGNN and other baseline methods on four benchmark datasets: UW-CSE (Richardson & Domingos, 2006), Cora (Singla & Domingos, 2005), synthetic Kinship datasets, and FB15K-237 (Toutanova & Chen, 2015) constructed from Freebase (Bollacker et al., 2008). Details and full statistics of the benchmark datasets are provided in Appendix B.
|
| 175 |
+
|
| 176 |
+
General settings. We conduct all the experiments on a GPU-enabled (Nvidia RTX 2080 Ti) Linux machine powered by Intel Xeon Silver 4116 processors at 2.10GHz with 256GB RAM. We implement ExpressGNN using PyTorch and train it with Adam optimizer (Kingma & Ba, 2014). To ensure a fair comparison, we allocate the same computational resources (CPU, GPU and memory) for all the experiments. We use the default tuned hyperparameters for competitor methods, which can reproduce the experimental results reported in their original works.
|
| 177 |
+
|
| 178 |
+
Model hyperparameters. For ExpressGNN, we use 0.0005 as the initial learning rate, and decay it by half for every 10 epochs without improvement of validation loss. For Kinship, UW-CSE and Cora, we run ExpressGNN with a fixed number of iterations, and use the smallest subset from the original split for hyperparameter tuning. For FB15K-237, we use the original validation set to tune the hyperparameters. We use a two-layer MLP with ReLU activation function as the nonlinear transformation for each embedding update step in the GNN model. We learn different MLP parameters for different steps. To increase the model capacity of ExpressGNN, we also use different MLP parameters for different edge type, and for a different direction of embedding aggregation. For each dataset, we search the configuration of ExpressGNN on either the validation set or the smallest subset. The configuration we search includes the embedding size, the split point of tunable embeddings and GNN embeddings, the number of embedding update steps, and the sampling batch size. For the inference experiments, the weights for all the logic formulae are fixed as 1. For the learning experiments, the weights are initialized as 1. For the choice of $\lambda$ in the combined objective $L _ { \theta }$ in Eq. 6, we set $\lambda = 0$ for the inference experiments, since the query predicates are never seen in the training data and no supervision is available. For the learning experiments, we set $\lambda = 1$ .
|
| 179 |
+
|
| 180 |
+
Table 1: Inference accuracy (AUC-PR) of different methods on three benchmark datasets.
|
| 181 |
+
|
| 182 |
+
<table><tr><td rowspan="2">Method</td><td colspan="5">Kinship</td><td colspan="5">UW-CSE</td><td colspan="2">Cora</td></tr><tr><td>S1</td><td>S2</td><td>S3</td><td>S4</td><td>S5</td><td>AI</td><td>Graphics</td><td></td><td>Language</td><td>Systems</td><td>Theory</td><td>(avg)</td></tr><tr><td>MCMC</td><td>0.53</td><td>1</td><td>-</td><td>-</td><td>=</td><td>1</td><td></td><td></td><td></td><td>-</td><td>-</td><td>-</td></tr><tr><td>BP /Lifted BP</td><td>0.53</td><td>0.58</td><td>0.55</td><td>0.55</td><td>0.56</td><td>0.01</td><td></td><td>0.01</td><td>0.01</td><td>0.01</td><td>0.01</td><td>1</td></tr><tr><td>MC-SAT</td><td>0.54</td><td>0.60</td><td>0.55</td><td>0.55</td><td>-</td><td></td><td>0.03</td><td>0.05</td><td>0.06</td><td>0.02</td><td>0.02</td><td>-</td></tr><tr><td>HL-MRF</td><td>1.00</td><td>1.00</td><td>1.00</td><td>1.00</td><td>-</td><td></td><td>0.06</td><td>0.06</td><td>0.02</td><td>0.04</td><td>0.03</td><td>-</td></tr><tr><td>ExpressGNN-E</td><td>0.97</td><td>0.97</td><td>0.99</td><td>0.99</td><td>0.99</td><td></td><td>0.09</td><td>0.19</td><td>0.14</td><td>0.06</td><td>0.09</td><td>0.64</td></tr></table>
|
| 183 |
+
|
| 184 |
+
# 6.1 COMPARISON TO MLN INFERENCE METHODS AND ABLATION STUDY
|
| 185 |
+
|
| 186 |
+
We first evaluate the inference accuracy and efficiency of ExpressGNN. We compare our method with several strong MLN inference methods on UW-CSE, Cora and Kinship datasets. We also conduct ablation study to explore the trade-off between GNN and tunable embeddings.
|
| 187 |
+
|
| 188 |
+
Experiment settings. For the inference experiments, we fix the weights of all logic rules as 1. A key advantage of MLN is that it can handle open-world setting in a consistent probabilistic framework. Therefore, we adopt open-world setting for all the experiments, as opposed to closed-world setting where unobserved facts (except the query predicates) are assumed to be false. We also report the performance under closed-world setting in Appendix C.
|
| 189 |
+
|
| 190 |
+
Prediction tasks. The deductive logic inference task is to answer queries that typically involve single predicate. For example in UW-CSE, the task is to predict the AdvisedBy $( c , c ^ { \prime } )$ relation for all persons in the set. In Cora, the task is to de-duplicate entities, and one of the query predicates is SameAuthor $( c , c ^ { \prime } )$ . As for Kinship, the task is to predict whether a person is male or female, i.e., Male(c). For each possible substitution of the query predicate with different entities, the model is tasked to predict whether it’s true or not.
|
| 191 |
+
|
| 192 |
+
Evaluation metrics. Following existing studies (Richardson & Domingos, 2006; Singla & Domingos, 2005), we use area under the precision-recall curve (AUC-PR) to evaluate the inference accuracy. To evaluate the inference efficiency, we use wall-clock running time in minutes.
|
| 193 |
+
|
| 194 |
+
Competitor methods. We compare our method with several strong MLN inference algorithms, including MCMC (Gibbs Sampling; Gilks et al. (1995); Richardson & Domingos (2006)), Belief Propagation (BP; Yedidia et al. (2001)), Lifted Belief Propagation (Lifted BP; Singla & Domingos (2008)), MC-SAT (Poon & Domingos, 2006) and Hinge-Loss Markov Random Field (HL-MRF; Bach et al. (2015); Srinivasan et al. (2019)).
|
| 195 |
+
|
| 196 |
+
Inference accuracy. The results of inference accuracy on three benchmark datasets are reported in Table 1. A hyphen in the entry indicates that it is either out of memory or exceeds the time limit (24 hours). We denote our method as ExpressGNN-E since only the E-step is needed for the inference experiments. Note that since the lifted BP is guaranteed to get identical results as BP (Singla & Domingos, 2008), the results of these two methods are merged into one row. For these experiments, ExpressGNN-E uses 64-dim GNN embeddings and 64-dim tunable embeddings. On Cora, all the baseline methods fail to handle the data scale under open-world setting, and ExpressGNN-E achieves good inference accuracy. On UW-CSE, ExpressGNN-E consistently outperforms all baselines. The Kinship dataset is synthesized and noise-free, and the number of entities increases linearly on the five sets S1–S5. HL-MRF achieves perfect accuracy for S1–S4, but is infeasible on the largest set S5. ExpressGNN-E yields similar but not perfect results, which is presumably caused by the stochastic nature of our sampling and optimization procedure.
|
| 197 |
+
|
| 198 |
+
Inference efficiency. The inference time corresponding to the experiments in Table 1 is summarized in Fig. 4. On UW-CSE (left table), ExpressGNN-E uses much shorter time for inference compared to all the baseline methods, and meanwhile ExpressGNN-E achieves the best inference performance. On Kinship (right figure), as the data size grows linearly from S1 to S5, the inference time of most baseline methods grows exponentially, while ExpressGNN-E maintains a nearly constant time cost, demonstrating its nice scalability. Some baseline methods such as MCMC and MC-SAT become infeasible for larger sets. HL-MRF maintains a comparatively short inference time, however, it has a huge increase of memory cost and is not able to handle the largest set S5.
|
| 199 |
+
|
| 200 |
+
Figure 4: Left / Right: Inference time on UW-CSE / Kinship respectively. N/A indicates the method is infeasible.
|
| 201 |
+
|
| 202 |
+
<table><tr><td rowspan="2">Method</td><td colspan="5">Inference Time (minutes)</td></tr><tr><td>AI</td><td>Graphics</td><td>Language</td><td>Systems</td><td>Theory</td></tr><tr><td>MCMC</td><td>>24h</td><td>>24h</td><td>>24h</td><td>>24h</td><td>>24h</td></tr><tr><td>BP</td><td>408</td><td>352</td><td>37</td><td>457</td><td>190</td></tr><tr><td>Lifted BP</td><td>321</td><td>270</td><td>32</td><td>525</td><td>243</td></tr><tr><td>MC-SAT</td><td>172</td><td>147</td><td>14</td><td>196</td><td>86</td></tr><tr><td>HL-MRF</td><td>135</td><td>132</td><td>18</td><td>178</td><td>72</td></tr><tr><td>ExpressGNN-E</td><td>14</td><td>20</td><td>5</td><td>7</td><td>13</td></tr></table>
|
| 203 |
+
|
| 204 |
+

|
| 205 |
+
|
| 206 |
+
Ablation study. ExpressGNN can trade-off the compactness and expressiveness of model by tuning the dimensionality of GNN and tunable embeddings. We perform ablation study on the Cora dataset to investigate how this trade-off affects the inference accuracy. Results of different configurations of ExpressGNN-E are shown in Table 2. It is observed that GNN64+Tune4 has comparable performance with Tune64, but is consistently better than GNN64. Note that the number of parameters in $\mathrm { G N N } 6 4 { + } \mathrm { T u n e } 4$ is $O ( 6 4 ^ { 2 } + 4 | \mathcal { C } | )$ , while that in Tune64 is $O ( 6 4 | \mathcal { C } | )$ . When the number of entities is large, $\mathrm { G N N } 6 4 +$ Tune4 has much less parameters to train. This is consistent with our theoretical analysis result: As a compact model, GNN saves a lot of parameters, but GNN alone is not expressive enough. A similar conclusion is observed for $\mathrm { G N N } 6 4 \mathrm { + T u n e } 6 4$ and Tune128. Therefore, ExpressGNN seeks a combination of two types of embeddings to possess the advantage of both: having a compact model and being expressive. The best configuration of their embedding sizes can be varied on different tasks, and determined by the goal: getting a portable model or better performance.
|
| 207 |
+
|
| 208 |
+
Table 2: AUC-PR for different combinations of GNN and tunable embeddings. Tune $d$ stands for $d$ -dim tunable embeddings and GNN $d$ stands for $d$ -dim GNN embeddings.
|
| 209 |
+
|
| 210 |
+
<table><tr><td rowspan="3">Configuration</td><td colspan="5">Cora</td></tr><tr><td>S1</td><td>S2</td><td>S3</td><td>S4</td><td>S5</td></tr><tr><td>Tune64</td><td>0.57 0.74</td><td>0.34</td><td>0.55 0.54</td><td>0.70 0.53</td></tr><tr><td>GNN64 GNN64+Tune4</td><td>0.57 0.61</td><td>0.58 0.75</td><td>0.38 0.39 0.54</td><td>0.70</td></tr><tr><td>Tune128</td><td>0.62 0.76</td><td>0.42</td><td>0.60</td><td>0.73</td></tr><tr><td>GNN128</td><td>0.60</td><td>0.59</td><td>0.45 0.55</td><td>0.61</td></tr><tr><td>GNN64+Tune64 0.62</td><td></td><td>0.79 0.46</td><td>0.57</td><td>0.75</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 211 |
+
|
| 212 |
+
# .2 COMPARISON TO KNOWLEDGE BASE COMPLETION METHODS
|
| 213 |
+
|
| 214 |
+
We evaluate ExpressGNN in the knowledge base completion task on the FB15K-237 dataset, and compare it with state-of-the-art knowledge base completion methods.
|
| 215 |
+
|
| 216 |
+
Experiment settings. To generate logic rules, we use Neural LP (Yang et al., 2017) on the training set and pick up the candidates with top confidence scores. See Appendix D for examples of selected logic rules. We evaluate both inference-only and inference-and-learning version of ExpressGNN, denoted as ExpressGNN-E and ExpressGNN-EM, respectively.
|
| 217 |
+
|
| 218 |
+
Prediction task. For each test query $\boldsymbol { r } ( \boldsymbol { c } , \boldsymbol { c } ^ { \prime } )$ with respect to relation $r$ , the model is tasked to generate a rank list over all possible instantiations of $r$ and sort them according to the model’s confidence on how likely this instantiation is true.
|
| 219 |
+
|
| 220 |
+
Evaluation metrics. Following existing studies (Bordes et al., 2013; Sun et al., 2019), we use filtered ranking where the test triples are ranked against all the candidate triples not appearing in the dataset. Candidate triples are generated by corrupting the subject or object of a query $\boldsymbol { r } ( \boldsymbol { c } , \boldsymbol { c } ^ { \prime } )$ . For evaluation, we compute the Mean Reciprocal Ranks (MRR), which is the average of the reciprocal rank of all the truth queries, and Hits $@ 1 0$ , which is the percentage of truth queries that are ranked among the top 10.
|
| 221 |
+
|
| 222 |
+
Competitor methods. Since none of the aforementioned MLN inference methods can scale up to this dataset, we compare ExpressGNN with a number of state-of-the-art methods for knowledge base completion, including Neural Tensor Network (NTN; Socher et al. (2013)), Neural LP (Yang et al., 2017), DistMult (Kadlec et al., 2017), ComplEx (Trouillon et al., 2016), TransE (Bordes et al., 2013), RotatE (Sun et al., 2019) and pLogicNet (Qu & Tang, 2019). The results of MLN and pLogicNet are directly taken from the paper Qu & Tang (2019). For all the other baseline methods, we use publicly available code with the provided best hyperparameters to run the experiments.
|
| 223 |
+
|
| 224 |
+
Table 3: Performance on FB15K-237 with varied training set size.
|
| 225 |
+
|
| 226 |
+
<table><tr><td rowspan="2">Model</td><td colspan="6">MRR</td><td colspan="5">Hits @10</td></tr><tr><td>0%</td><td>5%</td><td></td><td>10% 20%</td><td></td><td>100%</td><td>0%</td><td>5%</td><td></td><td>10% 20%</td><td>100%</td></tr><tr><td>MLN</td><td>■</td><td></td><td></td><td></td><td></td><td>0.10</td><td>=</td><td>=</td><td>■</td><td>=</td><td>16.0</td></tr><tr><td>NTN</td><td>0.09</td><td>0.10</td><td>0.10</td><td></td><td>0.11</td><td>0.13</td><td>17.9</td><td>19.3</td><td>19.1</td><td>19.6</td><td>23.9</td></tr><tr><td>Neural LP</td><td>0.01</td><td>0.13</td><td>0.15</td><td></td><td>0.16</td><td>0.24</td><td>1.5</td><td>23.2</td><td>24.7</td><td>26.4</td><td>36.2</td></tr><tr><td>DistMult</td><td>0.23</td><td>0.24</td><td>0.24</td><td></td><td>0.24</td><td>0.31</td><td>40.0</td><td>40.4</td><td>40.7</td><td>41.4</td><td>48.5</td></tr><tr><td>ComplEx</td><td>0.24</td><td>0.24</td><td>0.24</td><td></td><td>0.25</td><td>0.32</td><td>41.1</td><td>41.3</td><td>41.9</td><td>42.5</td><td>51.1</td></tr><tr><td>TransE</td><td>0.24 0.25</td><td></td><td>0.25</td><td></td><td>0.25</td><td>0.33</td><td>42.7</td><td>43.1</td><td>43.4</td><td>43.9</td><td>52.7</td></tr><tr><td>RotatE</td><td>0.25</td><td>0.25</td><td>0.25</td><td></td><td>0.26</td><td>0.34</td><td>42.6 43.0</td><td></td><td>43.5</td><td>44.1</td><td>53.1</td></tr><tr><td>pLogicNet</td><td>=</td><td>=</td><td>=</td><td></td><td></td><td>0.33</td><td>-</td><td></td><td>=</td><td>-</td><td>52.8</td></tr><tr><td>ExpressGNN-E</td><td>0.42 0.42</td><td></td><td>0.42</td><td>20.44</td><td></td><td>0.45</td><td>53.1</td><td>53.1</td><td>53.3</td><td>55.2</td><td>57.3</td></tr><tr><td>ExpressGNN-EM 0.42 0.42</td><td></td><td></td><td></td><td>0.43 0.45</td><td></td><td>0.49</td><td>53.8 54.6 55.3 55.6</td><td></td><td></td><td></td><td>60.8</td></tr></table>
|
| 227 |
+
|
| 228 |
+
Table 4: Zero-shot learning performance on FB15K-237.
|
| 229 |
+
|
| 230 |
+
<table><tr><td>Model</td><td>MRR</td><td>Hits@10</td></tr><tr><td>NTN</td><td>0.001</td><td>0.0</td></tr><tr><td>Neural LP</td><td>0.010</td><td>2.7</td></tr><tr><td>DistMult</td><td>0.004</td><td>0.8</td></tr><tr><td>ComplEx</td><td>0.013</td><td>2.2</td></tr><tr><td>TransE</td><td>0.003</td><td>0.5</td></tr><tr><td>RotatE</td><td>0.006</td><td>1.5</td></tr><tr><td>ExpressGNN-E</td><td>0.181</td><td>29.3</td></tr><tr><td>ExpressGNN-EM</td><td>0.185</td><td>29.6</td></tr></table>
|
| 231 |
+
|
| 232 |
+
Performance analysis. The experimental results on the full training data are reported in Table 3 ( $100 \%$ columns). Both ExpressGNN-E and ExpressGNN-EM significantly outperform all the baseline methods. With learning the weights of logic rules, ExpressGNN-EM achieves the best performance. Compared to MLN, ExpressGNN achieves much better performance since MLN only relies on the logic rules while ExpressGNN can also leverage the labeled data as additional supervision. Compared to knowledge graph embedding methods such as TransE and RotatE, ExpressGNN can leverage the prior knowledge in logic rules and outperform these purely data-driven methods.
|
| 233 |
+
|
| 234 |
+
Data efficiency. We investigate the data efficiency of ExpressGNN and compare it with baseline methods. Following (Yang et al., 2017), we split the knowledge base into facts / training / validation / testing sets, and vary the size of the training set from $0 \%$ to $100 \%$ to feed the model with complete facts set for training. From Table 3, we see that ExpressGNN performs significantly better than the baselines on smaller training data. With more training data as supervision, data-driven baseline methods start to close the gap with ExpressGNN. This clearly shows the benefit of leveraging the knowledge encoded in logic rules when there data is insufficient for supervised learning.
|
| 235 |
+
|
| 236 |
+
Zero-shot relational learning. In practical scenarios, a large portion of the relations in the knowledge base are long-tail, i.e., most relations may have only a few facts (Xiong et al., 2018). Therefore, it is important to investigate the model performance on relations with insufficient training data. We construct a zero-shot learning dataset based on FB15K-237 by forcing the training and testing data to have disjoint sets of relations. Table 4 shows the results. As expected, the performance of all the supervised relational learning methods drop to almost zero. This shows the limitation of such methods when coping with sparse long-tail relations. Neural LP is designed to handle new entities in the test set (Yang et al., 2017), but still struggles to perform well in zero-shot learning. In contrast, ExpressGNN leverages both the prior knowledge in logic rules and the neural relational embeddings for reasoning, which is much less affected by the scarcity of data on long-tail relations. Both variants of our framework (ExpressGNN-E and ExpressGNN-EM) achieve significantly better performance.
|
| 237 |
+
|
| 238 |
+
# 7 CONCLUSION
|
| 239 |
+
|
| 240 |
+
This paper studies the probabilistic logic reasoning problem, and proposes ExpressGNN to combine the advantages of Markov Logic Networks in logic reasoning and graph neural networks in graph representation learning. ExpressGNN addresses the scalability issue of Markov Logic Networks with efficient stochastic training in the variational EM framework. ExpressGNN employs GNNs to capture the structure knowledge that is implicitly encoded in the knowledge graph, which serves as supplement to the knowledge from logic formulae. ExpressGNN is a general framework that can trade-off the model compactness and expressiveness by tuning the dimensionality of the GNN and the embedding part.
|
| 241 |
+
|
| 242 |
+
# ACKNOWLEDGEMENTS
|
| 243 |
+
|
| 244 |
+
We acknowledge grants from NSF IIS-1218749, NIH BIGDATA 1R01GM108341, NSF CAREER IIS-1350983, NSF IIS-1639792 EAGER, NSF IIS-1841351 EA-GER, NSF CNS-1704701, ONR N00014-15-1-2340, Intel ISTC, Nvidia, Google, Amazon AWS and Siemens. We thank Hyunsu Park for his insightful discussions and help on experiments. We thank the anonymous reviewers for their helpful and thoughtful comments. Yuyu Zhang is supported by the Siemens FutureMaker Fellowship.
|
| 245 |
+
|
| 246 |
+
# REFERENCES
|
| 247 |
+
|
| 248 |
+
Stephen H Bach, Matthias Broecheler, Bert Huang, and Lise Getoor. Hinge-loss markov random fields and probabilistic soft logic. arXiv preprint arXiv:1505.04406, 2015.
|
| 249 |
+
|
| 250 |
+
Peter W Battaglia, Jessica B Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, et al. Relational inductive biases, deep learning, and graph networks. arXiv preprint arXiv:1806.01261, 2018.
|
| 251 |
+
|
| 252 |
+
Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. Freebase: a collaboratively created graph database for structuring human knowledge. In Proceedings of the 2008 ACM SIGMOD international conference on Management of data, pp. 1247–1250. AcM, 2008.
|
| 253 |
+
|
| 254 |
+
Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In Advances in neural information processing systems, pp. 2787–2795, 2013.
|
| 255 |
+
|
| 256 |
+
Hanjun Dai, Bo Dai, and Le Song. Discriminative embeddings of latent variable models for structured data. In International conference on machine learning, pp. 2702–2711, 2016.
|
| 257 |
+
|
| 258 |
+
Woodrow W Denham. The detection of patterns in Alyawara nonverbal behavior. PhD thesis, University of Washington, Seattle., 1973.
|
| 259 |
+
|
| 260 |
+
Zoubin Ghahramani, Matthew J Beal, et al. Graphical models and variational methods. Advanced mean field methods-theory and practice. MIT Press, 2000.
|
| 261 |
+
|
| 262 |
+
Walter R Gilks, Sylvia Richardson, and David Spiegelhalter. Markov chain Monte Carlo in practice. Chapman and Hall/CRC, 1995.
|
| 263 |
+
|
| 264 |
+
Matthew D Hoffman, David M Blei, Chong Wang, and John Paisley. Stochastic variational inference. The Journal of Machine Learning Research, 14(1):1303–1347, 2013.
|
| 265 |
+
|
| 266 |
+
James Ignizio. Introduction to expert systems, volume 21. 1991.
|
| 267 |
+
|
| 268 |
+
Rudolf Kadlec, Ondrej Bajgar, and Jan Kleindienst. Knowledge base completion: Baselines strike back. arXiv preprint arXiv:1705.10744, 2017.
|
| 269 |
+
|
| 270 |
+
Tushar Khot, Sriraam Natarajan, Kristian Kersting, and Jude Shavlik. Learning markov logic networks via functional gradient boosting. In 2011 IEEE 11th International Conference on Data Mining, pp. 320–329. IEEE, 2011.
|
| 271 |
+
|
| 272 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 273 |
+
|
| 274 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
|
| 275 |
+
|
| 276 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. In ICLR, 2016.
|
| 277 |
+
|
| 278 |
+
Haggai Maron, Heli Ben-Hamu, Hadar Serviansky, and Yaron Lipman. Provably powerful graph networks. arXiv preprint arXiv:1905.11136, 2019.
|
| 279 |
+
|
| 280 |
+
Lilyana Mihalkova and Raymond J Mooney. Bottom-up learning of markov logic network structure. In Proceedings of the 24th international conference on Machine learning, pp. 625–632. ACM, 2007.
|
| 281 |
+
|
| 282 |
+
Stephen Muggleton and Luc De Raedt. Inductive logic programming: Theory and methods. The Journal of Logic Programming, 19:629–679, 1994.
|
| 283 |
+
|
| 284 |
+
Hoifung Poon and Pedro Domingos. Sound and efficient inference with probabilistic and deterministic dependencies. In AAAI, volume 6, pp. 458–463, 2006.
|
| 285 |
+
|
| 286 |
+
Hoifung Poon and Pedro Domingos. Joint inference in information extraction. In AAAI, volume 7, pp. 913–918, 2007.
|
| 287 |
+
|
| 288 |
+
Meng Qu and Jian Tang. Probabilistic logic neural networks for reasoning. arXiv preprint arXiv:1906.08495, 2019.
|
| 289 |
+
|
| 290 |
+
Meng Qu, Yoshua Bengio, and Jian Tang. GMNN: Graph Markov neural networks. In Proceedings of the 36th International Conference on Machine Learning, pp. 5241–5250, Long Beach, California, USA, 09–15 Jun 2019. PMLR.
|
| 291 |
+
|
| 292 |
+
Matthew Richardson and Pedro Domingos. Markov logic networks. Machine learning, 62(1-2): 107–136, 2006.
|
| 293 |
+
|
| 294 |
+
Michael Schlichtkrull, Thomas N Kipf, Peter Bloem, Rianne Van Den Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional networks. In European Semantic Web Conference, pp. 593–607. Springer, 2018.
|
| 295 |
+
|
| 296 |
+
Nino Shervashidze, Pascal Schweitzer, Erik Jan van Leeuwen, Kurt Mehlhorn, and Karsten M Borgwardt. Weisfeiler-lehman graph kernels. Journal of Machine Learning Research, 12(Sep): 2539–2561, 2011.
|
| 297 |
+
|
| 298 |
+
Parag Singla and Pedro Domingos. Discriminative training of markov logic networks. In AAAI, volume 5, pp. 868–873, 2005.
|
| 299 |
+
|
| 300 |
+
Parag Singla and Pedro Domingos. Entity resolution with markov logic. In Data Mining, 2006. ICDM’06. Sixth International Conference on, pp. 572–582. IEEE, 2006a.
|
| 301 |
+
|
| 302 |
+
Parag Singla and Pedro Domingos. Memory-efficient inference in relational domains. In AAAI, volume 6, pp. 488–493, 2006b.
|
| 303 |
+
|
| 304 |
+
Parag Singla and Pedro M Domingos. Lifted first-order belief propagation. In AAAI, volume 8, pp. 1094–1099, 2008.
|
| 305 |
+
|
| 306 |
+
Richard Socher, Danqi Chen, Christopher D Manning, and Andrew Ng. Reasoning with neural tensor networks for knowledge base completion. In Advances in neural information processing systems, pp. 926–934, 2013.
|
| 307 |
+
|
| 308 |
+
Sriram Srinivasan, Behrouz Babaki, Golnoosh Farnadi, and Lise Getoor. Lifted hinge-loss markov random fields. AAAI, 2019.
|
| 309 |
+
|
| 310 |
+
Zhiqing Sun, Zhi-Hong Deng, Jian-Yun Nie, and Jian Tang. Rotate: Knowledge graph embedding by relational rotation in complex space. arXiv preprint arXiv:1902.10197, 2019.
|
| 311 |
+
|
| 312 |
+
Ben Taskar, Pieter Abbeel, Ming-Fai Wong, and Daphne Koller. Relational markov networks. Introduction to statistical relational learning, pp. 175–200, 2007.
|
| 313 |
+
|
| 314 |
+
Kristina Toutanova and Danqi Chen. Observed versus latent features for knowledge base and text inference. In Proceedings of the 3rd Workshop on Continuous Vector Space Models and their Compositionality, pp. 57–66, 2015.
|
| 315 |
+
|
| 316 |
+
Théo Trouillon, Johannes Welbl, Sebastian Riedel, Éric Gaussier, and Guillaume Bouchard. Complex embeddings for simple link prediction. In International Conference on Machine Learning, pp. 2071–2080, 2016.
|
| 317 |
+
|
| 318 |
+
Wenhan Xiong, Mo Yu, Shiyu Chang, Xiaoxiao Guo, and William Yang Wang. One-shot relational learning for knowledge graphs. arXiv preprint arXiv:1808.09040, 2018.
|
| 319 |
+
|
| 320 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
|
| 321 |
+
|
| 322 |
+
Fan Yang, Zhilin Yang, and William W Cohen. Differentiable learning of logical rules for knowledge base completion. CoRR, abs/1702.08367, 2017.
|
| 323 |
+
|
| 324 |
+
Jonathan S Yedidia, William T Freeman, and Yair Weiss. Generalized belief propagation. In Advances in neural information processing systems, pp. 689–695, 2001.
|
| 325 |
+
|
| 326 |
+
Weizhe Zhang, Xiaoqiang Li, Hui He, and Xing Wang. Identifying network public opinion leaders based on markov logic networks. The scientific world journal, 2014, 2014.
|
| 327 |
+
|
| 328 |
+
# Appendix
|
| 329 |
+
|
| 330 |
+
A COUNTER EXAMPLES
|
| 331 |
+
|
| 332 |
+
We provide more examples in this section to show that it is more than a rare case that GNN embeddings alone are not expressive enough.
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
A.1 EXAMPLE 1
|
| 336 |
+
Figure 5: Example 1. Top: Knowledge base. Bottom: MLN
|
| 337 |
+
|
| 338 |
+
Unlike the example shown in main text, where $\mathtt { A }$ and B have OPPOSITE relation with E, Fig. 5 shows a very simple example where $\mathtt { A }$ and $_ \mathrm { B }$ have exactly the same structure which makes A and B indistinguishable and isomorphic. However, since (A,E) and (B,E) are not isomorphic, it can be easily seen that $\mathbb { L } ( \mathbb { A } , \mathbb { E } )$ has different posterior from $\mathbb { L } ( \mathtt { B } , \mathtt { E } )$ .
|
| 339 |
+
|
| 340 |
+
A.2 EXAMPLE 2
|
| 341 |
+
|
| 342 |
+

|
| 343 |
+
Figure 6: The same example as in Fig. 3. Top: Knowledge base. Bottom: MLN
|
| 344 |
+
|
| 345 |
+
Fig. 6 shows an example which is the same as in Fig. 3. However, in this example, it is already revealed in the knowledge base that $\left( \mathbb { A } , \mathbb { E } \right)$ and $\left( \mathtt { B } , \mathtt { E } \right)$ have different local structures as they are connected by different observations. That is, $\left( \mathbb { A } , \left[ \mathrm { F } \left( \mathbb { A } , \mathbb { E } \right) = 1 \right] , \mathbb { E } \right)$ ) and ( $\mathrm { B } , [ \mathrm { F } ( \mathrm { B } , \mathrm { E } ) = 0 ] , \mathrm { E } )$ can be distinguished by GNN.
|
| 346 |
+
|
| 347 |
+
Now, we use another example in Fig. 7 to show that even when the local structures are the same, the posteriors can still be different, which is caused by the formulae.
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 7: Example 2. Top: Knowledge base. Bottom: MLN
|
| 351 |
+
|
| 352 |
+
In Fig. 7, $\left( \mathbb { A } , \mathbb { E } \right)$ and $( \mathsf C , \mathsf H )$ have the same local structure, so that the tuple $( \mathbb { A } , [ \operatorname { F } ( \mathbb { A } , \operatorname { E } ) = 1 ] , \operatorname { E } )$ ) and (C, $[ \mathrm { F } ( \mathrm { C } , \mathrm { H } ) = 1 ] , \mathrm { H }$ ) can NOT be distingushed by GNN. However, we can make use of subgraph $\left( \mathbb { A } , \mathbb { E } , \mathbb { B } , \mathbb { E } \right)$ to define a formula, and then the resulting MLN gives different posterior to $\mathbb { L } ( \mathbb { A } , \mathbb { E } )$ and $\mathbb { L } ( \mathrm { C } , \mathbb { H } )$ , as can be seen from the figure. Note that this construction of MLN is the same as the construction steps stated in the proof in Sec. E.
|
| 353 |
+
|
| 354 |
+
Table 5: Complete statistics of the benchmark datasets.
|
| 355 |
+
|
| 356 |
+
<table><tr><td>Dataset</td><td>#entity</td><td># relation</td><td># fact # query</td><td></td><td># ground predicate</td><td># ground formula</td></tr><tr><td>FB15K-237</td><td>15K</td><td>237</td><td>272K</td><td>20K</td><td>50M</td><td>679B</td></tr><tr><td>Kinship-S1</td><td>62</td><td>15</td><td>187</td><td>38</td><td>50K</td><td>550K</td></tr><tr><td>Kinship-S2</td><td>110</td><td>15</td><td>307</td><td>62</td><td>158K</td><td>3M</td></tr><tr><td>Kinship-S3</td><td>160</td><td>15</td><td>482</td><td>102</td><td>333K</td><td>9M</td></tr><tr><td>Kinship-S4</td><td>221</td><td>15</td><td>723</td><td>150</td><td>635K</td><td>23M</td></tr><tr><td>Kinship-S5</td><td>266</td><td>15</td><td>885</td><td>183</td><td>920K</td><td>39M</td></tr><tr><td>UW-CSE-AI</td><td>300</td><td>22</td><td>731</td><td>4K</td><td>95K</td><td>73M</td></tr><tr><td>UW-CSE-Graphics</td><td>195</td><td>22</td><td>449</td><td>4K</td><td>70K</td><td>64M</td></tr><tr><td>UW-CSE-Language</td><td>82</td><td>22</td><td>182</td><td>1K</td><td>15K</td><td>9M</td></tr><tr><td>UW-CSE-Systems</td><td>277</td><td>22</td><td>733</td><td>5K</td><td>95K</td><td>121M</td></tr><tr><td>UW-CSE-Theory</td><td>174</td><td>22</td><td>465</td><td>2K</td><td>51K</td><td>54M</td></tr><tr><td>Cora-S1</td><td>670</td><td>10</td><td>11K</td><td>2K</td><td>175K</td><td>621B</td></tr><tr><td>Cora-S2</td><td>602</td><td>10</td><td>9K</td><td>2K</td><td>156K</td><td>431B</td></tr><tr><td>Cora-S3</td><td>607</td><td>10</td><td>18K</td><td>3K</td><td>156K</td><td>438B</td></tr><tr><td>Cora-S4</td><td>600</td><td>10</td><td>12K</td><td>2K</td><td>160K</td><td>435B</td></tr><tr><td>Cora-S5</td><td>600</td><td>10</td><td>11K</td><td>2K</td><td>140K</td><td>339B</td></tr></table>
|
| 357 |
+
|
| 358 |
+
# B DATASET DETAILS
|
| 359 |
+
|
| 360 |
+
For our experiments, we use the following benchmark datasets:
|
| 361 |
+
|
| 362 |
+
• The social network dataset UW-CSE (Richardson & Domingos, 2006) contains publicly available information of students and professors in the CSE department of UW. The dataset is split into five sets according to the home department of the entities.
|
| 363 |
+
• The entity resolution dataset Cora (Singla & Domingos, 2005) consists of a collection of citations to computer science research papers. The dataset is also split into five subsets according to the field of research.
|
| 364 |
+
We introduce a synthetic dataset that resembles the popular Kinship dataset (Denham, 1973). The original dataset contains kinship relationships (e.g., Father, Brother) among family members in the Alyawarra tribe from Central Australia. The synthetic dataset closely resembles the original Kinship dataset but with a controllable number of entities. To generate a dataset with $n$ entities, we randomly split $n$ entities into two groups which represent the first and second generation respectively. Within each group, entities are grouped into a few sub-groups representing the sisterand brother-hood. Finally, entities from different sub-groups in the first generation are randomly coupled and a sub-group in the second generation is assigned to them as their children. To generate the knowledge base, we traverse this family tree, and record all kinship relations for each entity. We generate five kinship datasets (Kinship S1–S5) by linearly increasing the number of entities.
|
| 365 |
+
The knowledge base completion benchmark FB15K-237 (Toutanova & Chen, 2015) is a generic knowledge base constructed from Freebase (Bollacker et al., 2008), which is designed to a more challenging variant of FB15K. More specifically, FB15K-237 is constructed by removing nearduplicate and inverse relations from FB15K. The dataset is split into training / validation / testing and we use the same split of facts from training as in prior work (Yang et al., 2017).
|
| 366 |
+
|
| 367 |
+
The complete statistics of these datasets are shown in Table 5. Examples of logic formulae used in four benchmark datasets are listed in Table 7.
|
| 368 |
+
|
| 369 |
+
# C INFERENCE WITH CLOSED-WORLD SEMANTICS FOR BASELINE METHODS
|
| 370 |
+
|
| 371 |
+
In Sec. 6.1 we compare ExpressGNN with five probabilistic inference methods under open-world semantics. This is different from the original works, where they generally adopt the closed-world setting due to the scalability issues. More specifically, the original works assume that the predicates (except the ones in the query) observed in the knowledge base is closed, meaning for all instantiations of these predicates that do not appear in the knowledge base are considered false. Note that only the query predicates remain open-world in this setting.
|
| 372 |
+
|
| 373 |
+
Table 6: Inference performance of competitors and our method under the closed-world semantics.
|
| 374 |
+
|
| 375 |
+
<table><tr><td rowspan="2">Method</td><td colspan="5">Cora</td><td colspan="5">UW-CSE</td></tr><tr><td>S1</td><td>S2</td><td>S3</td><td>S4</td><td>S5</td><td>AI</td><td>Graphics</td><td>Language</td><td>Systems</td><td>Theory</td></tr><tr><td>MCMC</td><td>0.43</td><td>0.63</td><td>0.24</td><td>0.46</td><td>0.56</td><td>0.19</td><td>0.04</td><td>0.03</td><td>0.15</td><td>0.08</td></tr><tr><td>BP /Lifted BP</td><td>0.44</td><td>0.62</td><td>0.24</td><td>0.45</td><td>0.57</td><td>0.21</td><td>0.04</td><td>0.01</td><td>0.14</td><td>0.05</td></tr><tr><td>MC-SAT</td><td>0.43</td><td>0.63</td><td>0.24</td><td>0.46</td><td>0.57</td><td>0.13</td><td>0.04</td><td>0.03</td><td>0.11</td><td>0.08</td></tr><tr><td>HL-MRF</td><td>0.60</td><td>0.78</td><td>0.52</td><td>0.70</td><td>0.81</td><td>0.26</td><td>0.18</td><td>0.06</td><td>0.27</td><td>0.19</td></tr></table>
|
| 376 |
+
|
| 377 |
+
For sanity checking, we also conduct these experiments with a closed-world setting. We found the results summarized in Table 6 are close to those reported in the original works. This shows that we have a fair setup (including memory size, hyperparameters, etc.) for those competitor methods. Additionally, one can find that the AUC-PR scores compared to those (Table 1) under open-world setting are actually better. This is due to the way the datasets were originally collected and evaluated generally complies with the closed-world assumption. But this is very unlikely to be true for realworld and large-scale knowledge base such as Freebase and WordNet, where many true facts between entities are not observed. Therefore, in general, the open-world setting is much more reasonable, which we follow throughout this paper.
|
| 378 |
+
|
| 379 |
+
# D LOGIC FORMULAE
|
| 380 |
+
|
| 381 |
+
We list some examples of logic formulae used in four benchmark datasets in Table 7. The full list of logic formulae is available in our source code repository. Note that these formulae are not necessarily as clean as being always true, but are typically true.
|
| 382 |
+
|
| 383 |
+
For UW-CSE and Cora, we use the logic formulae provided in the original dataset. UW-CSE provides 94 hand-coded logic formulae, and Cora provides 46 hand-coded rules. For Kinship, we hand-code 22 first-order logic formulae. For FB15K-237, we first use Neural LP (Yang et al., 2017) on the full data to generate candidate rules. Then we select the ones that have confidence scores higher than $90 \%$ of the highest scored formulae sharing the same target predicate. We also de-duplicate redundant rules that can be reduced to other rules by switching the logic variables. Finally, we have generated 509 logic formulae for FB15K-237.
|
| 384 |
+
|
| 385 |
+
Table 7: Examples of logic formulae used in four benchmark datasets.
|
| 386 |
+
|
| 387 |
+
<table><tr><td>Dataset</td><td>First-order Logic Formulae</td></tr><tr><td rowspan="5"></td><td>Father(X,Z)∧Mother(Y,Z)→ Husband(X,Y)</td></tr><tr><td>Father(X,Z)∧Husband(X,Y) =Mother(Y,Z)</td></tr><tr><td>Husband(X,Y)=Wife(Y,X)</td></tr><tr><td>Son(Y,X)=Father(X,Y)VMother(X,Y)</td></tr><tr><td>Daughter(Y,X)=Father(X,Y)VMother(X,Y)</td></tr><tr><td rowspan="5">UW-CSE</td><td>taughtBy(c,p,q) ∧courseLevel(c,Level500)⇒professor(p)</td></tr><tr><td>tempAdvisedBy(p,s)⇒professor(p)</td></tr><tr><td>advisedBy(p,s)⇒ student(s)</td></tr><tr><td>tempAdvisedBy(p,s)= student(s)</td></tr><tr><td>professor(p)∧hasPosition(p,Faculty)⇒taughtBy(c,p,q)</td></tr><tr><td rowspan="5">Cora</td><td>SameBib(b1,b2)∧SameBib(b2,b3)= SameBib(b1,b3)</td></tr><tr><td>SameTitle(tl,t2)^SameTitle(t2,t3)⇒SameTitle(t1,t3)</td></tr><tr><td>Author(bcl,al)^Author(bc2,a2)^SameAuthor(al,a2) ⇒ SameBib(bcl,bc2)</td></tr><tr><td>HasWordVenue(al,+w)^ HasWordVenue(a2,+w) ⇒ SameVenue(al,a2)</td></tr><tr><td>Title(bcl,t1)^ Title(bc2,t2)^SameTitle(t1,t2) ⇒ SameBib(bcl,bc2)</td></tr><tr><td rowspan="4">FB15K-237</td><td>position(B,A)∧position(C,B)⇒position(C,A) ceremony(B,A)^ceremony(C,B)⇒categoryOf(C,A)</td></tr><tr><td>film(B,A)∧film(C,B)⇒participant(A,C)</td></tr><tr><td>storyBy(A,B)=participant(A,B)</td></tr><tr><td>adjoins(A,B)∧country(B,C) = serviceLocation(A,C)</td></tr></table>
|
| 388 |
+
|
| 389 |
+
# E PROOF OF THEOREM
|
| 390 |
+
|
| 391 |
+
First, we re-state the definition and theorem in a more mathematical form:
|
| 392 |
+
|
| 393 |
+
Definition. [Isomorphic Nodes] Two ordered sequences of nodes $\left( c _ { 1 } , \ldots , c _ { n } \right)$ and $( c _ { 1 } ^ { \prime } , \ldots , c _ { n } ^ { \prime } )$ are isomorphic in a graph $\mathcal { G } _ { K }$ if there exists an isomorphism from $\mathcal { G } _ { \kappa } = ( \mathcal { C } , \mathcal { O } , \mathcal { E } )$ to itself, i.e., $\pi : \mathcal { C } \cup \mathcal { O } \mathcal { C } \cup \mathcal { O }$ , such that $\pi ( c _ { 1 } ) = c _ { 1 } ^ { \prime } , \ldots , \pi ( c _ { n } ) = { \overset { \prime } { c } } _ { n } ^ { \prime }$ . Further, we use the following notation $\left( c _ { 1 } , \cdots , c _ { n } \right) { \overset { \mathscr { G } _ { \kappa } } { \longleftrightarrow } } \left( c _ { 1 } ^ { \prime } , \cdots , c _ { n } ^ { \prime } \right) : \left( c _ { 1 } , \cdots , c _ { n } \right)$ and $( c _ { 1 } ^ { \prime } , \cdots , c _ { n } ^ { \prime } )$ are isomorphic in $\mathcal { G } _ { K }$
|
| 394 |
+
|
| 395 |
+
Theorem. Consider a knowledge base $\boldsymbol { \mathcal { K } } = ( \mathcal { C } , \mathcal { R } , \mathcal { O } )$ and any $r \in \mathcal { R }$ . Two latent random variables $X : = r ( c _ { 1 } , \ldots , c _ { n } )$ and $X ^ { \prime } : = \bar { r } ( c _ { 1 } ^ { \prime } , \ldots , c _ { n } ^ { \prime } )$ have the same posterior distribution in any MLN if and only if $( c _ { 1 } , \cdot \cdot \cdot , c _ { n } ) \overset { { \mathcal { G } } _ { \kappa } } { \longleftrightarrow } ( c _ { 1 } ^ { \prime } , \cdot \cdot \cdot , c _ { n } ^ { \prime } )$ .
|
| 396 |
+
|
| 397 |
+
Then we give the proof as follows.
|
| 398 |
+
|
| 399 |
+
Proof. A graph isomorphism from $G$ to itself is called automorphism, so in this proof, we will use the terminology - automorphism - to indicate such a self-bijection.
|
| 400 |
+
|
| 401 |
+
$( \Longleftarrow )$ We first prove the sufficient condition:
|
| 402 |
+
|
| 403 |
+
If ∃ automorphism $\pi$ on the graph $\mathcal { G } _ { K }$ such that $\pi ( c _ { i } ) = c _ { i } ^ { \prime } , \forall i = 1 , . . . , n .$ , then for any $r \in \mathcal { R }$ , $r ( c _ { 1 } , \ldots , c _ { n } )$ and $r ( c _ { 1 } ^ { \prime } , \ldots , c _ { n } ^ { \prime } )$ have the same posterior in any ML
|
| 404 |
+
|
| 405 |
+
MLN is a graphical model that can also be represented by a factor graph $\mathbf { M L N } = ( \mathcal { O } \cup \mathcal { H } , \mathcal { F } _ { g } , \mathcal { E } )$ where ground predicates (random variables) and ground formulae (potential) are connected. We will show that $\exists$ an automorphism $\phi$ on MLN such that $\phi \left( r ( c _ { 1 } , \ldots , \bar { c _ { n } } ) \right) = r ( c _ { 1 } ^ { \prime } , \ldots , c _ { n } ^ { \prime } )$ . Then the sufficient condition is true. This automorphism $\phi$ is easy to construct using the automorphism $\pi$ on $\mathcal { G } _ { K }$ . More precisely, we define $\phi : ( \mathcal { O } \cup \mathcal { H } , \mathcal { F } _ { g } ) ( \mathcal { O } \cup \mathcal { H } , \mathcal { F } _ { g } )$ as
|
| 406 |
+
|
| 407 |
+
for any predicate $r \in \mathcal { R }$ , any assignments $a _ { r }$ to its arguments, any formula $f \in { \mathcal { F } }$ , and any assignments $a _ { f }$ to its arguments. It is easy to see $\phi$ is an automorphism:
|
| 408 |
+
|
| 409 |
+
1. Since $\pi$ is a bijection, apparently $\phi$ is also a bijection.
|
| 410 |
+
2. The above definition preserves the biding of the arguments. $r ( a _ { r } )$ and $f ( a _ { f } )$ are connected if and only if $\phi ( r ( a _ { r } ) )$ and $f ( \pi ( a _ { f } ) )$ are connected.
|
| 411 |
+
3. Given the definition of $\pi$ , we know that $r ( a _ { r } )$ and $r ( \pi ( a _ { r } ) )$ have the same observation value. Therefore, in MLN, $\mathtt { N o d e T y p e } ( r ( a _ { r } ) ) = \mathtt { N o d e T y p e } ( \phi ( r ( a _ { r } ) ) )$ .
|
| 412 |
+
|
| 413 |
+
This completes the proof of the sufficient condition.
|
| 414 |
+
|
| 415 |
+
$( \Longrightarrow )$ ) To prove the necessary condition, it is equivalent to show the following assumption
|
| 416 |
+
|
| 417 |
+
(A 1): there is no automorphism $\pi$ on the graph $\mathcal { G } _ { K }$ such that $\pi ( c _ { i } ) = c _ { i } ^ { \prime } , \forall i = 1 , . . . , n $ , can imply:
|
| 418 |
+
|
| 419 |
+
there must exists a MLN and a predicate $r$ in it such that $r ( c _ { 1 } , \ldots , c _ { n } )$ and $r ( c _ { 1 } ^ { \prime } , \ldots , c _ { n } ^ { \prime } )$ have different posterior.
|
| 420 |
+
|
| 421 |
+
Before showing this, let us first introduce the factor graph representation of a single logic formula $f$ .
|
| 422 |
+
|
| 423 |
+
A logic formula $f$ can be represented as a factor graph, $\bar { \mathcal { G } _ { f } } = ( \mathcal { C } _ { f } , \mathcal { R } _ { f } , \mathcal { E } _ { f } )$ , where nodes on one side of the graph is the set of distinct constants $\mathcal { C } _ { f }$ needed in the formula, while nodes on the other side is the set of predicates $\mathcal { R } _ { f }$ used to define the formula. The set of edges, $\mathcal { E } _ { f }$ , will connect constants to predicates or predicate negation. That is, an edge
|
| 424 |
+
|
| 425 |
+
$\begin{array} { r l r } { e } & { { } = } & { \left( c , r , i \right) } \end{array}$ between node $c$ and predicate $r$ exists, if the predicate $r$ use constant $c$ in its $i$ -th argument.
|
| 426 |
+
|
| 427 |
+
We note that the set of distinctive constants used in the definition of logic formula are templates where actual constant can be instantiated from $\mathcal { C }$ . An illustration of logic formula factor graph can be found in Fig. 8. Similar to the factor graph for the knowledge base, we also differentiate the type of edges by the position of the argument.
|
| 428 |
+
|
| 429 |
+

|
| 430 |
+
Figure 8: An example of the factor graph for the logic formula ¬Husband(X,Y) ∨ ¬Mother(Y,Z) ∨ Daughter(Z,X).
|
| 431 |
+
|
| 432 |
+
Therefore, every single formula can be represented by a factor graph. We will construct a factor graph representation to define a particular formula, and show that the MLN induced by this formula will result in different posteriors for $r ( c _ { 1 } , \ldots , c _ { n } )$ and $r ( c _ { 1 } ^ { \prime } , \ldots , c _ { n } ^ { \prime } )$ . The factor graph for the formula is constructed in the following way (see Fig. 7 as an example of the resulting formula constructed using the following steps):
|
| 433 |
+
|
| 434 |
+
(i) Given the above assumption (A 1), we claim that:
|
| 435 |
+
|
| 436 |
+
∃ a subgraph $\mathcal { G } _ { c _ { 1 : n } } ^ { * } = ( \mathcal { C } _ { c } ^ { * } , \mathcal { O } _ { c } ^ { * } , \mathcal { E } _ { c } ^ { * } ) \subseteq \mathcal { G } _ { K }$ such that all subgraphs $\mathcal { G } _ { c _ { 1 : n } ^ { \prime } } = ( \mathcal { C } _ { c ^ { \prime } } , \mathcal { O } _ { c ^ { \prime } } , \mathcal { E } _ { c ^ { \prime } } ) \subseteq \mathcal { G } _ { K }$ satisfy:
|
| 437 |
+
|
| 438 |
+
(Condition) if there exists an isomorphism $\phi : \mathcal { G } _ { c _ { 1 : n } } ^ { * } \ \to \ \mathcal { G } _ { c _ { 1 : n } ^ { \prime } }$ satisfying $\phi ( c _ { i } ) =$ $c _ { i } ^ { \prime } , \forall i = 1 , \ldots , n$ after the observation values are IGNORED (that is, $[ r _ { j } ( \cdots ) = 0 ]$ and $[ r _ { j } ( \cdots ) = 1 ]$ are treated as the SAME type of nodes), then the set of fact nodes (observations) in these two graphs are different (that is, $\mathcal { O } _ { c } ^ { * } \neq \mathcal { O } _ { c ^ { \prime } }$ ).
|
| 439 |
+
|
| 440 |
+
The proof of this claim is given at the end of this proof.
|
| 441 |
+
|
| 442 |
+
(ii) Next, we use $\mathcal { G } _ { c _ { 1 : n } } ^ { * }$ to define a formula $f$ . We first initialize the definition of the formula value as
|
| 443 |
+
|
| 444 |
+
$$
|
| 445 |
+
f ( c _ { 1 } , \dots , c _ { n } , \tilde { c } _ { 1 } , \dots , \tilde { c } _ { n } ) = \big ( \wedge \left\{ \tilde { r } ( a _ { \tilde { r } } ) : \tilde { r } ( a _ { \tilde { r } } ) \in \mathcal { G } _ { c _ { 1 : n } } ^ { * } \right\} \big ) \Rightarrow r ( c _ { 1 } , \dots , c _ { n } ) .
|
| 446 |
+
$$
|
| 447 |
+
|
| 448 |
+
Then, we change $\tilde { r } ( a _ { \tilde { r } } )$ in this formula to the negation $\neg \tilde { r } ( a _ { \tilde { r } } )$ if the observed value of $\tilde { r } ( a _ { \tilde { r } } )$ is $_ 0$ in G ∗c1:n .
|
| 449 |
+
|
| 450 |
+
We have defined a formula $f$ using the above two steps. Suppose the MLN only contains this formula $f$ . Then
|
| 451 |
+
|
| 452 |
+
the two nodes $r ( c _ { 1 } , \ldots , c _ { n } )$ and $r ( c _ { 1 } ^ { \prime } , \ldots , c _ { n } ^ { \prime } )$ in this MLN must be distinguishable.
|
| 453 |
+
|
| 454 |
+
The reason is, in MLN, $r ( c _ { 1 } , \ldots , c _ { n } )$ is connected to a ground formula $f ( c _ { 1 } , \ldots , c _ { n } , \tilde { c } _ { 1 } , \ldots , \tilde { c } _ { n } )$ 1whose factor graph representation is $\mathcal { G } _ { c _ { 1 } : n } ^ { * } \cup r ( c _ { 1 } , . . . , c _ { n } )$ 1 n 1 n . In this formula, all variables are observed in the knowledge base $\kappa$ except for $r ( \ddot { c } _ { 1 } , \ldots , c _ { n } )$ and and the observation set is ${ \mathcal { O } } _ { c } ^ { * }$ . The formula value is
|
| 455 |
+
|
| 456 |
+
$$
|
| 457 |
+
f ( c _ { 1 } , \dots , c _ { n } , \tilde { c } _ { 1 } , \dots , \tilde { c } _ { n } ) = ( 1 \Rightarrow r ( c _ { 1 } , \dots , c _ { n } ) ) .
|
| 458 |
+
$$
|
| 459 |
+
|
| 460 |
+
Clarification: Eq. 10 is used to define a formula and $c _ { i }$ in this equation can be replaced by other constants, while Eq. 11 represents a ground formula whose arguments are exactly $c _ { 1 } , \ldots , c _ { n } , { \tilde { c } } _ { 1 } , \ldots , { \tilde { c } } _ { n }$ . Based on (Condition), there is NO formula $f ( c _ { 1 } ^ { \prime } , \ldots , c _ { n } ^ { \prime } , \bar { c } _ { 1 } ^ { \prime } , \ldots , \tilde { c } _ { n } ^ { \prime } )$ that contains $r ( c _ { 1 } ^ { \prime } , \ldots , c _ { n } ^ { \prime } )$ has
|
| 461 |
+
|
| 462 |
+
an observation set the same as ${ \mathcal { O } } _ { c } ^ { * }$ . Therefore, $r ( c _ { 1 } , \ldots , c _ { n } )$ and $r ( c _ { 1 } ^ { \prime } , \ldots , c _ { n } ^ { \prime } )$ are distinguishable in this MLN.
|
| 463 |
+
|
| 464 |
+
# Proof of claim:
|
| 465 |
+
|
| 466 |
+
We show the existence by constructing the subgraph $\mathcal { G } _ { c _ { 1 : n } } ^ { * } \subseteq \mathcal { G } _ { K }$ in the following way:
|
| 467 |
+
|
| 468 |
+
(i) First, we initialize the subgraph as $\mathcal { G } _ { c _ { 1 : n } } ^ { * } : = \mathcal { G } _ { K }$ . Given assumption (A 1) stated above, it is clear that
|
| 469 |
+
|
| 470 |
+
$( \mathbf { S } \mathbf { \delta } \mathbf { 1 } ) \forall$ subgraph ${ \mathcal { G } } ^ { \prime } \subseteq { \mathcal { G } } _ { \kappa }$ , there is no isomorphism $\pi : \mathcal { G } _ { c _ { 1 : n } } ^ { * } \mathcal { G } ^ { \prime }$ satisfying $\pi ( c _ { i } ) =$ $c _ { i } ^ { \prime } , \forall i = 1 , \ldots , n$ .
|
| 471 |
+
|
| 472 |
+
(ii) Second, we need to check wether the following case occurs:
|
| 473 |
+
|
| 474 |
+
(C 1) ∃ a subgraph $\mathcal { G } ^ { \prime } = ( \mathcal { C } ^ { \prime } , \mathcal { O } ^ { \prime } , \mathcal { E } ^ { \prime } )$ such that (1) there EXISTS an isomorphism $\phi$ : G ∗c1:n $\mathcal { G } _ { c _ { 1 : n } } ^ { * } \to \mathcal { G } ^ { \prime }$ satisfying $\phi ( c _ { i } ) = c _ { i } ^ { \prime } , \forall i = 1 , . . . , n$ after the observation values are IGNORED (that is, $[ r _ { j } ( \cdots ) = 0 ]$ and $[ r _ { j } ( \cdots ) = 1 ]$ are treated as the same type of nodes); and (2) the set of factor nodes (observations) in these two graphs are the same (that is, ${ \mathcal { O } } _ { c } ^ { * } = { \mathcal { O } } ^ { \prime }$ ).
|
| 475 |
+
|
| 476 |
+
(iii) Third, we need to modify the subgraph if the case (C 1) is observed. Since $\left| \mathcal { G } _ { c _ { 1 : n } } ^ { * } \right| \geq | \mathcal { G } ^ { \prime } |$ , the only subgraph that will lead to the case (C1) is the maximal subgraph $\mathcal { G } _ { c _ { 1 : n } } ^ { * }$ . The isomorphism $\phi$ is defined by ignoring the observation values, while the isomorphism $\pi$ in $( \mathbf { \dot { S } } \mathbf { 1 } )$ is not ignoring them. Thus,
|
| 477 |
+
|
| 478 |
+
(S 1) and $( \mathbf { C _ { \lambda } } \mathbf { 1 } ) \Longrightarrow \exists$ a set of nodes $S : = \left\{ \left[ r _ { j } ( a ^ { ( 1 ) } ) = 0 \right] , \ldots , \left[ r _ { j } ( a ^ { ( n ) } ) = 0 \right] \right\}$ such that for any isomorphism $\phi$ satisfying the conditions in $( \mathbf { C 1 } )$ , the range $\phi ( S )$ contains at least one node $[ r _ { j } ( \cdot ) = 1 ]$ which has observation value 1.
|
| 479 |
+
|
| 480 |
+
Otherwise, it is easy to see a contradiction to statement (S 1).
|
| 481 |
+
|
| 482 |
+
(M 1) Modify the subgraph by $\mathcal { G } _ { c _ { 1 : n } } ^ { * } \mathcal { G } _ { c _ { 1 : n } } ^ { * } \setminus S$ . The nodes (and also their edges) in the set $S : = \left\{ \left[ r _ { j } ( a ^ { ( 1 ) } ) = 0 \right] , \ldots , \left[ r _ { j } ( a ^ { ( n ) } ) = 0 \right] \right\}$ are removed.
|
| 483 |
+
|
| 484 |
+
For the new subgraph $\mathcal { G } _ { c _ { 1 : n } } ^ { * }$ after the modification (M 1), the case (C 1) will not occur. Thus, we’ve obtained a subgraph that satisfies the conditions stated in the claim. Finally, we can remove the nodes that are not connected with $\{ c _ { 1 } , \ldots , c _ { n } \}$ (that is, there is no path between this node and any one of $\{ c _ { 1 } , \ldots , c _ { n } \} )$ . The remaining graph is connected to $\{ c _ { 1 } , \ldots , c _ { n } \}$ and still satisfies the conditions that we need.
|
md/train/rJgzzJHtDB/rJgzzJHtDB.md
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TRIPLE WINS: BOOSTING ACCURACY, ROBUSTNESS AND EFFICIENCY TOGETHER BY ENABLING INPUTADAPTIVE INFERENCE
|
| 2 |
+
|
| 3 |
+
Ting-Kuei Hu∗, Tianlong Chen∗, Haotao Wang Zhangyang Wang
|
| 4 |
+
|
| 5 |
+
Department of Computer Science and Engineering Texas A&M University, USA {tkhu,wiwjp619,htwang,atlaswang}@tamu.edu
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Deep networks were recently suggested to face the odds between accuracy (on clean natural images) and robustness (on adversarially perturbed images) (Tsipras et al., 2019). Such a dilemma is shown to be rooted in the inherently higher sample complexity (Schmidt et al., 2018) and/or model capacity (Nakkiran, 2019), for learning a high-accuracy and robust classifier. In view of that, give a classification task, growing the model capacity appears to help draw a win-win between accuracy and robustness, yet at the expense of model size and latency, therefore posing challenges for resource-constrained applications. Is it possible to co-design model accuracy, robustness and efficiency to achieve their triple wins?
|
| 10 |
+
|
| 11 |
+
This paper studies multi-exit networks associated with input-adaptive efficient inference, showing their strong promise in achieving a “sweet point” in cooptimizing model accuracy, robustness and efficiency. Our proposed solution, dubbed Robust Dynamic Inference Networks (RDI-Nets), allows for each input (either clean or adversarial) to adaptively choose one of the multiple output layers (early branches or the final one) to output its prediction. That multi-loss adaptivity adds new variations and flexibility to adversarial attacks and defenses, on which we present a systematical investigation. We show experimentally that by equipping existing backbones with such robust adaptive inference, the resulting RDI-Nets can achieve better accuracy and robustness, yet with over $30 \%$ computational savings, compared to the defended original models.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Deep networks, despite their high predictive accuracy, are notoriously vulnerable to adversarial attacks (Goodfellow et al., 2015; Biggio et al., 2013; Szegedy et al., 2014; Papernot et al., 2016). While many defense methods have been proposed to increase a model’s robustness to adversarial examples, they were typically observed to hamper its accuracy on original clean images. Tsipras et al. (2019) first pointed out the inherent tension between the goals of adversarial robustness and standard accuracy in deep networks, whose provable existence was shown in a simplified setting. Zhang et al. (2019) theoretically quantified the accuracy-robustness trade-off, in terms of the gap between the risk for adversarial examples versus the risk for non-adversarial examples.
|
| 16 |
+
|
| 17 |
+
It is intriguing to consider whether and why the model accuracy and robustness have to be at odds. Schmidt et al. (2018) demonstrated that the number of samples needed to achieve adversarially robust generalization is polynomially larger than that needed for standard generalization, under the adversarial training setting. A similar conclusion was concurred by Sun et al. (2019) in the standard training setting. Tsipras et al. (2019) considered the accuracy-robustness trade-off as an inherent trait of the data distribution itself, indicating that this phenomenon persists even in the limit of infinite data. Nakkiran (2019) argued from a different perspective, that the complexity (e.g. capacity) of a robust classifier must be higher than that of a standard classifier. Therefore, replacing a largercapacity classifier might effectively alleviate the trade-off. Overall, those existing works appear to suggest that, while accuracy and robustness are likely to trade off for a fixed classification model and on a given dataset, such trade-off might be effectively alleviated (“win-win”), if supplying more training data and/or replacing a larger-capacity classifier.
|
| 18 |
+
|
| 19 |
+
On a separate note, deep networks also face the pressing challenge to be deployed on resourceconstrained platforms due to the prosperity of smart Internet-of-Things (IoT) devices. Many IoT applications naturally demand security and trustworthiness, e.g., , biometrics and identity verification, but can only afford limited latency, memory and energy budget. Hereby we extend the question: can we achieve a triple-win, i.e., , an accurate and robust classfier while keeping it efficient?
|
| 20 |
+
|
| 21 |
+
This paper makes an attempt in providing a positive answer to the above question. Rather than proposing a specific design of robust light-weight models, we reduce the average computation loads by input-adaptive routing to achieve triple-win. To this end, we introduce the input-adaptive dynamic inference (Teerapittayanon et al., 2017; Wang et al., 2018a), an emerging efficient inference scheme in contrast to the (non-adaptive) model compression, to the adversarial defense field for the first time. Given any deep network backbone (e.g., , ResNet, MobileNet), we first follow (Teerapittayanon et al., 2017) to augment it with multiple early-branch output layers in addition to the original final output. Each input, regardless of clean or adversarial samples, adaptively chooses which output layer to take for its own prediction. Therefore, a large portion of input inferences can be terminated early when the samples can already be inferred with high confidence.
|
| 22 |
+
|
| 23 |
+
Up to our best knowledge, no existing work studied adversarial attacks and defenses for an adaptive multi-output model, as the multiple sources of losses provide much larger flexibility to compose attacks (and therefore defenses), compared to the typical single-loss backbone. We present a systematical exploration on how to (white-box) attack and defense our proposed multi-output network with adaptive inference, demonstrating that the composition of multiple-loss information is critical in making the attack/defense strong. Fig. 1 illustrates our proposed Robust Dynamic Inference Networks (RDI-Nets). We show experimentally that the input-adaptive inference and multiloss flexibility can be our friend in achieving the desired “triple wins”. With our best defended RDI-Nets, we achieve better accuracy and robustness, yet with over $30 \%$ inference computational savings, compared to the defended original models as well as existing solutions co-designing robustness and efficiency (Gui et al., 2019; Guo et al., 2018). The codes can be referenced from https://github.com/TAMU-VITA/triple-wins.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Our proposed RDI-Net framework, a defended multi-output network enabling dynamic inference. Each image, being it clean or adversarially perturbed, adaptively picks one branch to exit.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
# 2.1 ADVERSARIAL DEFENSE
|
| 31 |
+
|
| 32 |
+
A magnitude of defend approaches have been proposed (Kurakin et al., 2017; Xu et al., 2018; Song et al., 2018; Liao et al., 2018), although many were quickly evaded by new attacks (Carlini & Wagner, 2017; Baluja & Fischer, 2018). One strong defense algorithm that has so far not been fully compromised is adversarial training (Madry et al., 2018). It searches for adversarial images to augment the training procedure, although at the price of higher training costs (but not affecting inference efficiency). However, almost all existing attacks and defenses focus on a single-output classification (or other task) model. We are unaware of prior studies directly addressing attacks/defenses to more complicated networks with multiple possible outputs.
|
| 33 |
+
|
| 34 |
+
One related row of works are to exploit model ensemble (Tramer et al. \` , 2018; Strauss et al., 2017) in adversarial training. The gains of the defended ensemble compared to a single model could be viewed as the benefits of either the benefits of diversity (generating stronger and more transferable perturbations), or the increasing model capacity (consider the ensembled multiple models as a compound one). Unfortunately, ensemble methods could amplify the inference complexity and be detrimental for efficiency. Besides, it is also known that injecting randomization at inference time helps mitigate adversarial effects (Xie et al., 2018; Cohen et al., 2019). Yet up to our best knowledge, no work has studied non-random, but rather input-dependent inference for defense.
|
| 35 |
+
|
| 36 |
+
# 2.2 EFFICIENT INFERENCE
|
| 37 |
+
|
| 38 |
+
Research in improving deep network efficiency could be categorized into two streams: the static way that designs compact models or compresses heavy models, while the compact/compressed models remain fixed for all inputs at inference; and the dynamic way, that at inference the inputs can choose different computational paths adaptively, and the simpler inputs usually take less computation to make predictions. We briefly review the literature below.
|
| 39 |
+
|
| 40 |
+
Static: Compact Network Design and Model Compression. Many compact architectures have been specifically designed for resource-constrained applications, by adopting lightweight depthwise convolutions (Sandler et al., 2018), and group-wise convolutions with channel-shuffling (Zhang et al., 2018), to just name a few. For model compression, Han et al. (2015) first proposed to sparsify deep models by removing non-significant synapses and then re-training to restore performance. Structured pruning was later on introduced for more hardware friendliness (Wen et al., 2016). Layer factorization (Tai et al., 2016; Yu et al., 2017), quantization (Wu et al., 2016), model distillation (Wang et al., 2018c) and weight sharing (Wu et al., 2018) have also been respectively found effective.
|
| 41 |
+
|
| 42 |
+
Dynamic: Input-Adaptive Inference. Higher inference efficiency could be also accomplished by enabling input-conditional execution. Teerapittayanon et al. (2017); Huang et al. (2018); Kaya et al. (2019) leveraged intermediate features to augment multiple side branch classifiers to enable early predictions. Their methodology sets up the foundation for our work. Other efforts (Figurnov et al., 2017; Wang et al., 2018a;b; 2019) allow for an input to choose between passing through or skipping each layer. The approach could be integrated with RDI-Nets too, which we leave as future work.
|
| 43 |
+
|
| 44 |
+
# 2.3 BRIDGING ROBUSTNESS WITH EFFICIENCY
|
| 45 |
+
|
| 46 |
+
A few studies recently try to link deep learning robustness and efficiency. Guo et al. (2018) observed that in a sparse deep network, appropriately sparsified weights improve robustness, whereas over-sparsification (e.g., less than $5 \%$ nonzero weights) in turn makes the model more fragile. Two latest works (Ye et al., 2019; Gui et al., 2019) examined the robustness of compressed models, and concluded similar observations that the relationship between mode size and robustness depends on compression methods and are often non-monotonic. Lin et al. (2019) found that activation quantization may hurt robustness, but can be turned into effective defense if enforcing continuity constraints.
|
| 47 |
+
|
| 48 |
+
Different from above methods that tackle robustness from static compact/compressed models, the proposed RDI-Nets are the first to address robustness from the dynamic input-adaptive inference. Our experiment results demonstrate the consistent superiority of RDI-Nets over those static methods (Section 4.3). Moreover, applying dynamic inference top of those static methods may further boost the robustness and efficiency, which we leave as future work.
|
| 49 |
+
|
| 50 |
+
# 3 APPROACH
|
| 51 |
+
|
| 52 |
+
With the goal of achieving inference efficiency, we first look at the setting of multi-output networks and the specific design of RDI-Net in Section 3.1. Then we define three forms of adversarial attacks for multi-output networks in Section 3.2 and their corresponding defense methods in Section 3.3.
|
| 53 |
+
|
| 54 |
+
Note that RDI-Nets achieve “triple wins”via reducing the average computation loads through inputadaptive routing. It is not to be confused with any specifically-designed robust light-weight model.
|
| 55 |
+
|
| 56 |
+
# 3.1 DESIGNING RDI-NETS FOR HIGHER INFERENCE EFFICIENCY
|
| 57 |
+
|
| 58 |
+
Given an input image $x$ , an $N$ -output network can produce a set of predictions $[ \hat { y _ { 1 } } , . . . , \hat { y _ { N } } ]$ by a set of transformations $[ f _ { \theta _ { 1 } } ( \cdot ) , . . . , f _ { \theta _ { N } } ( \cdot ) ]$ . $\theta _ { i }$ denote the model parameter of $f _ { \theta _ { i } }$ , $i = 1 , . . . , N$ , and $f _ { \theta _ { i } } \mathbf { s }$ will typically share some weights. With an input $x$ , one can express $\hat { y } _ { i } = f _ { \boldsymbol { \theta } _ { i } } ( \boldsymbol { x } )$ . We assume that the final prediction will be one chosen (NOT fused) from $[ \hat { y _ { 1 } } , . . . , \hat { y _ { N } } ]$ via some deterministic strategy.
|
| 59 |
+
|
| 60 |
+
We now look at RDI-Nets as a specific instance of multi-output networks, specifically designed for the goal of more efficient, input-adaptive inference. As shown in Fig. 1, for any deep network (e.g., , ResNet, MobileNet), we could append $K$ side branches (with negligible overhead) to allow for early-exit predictions. In other words, it becomes a $( K + 1 )$ -output network, and the subneworks with the $K + 1$ exits, from the lowest to the highest (the original final output), correspond to $[ f _ { \theta _ { 1 } } ( \cdot ) , . . . , f _ { \theta _ { K + 1 } } ( \cdot ) ]$ . They share their weights in a nested fashion: ${ \theta } _ { 1 } \subseteq { \theta } _ { 2 } . . . \subseteq { \theta } _ { K + 1 }$ , with $\theta _ { K + 1 }$ including the entire network’s parameters.
|
| 61 |
+
|
| 62 |
+
Our deterministic strategy in selecting one final output follows (Teerapittayanon et al., 2017). We set a confidence threshold $t _ { k }$ for each $k$ -th exit, $k = 1 , . . . , K + 1$ , and each input $x$ will terminate inference and output its prediction in the earliest exit (smallest $k$ ), whose softmax entropy (as a confidence measure) falls below $t _ { k }$ . All computations after the $k$ -th exit will not be activated for this $x$ . Such a progressive and early-halting mechanism effectively saves unnecessary computation for most easier-to-classify samples, and applies in both training and inference. Note that, if efficiency is not the concern, instead of choosing (the earliest one), we could have designed an adaptive or randomized fusion of all $f _ { \theta _ { i } }$ predictions: but that falls beyond the goal of this work.
|
| 63 |
+
|
| 64 |
+
The training objective for RDI-Nets could be written as
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
L _ { R D I } = \sum _ { i = 1 } ^ { K + 1 } w _ { i } [ ( \phi ( f _ { i } ( \theta _ { i } | x ) , y ) + \phi ( f _ { i } ( \theta _ { i } | x ^ { a d v } ) , y ) ] ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
For each exit loss, we minimize a hybrid loss of accuracy (on clean $x$ ) and robustness (on $x ^ { a d v }$ ). The K + 1 exits are balanced with a group of weights {wi}K+1i=1 . More details about RDI-Net structures, hyperparameters, and inference branch selection can be founded in Appendix A, B, and C.
|
| 71 |
+
|
| 72 |
+
In what follows, we discuss three ways to generate $x ^ { a d v }$ in RDI-Nets, and then their defenses.
|
| 73 |
+
|
| 74 |
+
# 3.2 THREE ATTACK FORMS ON MULTI-OUTPUT NETWORKS
|
| 75 |
+
|
| 76 |
+
We consider white box attacks in this paper. Attackers have access to the model’s parameters, and aim to generate an adversarial image $x ^ { a d v }$ to fool the model by perturbing an input $x$ within a given magnitude bound.
|
| 77 |
+
|
| 78 |
+
We next discuss three attack forms for an $N$ -output network. Note that they are independent of, and to be distinguished from attacker algorithms (e.g., , PGD, C&W, FGSM): the former depicts the optimization formulation, that can be solved any of the attacker algorithms.
|
| 79 |
+
|
| 80 |
+
Single Attack Naively extending from attacking single-output networks, a single attack is defined to maximally fool one $f _ { \theta _ { i } } ( \cdot )$ only, expressed as:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
x _ { i } ^ { a d v } = \underset { x ^ { \prime } \in | x ^ { \prime } - x | _ { \infty } \leq \epsilon } { \arg \operatorname* { m a x } } | \phi ( f _ { \theta _ { i } } ( x ^ { \prime } ) , y ) | ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $y$ is the ground truth label, and $\phi$ is the loss for $f _ { \theta _ { i } }$ (we assume softmax for all). $\epsilon$ is the perturbation radius and we adopt $\ell _ { \infty }$ ball for an empirically strong attacker. Naturally, an $N$ -output network can have $N$ different single attacks. However, each single attack is derived without being aware of other parallel outputs. The found $x _ { i } ^ { a d v }$ is not necessarily transferable to other $f _ { \boldsymbol { \theta } _ { j } } \mathbf { s } \left( j \neq i \right)$ , and therefore can be easily bypassed if $x$ is re-routed through other outputs to make its prediction.
|
| 87 |
+
|
| 88 |
+
Average Attack Our second attack maximizes the average of all $f _ { \theta _ { i } }$ losses, so that the found $x ^ { a d v }$ remains in effect no matter which one $f _ { \theta _ { i } }$ is chosen to output the prediction for $x$ :
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
x _ { a v g } ^ { a d v } = \underset { x ^ { \prime } \in | x ^ { \prime } - x | _ { \infty } \leq \epsilon } { \arg \operatorname* { m a x } } | \frac { 1 } { N } \sum _ { j = 1 } ^ { N } \phi ( f _ { \theta _ { j } } ( x ^ { \prime } ) , y ) | ,
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
The average attack addresses takes into account the attack transferablity and involves all $\theta _ { j } \mathbf { s }$ into optimization. However, while only one output will be selected for each sample at inference, the average strategy might weaken the individual defense strength of each $f _ { \theta _ { i } }$ .
|
| 95 |
+
|
| 96 |
+
Max-Average Attack Our third attack aims to emphasize individual output defense strength, more than simply maximizing an all-averaged loss. We first solve the $N$ single attacks $x _ { i } ^ { a d v }$ as described in Eqn. 2, and denote their collection as $\Omega$ . We then solve the max-average attack via the following:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
i ^ { * } = \arg \operatorname* { m a x } _ { i } | \frac { 1 } { N } \sum _ { j = 1 } ^ { N } \phi ( f _ { \theta _ { j } } ( x _ { i } ^ { a d v } ) , y ) | .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Note Eqn. 4 differs from Eqn. 3 by adding an $\Omega$ constraint to balance between “commodity” and “specificity”. The found $\hat { x } _ { m a x } ^ { a d v }$ both strongly increases the averaged loss values from all $f _ { i } \mathbf { s }$ (therefore possessing transferablity), and maximally fools one individual $f _ { \boldsymbol { \theta } _ { i } } \mathbf { s }$ as it is selected from the collection $\Omega$ of single attacks.
|
| 103 |
+
|
| 104 |
+
# 3.3 DEFENCE ON MULTI-OUTPUT NETWORKS
|
| 105 |
+
|
| 106 |
+
For simplicity and fair comparison, we focus on adversarial training (Madry et al., 2018) as our defense framework, where the three above defined attack forms can be plugged-in to generate adversarial images to augment training, as follows ( $\Theta$ is the union of learnable parameters):
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\Xi \Theta , \mathrm { w h e r e } \theta _ { i } = \underset { \theta ^ { \prime } } { \arg \operatorname* { m i n } } | \phi ( f _ { \theta _ { i } } ( x ) , y ) + \phi ( f _ { \theta _ { i } } ( x ^ { a d v } ) , y ) | . ,
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where $x ^ { a d v } \in \{ x _ { i } ^ { a d v } , x _ { a v g } ^ { a d v } , x _ { m a x } ^ { a d v } \} { } _ { }$ . As $f _ { i } \mathbf { s }$ partially share their weights $\theta _ { i }$ in a multi-output network, the updates from different $f _ { i } \mathbf { s }$ will be averaged on the shared parameters.
|
| 113 |
+
|
| 114 |
+
# 4 EXPERIMENTAL RESULTS
|
| 115 |
+
|
| 116 |
+
4.1 EXPERIMENTAL SETUP
|
| 117 |
+
|
| 118 |
+
Evaluation Metrics We evaluate accuracy, robustness, and efficiency, using the metrics below:
|
| 119 |
+
|
| 120 |
+
• Testing Accuracy (TA): the classification accuracy on the original clean test set. • Adversarial Testing Accuracy (ATA): Given an attacker, ATA stands for the classification accuracy on the attacked test set. It is the same as the “robust accuracy” in (Zhang et al., 2019). • Mega Flops (MFlops): The number of million floating-point multiplication operations consumed on the inference, averaged over the entire testing set.
|
| 121 |
+
|
| 122 |
+
Datasets and Benchmark Models We evaluate three representative CNN models on two popular datasets: SmallCNN on MNIST (Chen et al., 2018); ResNet-38 (He et al., 2016) and MobileNet-V2 (Sandler et al., 2018) on CIFAR-10. The three networks span from simplest to more complicated, and covers a compact backbone. All three models are defended by adversarial training, constituting strong baselines. Table 1 reports the models, datasets, the attacker algorithm used in attack & defense, and thee TA/ATA/MFlops performance of three defended models.
|
| 123 |
+
|
| 124 |
+
Attack and Defense on RDI-Nets We build RDI-Nets by appending side branch outputs for each backbone. For SmallCNN, we add two side branches $K = 2$ ). For ResNet-38 and MobileNet-V2, we have $K = 6$ and $K = 2$ , respectively. The branches are designed to cause negligible overheads: more details of their structure and positions can be referenced in Appendix B. We call those result models RDI-SmallCNN, RDI-ResNet38 and RDI-MobileNetV2 hereinafter.
|
| 125 |
+
|
| 126 |
+
We then generate attacks using our three defined forms. Each attack form could be solved with various attacker algorithms (e.g., PGD, C&W, FGSM), and by default we solve it with the same attacker used for each backbone in Table 1. If we fix one attacker algorithm (e.g., PGD), then TA/ATA for a single-output network can be measured without ambiguity. Yet for $( K { + } 1 )$ -output RDI-Nets, there could be at least $K { + 3 }$ different ATA numbers for one defended model, depending on what attack form in Section 3.1 to apply $\scriptstyle { K + 1 }$ single attacks, 1 average attack, and 1 maxaverage attack). For example, we denote by ATA (Branch1) the ATA number when applying the single attack generated from the first side output branch (e.g., $x _ { 1 } ^ { a d v } .$ ); similarly elsewhere.
|
| 127 |
+
|
| 128 |
+
We also defend RDI-Nets using adversarial training, using the forms of adversarial images to augment training. By default, we adopt three adversarial training defense schemes: Main Branch (single attack using $x _ { K + 1 } ^ { a d v } ) ^ { 1 }$ 1,Average (using $x _ { a v g . } ^ { a d v . }$ ),and Max-Average (using $x _ { a v g } ^ { m a x }$ ), in addition to the undefended RDI-Nets (using standard training) denoted as Standard.
|
| 129 |
+
|
| 130 |
+
We cross evaluate ATAs of different defenses and attacks, since an ideal defense shall protect against all possible attack forms. To faithfully indicate the actual robustness, we choose the lowest number among all $K + 3$ ATAs, denoted as ATA (Worst-Case), as the robustness measure for an RDI-Net.
|
| 131 |
+
|
| 132 |
+
Table 1: Benchmarking results of adverserial training of three networks. PGD-40 denotes running the projected gradient descent attacker (Madry et al., 2018) for 40 iterations. We set the perturbation size as 0.3 for MNIST and 8/255 for CIFAR-10 in $\ell _ { \infty }$ norm (adopted by all following experiments).
|
| 133 |
+
|
| 134 |
+
<table><tr><td>Model</td><td>Dataset</td><td>Defend</td><td>Attack</td><td>TA</td><td>ATA</td><td>MFlops</td></tr><tr><td>SmalICNN</td><td>MNIST</td><td>PGD-40</td><td>PGD-40</td><td>99.49%</td><td>96.31%</td><td>9.25</td></tr><tr><td>ResNet-38</td><td>CIFAR-10</td><td>PGD-10</td><td>PGD-20</td><td>83.62%</td><td>42.29%</td><td>79.42</td></tr><tr><td>MobileNetV2</td><td>CIFAR-10</td><td>PGD-10</td><td>PGD-20</td><td>84.42%</td><td>46.92%</td><td>86.91</td></tr></table>
|
| 135 |
+
|
| 136 |
+
# 4.2 EVALUATION AND ANALYSIS
|
| 137 |
+
|
| 138 |
+
MNIST Experiments The MNIST experimental results on RDI-SmallCNN are summarized in table 2, with several meaningful observations to be drawn. First, the undefended models (Standard) are easily compromised by all attack forms. Second, The single attack-defended model (Main Branch) achieves the best ATA against the same type of attack, i.e., ATA (Main Branch), and also seems to boost the closest output branch’s robustness, i.e., ATA (Branch 2). However, its defense effect on the further-away Branch 1 is degraded, and also shows to be fragile under two stronger attacks (Average, and Max-Average). Third, both Average and Max-Average defenses achieve good TAs, as well as ATAs against all attack forms (and therefore Worst-Case), with Max-Average slightly better at both (the margins are small due to the data/task simplicity; see next two).
|
| 139 |
+
|
| 140 |
+
Moreover, compared to the strong baseline of SmallCNN defended by PGD (40 iterations)-based adversarial training, RDI-SmallCNN with Max-Average defense wins in terms of both TA and ATA. Impressively, that comes together with $3 4 . 3 0 \%$ computational savings compared to the baseline. Here the different defense forms do not appear to alter the inference efficiency much: they all save around $34 \% - 3 6 \%$ MFlops compared to the backbone.
|
| 141 |
+
|
| 142 |
+
Table 2: The performance of RDI-SmallCNN. The ”Average MFlops” is calculated by averaging the total flop costs consumed over the inference of the entire set (different samples take different FLOPs due to input-adaptive inference). The perturbation size and step size are 0.3 and 0.01, respectively.
|
| 143 |
+
|
| 144 |
+
<table><tr><td rowspan=1 colspan=1>Defense Method</td><td rowspan=1 colspan=1>Standard</td><td rowspan=1 colspan=1>Main Branch</td><td rowspan=1 colspan=1>Average</td><td rowspan=1 colspan=1>Max-Average</td></tr><tr><td rowspan=1 colspan=1>TA</td><td rowspan=1 colspan=1>99.48%</td><td rowspan=1 colspan=1>99.50%</td><td rowspan=1 colspan=1>99.51%</td><td rowspan=1 colspan=1>99.52%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch 1)</td><td rowspan=1 colspan=1>6.60%</td><td rowspan=1 colspan=1>60.50%</td><td rowspan=1 colspan=1>98.69%</td><td rowspan=1 colspan=1>98.52%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch 2)</td><td rowspan=1 colspan=1>3.16%</td><td rowspan=1 colspan=1>98.14%</td><td rowspan=1 colspan=1>97.64%</td><td rowspan=1 colspan=1>97.62%</td></tr><tr><td rowspan=1 colspan=1>ATA (Main Branch)</td><td rowspan=1 colspan=1>1.32%</td><td rowspan=1 colspan=1>96.70%</td><td rowspan=1 colspan=1>96.30%</td><td rowspan=1 colspan=1>96.43%</td></tr><tr><td rowspan=1 colspan=1>ATA (Average)</td><td rowspan=1 colspan=1>2.61%</td><td rowspan=1 colspan=1>61.35%</td><td rowspan=1 colspan=1>97.37%</td><td rowspan=1 colspan=1>97.42%</td></tr><tr><td rowspan=1 colspan=1>ATA (Max-Average)</td><td rowspan=1 colspan=1>2.10%</td><td rowspan=1 colspan=1>61.83%</td><td rowspan=1 colspan=1>96.82%</td><td rowspan=1 colspan=1>96.89%</td></tr><tr><td rowspan=1 colspan=1>ATA (Worst-Case)</td><td rowspan=1 colspan=1>1.32%</td><td rowspan=1 colspan=1>60.50%</td><td rowspan=1 colspan=1>96.30%</td><td rowspan=1 colspan=1>96.43%</td></tr><tr><td rowspan=1 colspan=1>Average MFlops</td><td rowspan=1 colspan=1>5.89</td><td rowspan=1 colspan=1>5.89</td><td rowspan=1 colspan=1>5.95</td><td rowspan=1 colspan=1>6.08</td></tr><tr><td rowspan=1 colspan=1>Computation Saving</td><td rowspan=1 colspan=1>36.40%</td><td rowspan=1 colspan=1>36.40%</td><td rowspan=1 colspan=1>35.70%</td><td rowspan=1 colspan=1>34.30%</td></tr></table>
|
| 145 |
+
|
| 146 |
+
CIFAR-10 Experiments The results on RDI-ResNet38 and RDI-MobileNetV2 are presented in Tables 3 and 4, respectively. Most findings seem to concur with MNIST experiments. Specifically, on the more complicated CIFAR-10 classification task, Max-Average defense achieves much more obvious margins over Average defense, in terms of ATA (Worst-Case): $2 . 7 9 \%$ for RDI-ResNet38, and $1 . 0 6 \%$ for RDI-MobileNetV2. Interestingly, the Average defense is not even the strongest in defending average attacks, as Max-Average defense can achieve higher ATA (Average) in both cases. We conjecture that averaging all branch losses might “over-smooth” and diminish useful gradients.
|
| 147 |
+
|
| 148 |
+
Compared to the defended ResNet-38 and MobileNet-V2 backbones, RDI-Nets with Max-Average defense achieve higher TAs and ATAs for both. Especially, the ATA (Worst-Case) of RDI-ResNet38 surpasses the ATA of ResNet-38 defended by PGD-adversarial training by $1 . 0 3 \%$ , while saving around $30 \%$ inference budget. We find that different defenses on CIFAR-10 have more notable impacts on computational saving. Seemingly, a stronger defense (Max-Average) requires inputs to go through the scrutiny of more layers on average, before outputting confident enough predictions: a sensible observation as we expect.
|
| 149 |
+
|
| 150 |
+
Visualization of Adaptive Inference Behaviors We visualize the exiting behaviors of RDIResNet38 in Fig 4.2. We plot each branch exiting percentage on clean set and adversarial sets (worst-case) of examples. A few interesting observations can be found. First, we observe that the single-attack defended model can be easily fooled as adversarial examples can be routed through other less-defended outputs (due to the limited transferability of attacks between different outputs). Second, the two stronger defenses (Average and Max-Average) show much more uniform usage of multiple outputs. Their routing behaviors for clean examples are almost identical. For adversarial examples, Max-Average tends to call upon the full inference more often (i.e., more “conservative”).
|
| 151 |
+
|
| 152 |
+
Table 3: The performance evaluation on RDI-ResNet38. The perturbation size and step size are 8/255 and 2/255, respectively.
|
| 153 |
+
|
| 154 |
+
<table><tr><td rowspan=1 colspan=1>Defence Method</td><td rowspan=1 colspan=1>Standard</td><td rowspan=1 colspan=1>Main Branch</td><td rowspan=1 colspan=1>Average</td><td rowspan=1 colspan=1>Max-Average</td></tr><tr><td rowspan=1 colspan=1>TA</td><td rowspan=1 colspan=1>92.43%</td><td rowspan=1 colspan=1>83.74%</td><td rowspan=1 colspan=1>82.42%</td><td rowspan=1 colspan=1>83.79%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch1)</td><td rowspan=1 colspan=1>0.12%</td><td rowspan=1 colspan=1>12.02%</td><td rowspan=1 colspan=1>71.56%</td><td rowspan=1 colspan=1>69.71%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch2)</td><td rowspan=1 colspan=1>0.01%</td><td rowspan=1 colspan=1>5.58%</td><td rowspan=1 colspan=1>66.67%</td><td rowspan=1 colspan=1>63.11%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch3)</td><td rowspan=1 colspan=1>0.04%</td><td rowspan=1 colspan=1>42.73%</td><td rowspan=1 colspan=1>60.65%</td><td rowspan=1 colspan=1>60.72%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch4)</td><td rowspan=1 colspan=1>0.06%</td><td rowspan=1 colspan=1>34.95%</td><td rowspan=1 colspan=1>50.17%</td><td rowspan=1 colspan=1>47.82%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch5)</td><td rowspan=1 colspan=1>0.06%</td><td rowspan=1 colspan=1>41.77%</td><td rowspan=1 colspan=1>44.83%</td><td rowspan=1 colspan=1>45.53%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch6)</td><td rowspan=1 colspan=1>0.11%</td><td rowspan=1 colspan=1>41.68%</td><td rowspan=1 colspan=1>45.83%</td><td rowspan=1 colspan=1>44.12%</td></tr><tr><td rowspan=1 colspan=1>ATA (Main Branch)</td><td rowspan=1 colspan=1>0.13%</td><td rowspan=1 colspan=1>42.74%</td><td rowspan=1 colspan=1>47.52%</td><td rowspan=1 colspan=1>49.82%</td></tr><tr><td rowspan=1 colspan=1>ATA (Average)</td><td rowspan=1 colspan=1>0.01%</td><td rowspan=1 colspan=1>9.14%</td><td rowspan=1 colspan=1>42.09%</td><td rowspan=1 colspan=1>43.32%</td></tr><tr><td rowspan=1 colspan=1>ATA (Max-Average)</td><td rowspan=1 colspan=1>0.01%</td><td rowspan=1 colspan=1>7.15%</td><td rowspan=1 colspan=1>40.53%</td><td rowspan=1 colspan=1>43.43%</td></tr><tr><td rowspan=1 colspan=1>ATA (Worst-Case)</td><td rowspan=1 colspan=1>0.01%</td><td rowspan=1 colspan=1>5.58%</td><td rowspan=1 colspan=1>40.53%</td><td rowspan=1 colspan=1>43.32%</td></tr><tr><td rowspan=1 colspan=1>Average MFlops</td><td rowspan=1 colspan=1>29.41</td><td rowspan=1 colspan=1>48.27</td><td rowspan=1 colspan=1>56.90</td><td rowspan=1 colspan=1>57.81</td></tr><tr><td rowspan=1 colspan=1>Computation Saving</td><td rowspan=1 colspan=1>62.96%</td><td rowspan=1 colspan=1>39.20%</td><td rowspan=1 colspan=1>28.35%</td><td rowspan=1 colspan=1>27.20%</td></tr></table>
|
| 155 |
+
|
| 156 |
+
Table 4: The performance evaluation on RDI-MobilenetV2. The perturbation size and step size are 8/255 and 2/255, respectively.
|
| 157 |
+
|
| 158 |
+
<table><tr><td rowspan=1 colspan=1>Defence Method</td><td rowspan=1 colspan=1>Standard</td><td rowspan=1 colspan=1>Main Branch</td><td rowspan=1 colspan=1>Average</td><td rowspan=1 colspan=1>Max-Average</td></tr><tr><td rowspan=1 colspan=1>TA</td><td rowspan=1 colspan=1>93.22%</td><td rowspan=1 colspan=1>85.28%</td><td rowspan=1 colspan=1>82.14%</td><td rowspan=1 colspan=1>84.91%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch1)</td><td rowspan=1 colspan=1>0.35%</td><td rowspan=1 colspan=1>37.40%</td><td rowspan=1 colspan=1>67.65%</td><td rowspan=1 colspan=1>71.78%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch2)</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>47.35%</td><td rowspan=1 colspan=1>50.38%</td><td rowspan=1 colspan=1>50.15%</td></tr><tr><td rowspan=1 colspan=1>ATA (Main Branch)</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>46.69%</td><td rowspan=1 colspan=1>49.33%</td><td rowspan=1 colspan=1>46.99%</td></tr><tr><td rowspan=1 colspan=1>ATA (Average)</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>35.20%</td><td rowspan=1 colspan=1>45.93%</td><td rowspan=1 colspan=1>47.00%</td></tr><tr><td rowspan=1 colspan=1>ATA (Max-Average)</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>36.66%</td><td rowspan=1 colspan=1>49.33%</td><td rowspan=1 colspan=1>50.18%</td></tr><tr><td rowspan=1 colspan=1>ATA (Worst-Case)</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>35.20%</td><td rowspan=1 colspan=1>45.93%</td><td rowspan=1 colspan=1>46.99%</td></tr><tr><td rowspan=1 colspan=1>Average MFlops</td><td rowspan=1 colspan=1>49.78</td><td rowspan=1 colspan=1>52.81</td><td rowspan=1 colspan=1>58.23</td><td rowspan=1 colspan=1>60.84</td></tr><tr><td rowspan=1 colspan=1>Computation Saving</td><td rowspan=1 colspan=1>42.72%</td><td rowspan=1 colspan=1>39.23%</td><td rowspan=1 colspan=1>33.00%</td><td rowspan=1 colspan=1>29.99%</td></tr></table>
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 2: The exiting behaviours of RDI-ResNet38 defended by (a) Single attack defense (Main Branch); (b) Average defense; and (c) Max-Average defense.
|
| 162 |
+
|
| 163 |
+
# 4.3 COMPARISON WITH DEFENDED SPARSE NETWORKS
|
| 164 |
+
|
| 165 |
+
An alternative to achieve accuracy-robust-efficiency trade-off is by defending a sparse or compressed model. Inspired by (Guo et al., 2018; Gui et al., 2019), we compare RDI-Net with Max-Average defense to the following baseline: first compressing the network with a state-of-the-art model compression method (Huang & Wang, 2018), and then defend the compressed network using the PGD-10 adversarial training. We sample different sparsity ratios in (Huang & Wang, 2018) to obtain models of different complexities. Fig. 6 in Appendix visualizes the comparison on ResNet-38: for either method, we sample a few models of different MFLOPs. At similar inference costs (e.g., 49.38M for pruning $^ +$ defense, and 48.35M for RDI-Nets), our proposed approach consistently achieves higher ATAs $( > 2 \% )$ ) than the strong pruning $^ +$ defense baseline, with higher TAs.
|
| 166 |
+
|
| 167 |
+
We also compare with the latest ATMC algorithm (Gui et al., 2019) that jointly optimizes robustness and efficiency, applied the same ResNet-38 backbone. As shown in Table 5, at comparable MFlops, RDI-ResNet-38 surpasses ATMC by $0 . 3 \%$ in terms of ATA, with a similar TA.
|
| 168 |
+
|
| 169 |
+
Table 5: Performance comparison between RDIResNet38 and ATMC.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Methods</td><td>TA</td><td>ATA</td><td>MFlops</td></tr><tr><td>ATMC (Gui et al. (2019))</td><td>83.81</td><td>43.02</td><td>56.82</td></tr><tr><td>RDI-ResNet-38(Worst-Case)</td><td>83.79</td><td>43.32</td><td>57.81</td></tr></table>
|
| 172 |
+
|
| 173 |
+
# 4.4 GENERALIZED ROBUSTNESS AGAINST OTHER ATTACKERS
|
| 174 |
+
|
| 175 |
+
In the aforementioned experiments, we have only evaluated on RDI-Nets against “deterministic” PGD-based adversarial images. We show that RDI-Nets also achieve better generalized robustness against other “randomized” or unseen attackers. We create the new “random attack”: that attack will randomly combine the multi-exit losses, and summarize the results in Table 6. We also follow the similar setting in Gui et al. (2019) and report the results against FGSM (Goodfellow et al., 2015) and WRM (Sinha et al., 2018) attacker, in Tables 7 and 8 respectively (more complete results can be found in Appendix D).
|
| 176 |
+
|
| 177 |
+
Table 6: Performance on RDI-ResNet38 against random attack. The perturbation size and step size are 8/255 and 2/255, respectively. More details of random attack can be referenced in Appendix D.
|
| 178 |
+
|
| 179 |
+
<table><tr><td rowspan=1 colspan=1>Defence Method</td><td rowspan=1 colspan=1>Standard</td><td rowspan=1 colspan=1>Main Branch</td><td rowspan=1 colspan=1>Average</td><td rowspan=1 colspan=1>Max-Average</td></tr><tr><td rowspan=1 colspan=1>TA</td><td rowspan=1 colspan=1>92.43%</td><td rowspan=1 colspan=1>83.74%</td><td rowspan=1 colspan=1>82.42%</td><td rowspan=1 colspan=1>83.79%</td></tr><tr><td rowspan=1 colspan=1>ATA (Random)</td><td rowspan=1 colspan=1>0.01%</td><td rowspan=1 colspan=1>10.33%</td><td rowspan=1 colspan=1>43.11%</td><td rowspan=1 colspan=1>44.86%</td></tr><tr><td rowspan=1 colspan=1>Average MFlops</td><td rowspan=1 colspan=1>27.33</td><td rowspan=1 colspan=1>52.36</td><td rowspan=1 colspan=1>55.21</td><td rowspan=1 colspan=1>56.54</td></tr><tr><td rowspan=1 colspan=1>Computation Saving</td><td rowspan=1 colspan=1>65.58%</td><td rowspan=1 colspan=1>34.07%</td><td rowspan=1 colspan=1>30.48%</td><td rowspan=1 colspan=1>28.80%</td></tr></table>
|
| 180 |
+
|
| 181 |
+
Table 7: Performance on RDI-ResNet38 (defended with PGD) against FGSM attack (perturbation size is 8/255). The original defended ResNet38 by PGD under the same attack has ATA $5 1 . 1 1 \%$ .
|
| 182 |
+
|
| 183 |
+
<table><tr><td rowspan=1 colspan=1>Defence Method</td><td rowspan=1 colspan=1>Standard</td><td rowspan=1 colspan=1>Main Branch</td><td rowspan=1 colspan=1>Average</td><td rowspan=1 colspan=1>Max-Average</td></tr><tr><td rowspan=1 colspan=1>TA</td><td rowspan=1 colspan=1>92.43%</td><td rowspan=1 colspan=1>83.74%</td><td rowspan=1 colspan=1>82.42%</td><td rowspan=1 colspan=1>83.79%</td></tr><tr><td rowspan=1 colspan=1>ATA (Main Branch)</td><td rowspan=1 colspan=1>11.51%</td><td rowspan=1 colspan=1>51.45%</td><td rowspan=1 colspan=1>53.64%</td><td rowspan=1 colspan=1>54.72%</td></tr><tr><td rowspan=1 colspan=1>ATA (Average)</td><td rowspan=1 colspan=1>11.41%</td><td rowspan=1 colspan=1>50.21%</td><td rowspan=1 colspan=1>51.81%</td><td rowspan=1 colspan=1>53.20%</td></tr><tr><td rowspan=1 colspan=1>ATA (Max-Average)</td><td rowspan=1 colspan=1>2.09%</td><td rowspan=1 colspan=1>47.53%</td><td rowspan=1 colspan=1>50.63%</td><td rowspan=1 colspan=1>52.40%</td></tr><tr><td rowspan=1 colspan=1>ATA (Worst-Case)</td><td rowspan=1 colspan=1>2.09%</td><td rowspan=1 colspan=1>47.53%</td><td rowspan=1 colspan=1>50.63%</td><td rowspan=1 colspan=1>51.05%</td></tr><tr><td rowspan=1 colspan=1>Average MFlops</td><td rowspan=1 colspan=1>65.74</td><td rowspan=1 colspan=1>55.27</td><td rowspan=1 colspan=1>58.27</td><td rowspan=1 colspan=1>59.67</td></tr><tr><td rowspan=1 colspan=1>Computation Saving</td><td rowspan=1 colspan=1>17.21%</td><td rowspan=1 colspan=1>30.40%</td><td rowspan=1 colspan=1>26.40%</td><td rowspan=1 colspan=1>24.86%</td></tr></table>
|
| 184 |
+
|
| 185 |
+
Table 8: Performance on RDI-ResNet38 (defended with PGD) against WRM attack (perturbation size is 0.3). The original defended ResNet38 by PGD under the same attack has ATA $8 3 . 3 5 \%$ .
|
| 186 |
+
|
| 187 |
+
<table><tr><td rowspan=1 colspan=1>Defence Method</td><td rowspan=1 colspan=1>Standard</td><td rowspan=1 colspan=1>Main Branch</td><td rowspan=1 colspan=1>Average</td><td rowspan=1 colspan=1>Max-Average</td></tr><tr><td rowspan=1 colspan=1>TA</td><td rowspan=1 colspan=1>92.43%</td><td rowspan=1 colspan=1>83.74%</td><td rowspan=1 colspan=1>82.42%</td><td rowspan=1 colspan=1>83.79%</td></tr><tr><td rowspan=1 colspan=1>ATA (Main Branch)</td><td rowspan=1 colspan=1>34.42%</td><td rowspan=1 colspan=1>83.74%</td><td rowspan=1 colspan=1>82.42%</td><td rowspan=1 colspan=1>83.78%</td></tr><tr><td rowspan=1 colspan=1>ATA (Average)</td><td rowspan=1 colspan=1>26.48%</td><td rowspan=1 colspan=1>83.69%</td><td rowspan=1 colspan=1>82.36%</td><td rowspan=1 colspan=1>83.77%</td></tr><tr><td rowspan=1 colspan=1>ATA (Max-Average)</td><td rowspan=1 colspan=1>23.51%</td><td rowspan=1 colspan=1>83.73%</td><td rowspan=1 colspan=1>82.40%</td><td rowspan=1 colspan=1>83.78%</td></tr><tr><td rowspan=1 colspan=1>ATA (Worst-Case)</td><td rowspan=1 colspan=1>23.51%</td><td rowspan=1 colspan=1>83.69%</td><td rowspan=1 colspan=1>82.36%</td><td rowspan=1 colspan=1>83.77%</td></tr><tr><td rowspan=1 colspan=1>Average MFlops</td><td rowspan=1 colspan=1>50.05</td><td rowspan=1 colspan=1>50.46</td><td rowspan=1 colspan=1>52.89</td><td rowspan=1 colspan=1>52.38</td></tr><tr><td rowspan=1 colspan=1>Computation Saving</td><td rowspan=1 colspan=1>36.98%</td><td rowspan=1 colspan=1>36.46%</td><td rowspan=1 colspan=1>33.40%</td><td rowspan=1 colspan=1>34.04%</td></tr></table>
|
| 188 |
+
|
| 189 |
+
# 5 DISCUSSION AND ANALYSIS
|
| 190 |
+
|
| 191 |
+
Intuition: Multi-Output Networks as Special Ensembles Our intuition on defending multioutput networks arises from the success of ensemble defense in improving both accuracy and robustness (Tramer et al. \` , 2018; Strauss et al., 2017), which also aligns with the model capacity hypothesis (Nakkiran, 2019). A general multi-output network (Xu et al., 2019) could be decomposed by an ensemble of single-output models, with weight re-using enforced among them. It is thus more compact than an ensemble of independent models, and the extent of sharing weight calibrates ensemble diversity versus efficiency. Therefore, we expect a defended multi-output network to (mostly) inherit the strong accuracy/robustness of ensemble defense, while keeping the inference cost lower.
|
| 192 |
+
|
| 193 |
+
Do ”Triple Wins” Go Against the Model Capacity Needs? We point out that our seemingly “free” efficiency gains (e.g., not sacrificing TA/ATA) do not go against the current belief that a more accurate and robust classifier relies on a larger model capacity (Nakkiran, 2019). From the visualization, there remains to be a portion of clean/adversarial examples that have to utilize the full inference to predict well. In other words, the full model capacity is still necessary to achieve our current TAs/ATAs. Meanwhile, just like in standard classification (Wang et al., 2018a), not all adversarial examples are born equally. Many of them can be predicted using fewer inference costs (taking earlier exits). Therefore, RDI-Nets reduces the “effective model capacity” averaged on all testing samples for overall higher inference efficiency, while not altering the full model capacity.
|
| 194 |
+
|
| 195 |
+
# 6 CONCLUSION
|
| 196 |
+
|
| 197 |
+
This paper targets to simultaneously achieve high accuracy and robustness and meanwhile keeping inference costs lower. We introduce the multi-output network and input-adaptive dynamic inference, as a strong tool to the adversarial defense field for the first time. Our RDI-Nets achieve the “triple wins” of better accuracy, stronger robustness, and around $30 \%$ inference computational savings. Our future work will extend RDI-Nets to more dynamic inference mechanisms.
|
| 198 |
+
|
| 199 |
+
# 7 ACKNOWLEDGEMENT
|
| 200 |
+
|
| 201 |
+
We would like to thank Dr. Yang Yang from Walmart Technology for highly helpful discussions throughout this project.
|
| 202 |
+
|
| 203 |
+
# REFERENCES
|
| 204 |
+
|
| 205 |
+
Shumeet Baluja and Ian Fischer. Adversarial transformation networks: Learning to generate adversarial examples. In AAAI, 2018.
|
| 206 |
+
|
| 207 |
+
Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Srndi ˇ c, Pavel Laskov, Gior- ´ gio Giacinto, and Fabio Roli. Evasion attacks against machine learning at test time. In ECML, 2013.
|
| 208 |
+
|
| 209 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In $S P$ , 2017.
|
| 210 |
+
|
| 211 |
+
Tian Qi Chen, Yulia Rubanova, Jesse Bettencourt, and David Duvenaud. Neural ordinary differential equations. In NeurIPS, 2018.
|
| 212 |
+
|
| 213 |
+
Jeremy M Cohen, Elan Rosenfeld, and J Zico Kolter. Certified adversarial robustness via randomized smoothing. In ICML, 2019.
|
| 214 |
+
|
| 215 |
+
Michael Figurnov, Maxwell D Collins, Yukun Zhu, Li Zhang, Jonathan Huang, Dmitry Vetrov, and Ruslan Salakhutdinov. Spatially adaptive computation time for residual networks. In CVPR, 2017.
|
| 216 |
+
|
| 217 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2015.
|
| 218 |
+
|
| 219 |
+
Shupeng Gui, Haotao Wang, Haichuan Yang, Chen Yu, Zhangyang Wang, and Ji Liu. Model compression with adversarial robustness: A unified optimization framework. In NeurIPS, pp. 1283– 1294, 2019.
|
| 220 |
+
|
| 221 |
+
Yiwen Guo, Chao Zhang, Changshui Zhang, and Yurong Chen. Sparse dnns with improved adversarial robustness. In NeurIPS, 2018.
|
| 222 |
+
|
| 223 |
+
Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In NeurIPS, 2015.
|
| 224 |
+
|
| 225 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 226 |
+
|
| 227 |
+
Hanzhang Hu, Debadeepta Dey, J. Andrew Bagnell, and Martial Hebert. Anytime neural networks via joint optimization of auxiliary losses. In AAAI, 2019.
|
| 228 |
+
|
| 229 |
+
Gao Huang, Danlu Chen, Tianhong Li, Felix Wu, Laurens van der Maaten, and Kilian Weinberger. Multi-scale dense networks for resource efficient image classification. In ICLR, 2018.
|
| 230 |
+
|
| 231 |
+
Zehao Huang and Naiyan Wang. Data-driven sparse structure selection for deep neural networks. In ECCV, 2018.
|
| 232 |
+
|
| 233 |
+
Yigitcan Kaya, Sanghyun Hong, and Tudor Dumitras. Shallow-deep networks: Understanding and mitigating network overthinking. In ICML, 2019.
|
| 234 |
+
|
| 235 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. In ICLR, 2017.
|
| 236 |
+
|
| 237 |
+
Fangzhou Liao, Ming Liang, Yinpeng Dong, Tianyu Pang, Xiaolin Hu, and Jun Zhu. Defense against adversarial attacks using high-level representation guided denoiser. In CVPR, 2018.
|
| 238 |
+
|
| 239 |
+
Ji Lin, Chuang Gan, and Song Han. Defensive quantization: When efficiency meets robustness. In ICLR, 2019.
|
| 240 |
+
|
| 241 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In ICLR, 2018.
|
| 242 |
+
|
| 243 |
+
Preetum Nakkiran. Adversarial robustness may be at odds with simplicity. arXiv, 2019.
|
| 244 |
+
|
| 245 |
+
Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z Berkay Celik, and Ananthram Swami. The limitations of deep learning in adversarial settings. In EuroS&P, 2016.
|
| 246 |
+
|
| 247 |
+
Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In CVPR, 2018.
|
| 248 |
+
|
| 249 |
+
Ludwig Schmidt, Shibani Santurkar, Dimitris Tsipras, Kunal Talwar, and Aleksander Madry. Adversarially robust generalization requires more data. In NeurIPS, 2018.
|
| 250 |
+
|
| 251 |
+
Aman Sinha, Hongseok Namkoong, and John Duchi. Certifying Some Distributional Robustness with Principled Adversarial Training. In ICLR, 2018.
|
| 252 |
+
|
| 253 |
+
Yang Song, Taesup Kim, Sebastian Nowozin, Stefano Ermon, and Nate Kushman. Pixeldefend: Leveraging generative models to understand and defend against adversarial examples. In ICLR, 2018.
|
| 254 |
+
|
| 255 |
+
Thilo Strauss, Markus Hanselmann, Andrej Junginger, and Holger Ulmer. Ensemble methods as a defense to adversarial perturbations against deep neural networks. arXiv, 2017.
|
| 256 |
+
|
| 257 |
+
Ke Sun, Zhanxing Zhu, and Zhouchen Lin. Towards understanding adversarial examples systematically: Exploring data size, task and model factors. arXiv, 2019.
|
| 258 |
+
|
| 259 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In ICLR, 2014.
|
| 260 |
+
|
| 261 |
+
Cheng Tai, Tong Xiao, Yi Zhang, Xiaogang Wang, et al. Convolutional neural networks with lowrank regularization. In ICLR, 2016.
|
| 262 |
+
|
| 263 |
+
Surat Teerapittayanon, Bradley McDanel, and H. T. Kung. Branchynet: Fast inference via early exiting from deep neural networks. In ICPR, 2017.
|
| 264 |
+
|
| 265 |
+
Florian Tramer, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick Mc-\` Daniel. Ensemble adversarial training: Attacks and defenses. In ICLR, 2018.
|
| 266 |
+
|
| 267 |
+
Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness may be at odds with accuracy. In ICLR, 2019.
|
| 268 |
+
|
| 269 |
+
Xin Wang, Fisher Yu, Zi-Yi Dou, and Joseph E Gonzalez. Skipnet: Learning dynamic routing in convolutional networks. In ECCV, 2018a.
|
| 270 |
+
|
| 271 |
+
Yue Wang, Tan Nguyen, Yang Zhao, Zhangyang Wang, Yingyan Lin, and Richard Baraniuk. Energynet: Energy-efficient dynamic inference. 2018b.
|
| 272 |
+
|
| 273 |
+
Yue Wang, Jianghao Shen, Ting-Kuei Hu, Pengfei Xu, Tan Nguyen, Richard Baraniuk, Zhangyang Wang, and Yingyan Lin. Dual dynamic inference: Enabling more efficient, adaptive and controllable deep inference. arXiv preprint arXiv:1907.04523, 2019.
|
| 274 |
+
|
| 275 |
+
Yunhe Wang, Chang Xu, Chao Xu, and Dacheng Tao. Adversarial learning of portable student networks. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018c.
|
| 276 |
+
|
| 277 |
+
Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In NeurIPS, 2016.
|
| 278 |
+
|
| 279 |
+
Jiaxiang Wu, Cong Leng, Yuhang Wang, Qinghao Hu, and Jian Cheng. Quantized convolutional neural networks for mobile devices. In CVPR, 2016.
|
| 280 |
+
|
| 281 |
+
Junru Wu, Yue Wang, Zhenyu Wu, Zhangyang Wang, Ashok Veeraraghavan, and Yingyan Lin. Deep $k$ -means: Re-training and parameter sharing with harder cluster assignments for compressing deep convolutions. In ICML, 2018.
|
| 282 |
+
|
| 283 |
+
Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, and Alan Yuille. Mitigating adversarial effects through randomization. In ICLR, 2018.
|
| 284 |
+
|
| 285 |
+
Donna Xu, Yaxin Shi, Ivor W Tsang, Yew-Soon Ong, Chen Gong, and Xiaobo Shen. A survey on multi-output learning. arXiv, 2019.
|
| 286 |
+
|
| 287 |
+
Weilin Xu, David Evans, and Yanjun Qi. Feature squeezing: Detecting adversarial examples in deep neural networks. In NDSS, 2018.
|
| 288 |
+
|
| 289 |
+
Shaokai Ye, Kaidi Xu, Sijia Liu, Hao Cheng, Jan-Henrik Lambrechts, Huan Zhang, Aojun Zhou, Kaisheng Ma, Yanzhi Wang, and Xue Lin. Adversarial robustness vs model compression, or both? In ICCV, 2019.
|
| 290 |
+
|
| 291 |
+
Xiyu Yu, Tongliang Liu, Xinchao Wang, and Dacheng Tao. On compressing deep models by low rank and sparse decomposition. In CVPR, 2017.
|
| 292 |
+
|
| 293 |
+
Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric P Xing, Laurent El Ghaoui, and Michael I Jordan. Theoretically principled trade-off between robustness and accuracy. arXiv, 2019.
|
| 294 |
+
|
| 295 |
+
Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In CVPR, 2018.
|
| 296 |
+
|
| 297 |
+
# A LEARNING DETAILS OF RDI-NETS
|
| 298 |
+
|
| 299 |
+
MNIST We adopt the network architecture from (Chen et al., 2018) with four convolutions and three full-connected layers. We train for 13100 iterations with a batch size of 256. The learning rate is initialized as 0.033 and is lowered by 10 at 12000th and 12900th iteration. For hybrid loss, the weights $\{ w _ { i } \} _ { i = 1 } ^ { N + 1 }$ are set as $\{ 1 , 1 , 1 \}$ for simplicity. For adversarial defense/attack, we perform 40-steps PGD for both defense and evaluation. The perturbation size and step size are set as 0.3 and 0.01.
|
| 300 |
+
|
| 301 |
+
CIFAR-10 We take ResNet-38 and MobileNetV2 as the backbone architectures. For RDIResNet38, we initialize learning rate as 0.1 and decay it by a factor of 10 at 32000th and 48000th iteration. The learning procedure stops at 55000 iteration. For RDI-MobileNetV2, the learning rate is set to 0.05 and is lowered by 10 times at 62000th and 70000th iteration. We stop the learn$\{ w _ { i } \} _ { i = 1 } ^ { N + 1 }$ 76000 iteration. For hybrid loss, we follow tof RDI-ResNet38 and RDI-MobileNetV2 as ectively. For adversarial defense/attack, the $\{ 0 . 5 , 0 . 5 , 0 . 7 , 0 . 7 , 0 . 9 , 0 . 9 , 2 \}$ 019)and are $\{ 0 . 5 , 0 . 5 , 1 \}$
|
| 302 |
+
set as $8 / 2 5 5$ and 2/255. 10-steps PGD is performed for defense and 20-steps PGD is utilized for evaluation.
|
| 303 |
+
|
| 304 |
+
# B NETWORK STRUCTURE OF RDI-NETS
|
| 305 |
+
|
| 306 |
+
To build RDI-Nets, we follow the similar setting in Teerapittayanon et al. (2017) by appending additional branch classifiers at equidistant points throughout a given network, as illustrated in Fig 3, Fig 4 and Fig 5. A few pooling operations, light-weight convolutions and fully-connected layers are appended to each branch classifiers. Note that the extra flops introduced by side branch classifiers are less than $2 \%$ than the original ResNet-38 or MobileNetV2.
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Figure 3: Network architecture of RDI-SmallCNN. Two branch classifiers are inserted after 1st convolutional layer and 3rd convolutional layer in the original SmallCNN.
|
| 310 |
+
|
| 311 |
+

|
| 312 |
+
Figure 4: Network architecture of RDI-ResNet38. In each residual block group, two branch classifiers are inserted after $1 { s t }$ residual block and 4th residual block.
|
| 313 |
+
|
| 314 |
+
# C INPUT-ADAPTIVE INFERENCE FOR RDI-NETS
|
| 315 |
+
|
| 316 |
+
Similar to the deterministic strategy in Teerapittayanon et al. (2017), we adopt the entropy as the measure of the prediction confidence. Given a prediction vector $y \in \mathbb { R } ^ { C }$ , where $C$ is the number of
|
| 317 |
+
|
| 318 |
+

|
| 319 |
+
Figure 5: Network architecture of RDI-MobilenetV2. Two branch classfiers are inserted after 3rd inverted residual block and 11th inverted residual block in the orignal MobilenetV2.
|
| 320 |
+
|
| 321 |
+
class, the entropy of $y$ is defined as follow,
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
- \sum _ { c = 1 } ^ { C } ( y _ { c } + \epsilon ) l o g ( y _ { c } + \epsilon ) ,
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
where $\epsilon$ is a small positive constant used for robust entropy computation. To perform fast inference on a $( K { + } 1 )$ -output RDI-Net, we need to determine $K$ threshold numbers, i.e., $\{ t _ { i } \} _ { i = 1 } ^ { K }$ , so that the input $x$ will exit at ith branch if the entropy of $y _ { i }$ is larger than $t _ { i }$ . To choose $\{ t _ { i } \} _ { i = 1 } ^ { K }$ , Huang et al. (2018) provides a good starting point by fixing exiting probability of each branch classifiers equally on validation set so that each sample can equally contribute to inference. We follow this strategy but adjust the thresholds to make the contribution of middle branches slightly larger than the early branches. The threshold numbers for RDI-SmallCNN, RDI-ResNet38, and RDI-MobilenetV2 are set to be $\{ 0 . 0 2 3 , 0 . 0 1 4 \}$ , $\{ 0 . 3 2 , 0 . 3 6 , 0 . 3 9 , 0 . 8 3 , 1 . 1 2 , 1 . 3 5 \}$ , and $\{ 0 . 2 6 7 , 0 . 7 6 5 \}$ , respectively.
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 6: Performance comparison between RDI-Net and the pruning $^ +$ defense baseline. Each marker represents a model, whose size is proportional to its MFlops. $\gamma$ is the sparsity trade-off parameter: the larger the sparser (smaller model).
|
| 331 |
+
|
| 332 |
+
# D GENERALIZED ROBUSTNESS
|
| 333 |
+
|
| 334 |
+
Here, we introduce the attack form of random attack and report the complete results against FGSM (Goodfellow et al., 2015) and WRM (Sinha et al., 2018) attacker under various attack forms, in Tables 9 and 10, respectively.
|
| 335 |
+
|
| 336 |
+
Random Attack the attack exploits multi-loss flexibility by randomly fusing all $f _ { \theta _ { i } }$ losses. Given a $N$ -output network, we have a fusion vector $C \in \mathbb { R } ^ { N } \sim \mathbf { \bar { \mathbb { D } } }$ , where $\mathbb { D }$ is some distribution (uniform
|
| 337 |
+
|
| 338 |
+
by default). We denote $c _ { j }$ as the $j$ th element of $C$ and $x _ { r d m } ^ { a d v }$ can be found by:
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
x _ { r d m } ^ { a d v } = \underset { x ^ { \prime } \in | x ^ { \prime } - x | _ { \infty } \leq \epsilon } { \arg \operatorname* { m a x } } | \frac { 1 } { N } \sum _ { j = 1 } ^ { N } c _ { j } \phi ( f _ { \theta _ { j } } ( x ^ { \prime } ) , y ) | .
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
It is expected to challenge our defense, due to the infinitely many ways of randomly fusing outputs.
|
| 345 |
+
|
| 346 |
+
Table 9: The performance evaluation on RDI-ResNet38 (defended with PGD) against FGSM attack. The perturbation size is 8/255. The ATA of the original defended ResNet38 by PGD under the same attacker is $5 1 . 1 1 \%$ .
|
| 347 |
+
|
| 348 |
+
<table><tr><td rowspan=1 colspan=1>Defence Method</td><td rowspan=1 colspan=1>Standard</td><td rowspan=1 colspan=1>Main Branch</td><td rowspan=1 colspan=1>Average</td><td rowspan=1 colspan=1>Max-Average</td></tr><tr><td rowspan=1 colspan=1>TA</td><td rowspan=1 colspan=1>92.43%</td><td rowspan=1 colspan=1>83.74%</td><td rowspan=1 colspan=1>82.42%</td><td rowspan=1 colspan=1>83.79%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch1)</td><td rowspan=1 colspan=1>20.69%</td><td rowspan=1 colspan=1>66.06%</td><td rowspan=1 colspan=1>72.77%</td><td rowspan=1 colspan=1>72.76%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch2)</td><td rowspan=1 colspan=1>16.15%</td><td rowspan=1 colspan=1>53.87%</td><td rowspan=1 colspan=1>70.40%</td><td rowspan=1 colspan=1>69.71%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch3)</td><td rowspan=1 colspan=1>8.13%</td><td rowspan=1 colspan=1>63.70%</td><td rowspan=1 colspan=1>64.19%</td><td rowspan=1 colspan=1>65.14%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch4)</td><td rowspan=1 colspan=1>10.09%</td><td rowspan=1 colspan=1>56.67%</td><td rowspan=1 colspan=1>58.45%</td><td rowspan=1 colspan=1>58.20%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch5)</td><td rowspan=1 colspan=1>9.45%</td><td rowspan=1 colspan=1>50.81%</td><td rowspan=1 colspan=1>52.76%</td><td rowspan=1 colspan=1>52.96%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch6)</td><td rowspan=1 colspan=1>10.22%</td><td rowspan=1 colspan=1>50.34%</td><td rowspan=1 colspan=1>53.17%</td><td rowspan=1 colspan=1>51.05%</td></tr><tr><td rowspan=1 colspan=1>ATA (Main Branch)</td><td rowspan=1 colspan=1>11.51%</td><td rowspan=1 colspan=1>51.45%</td><td rowspan=1 colspan=1>53.64%</td><td rowspan=1 colspan=1>54.72%</td></tr><tr><td rowspan=1 colspan=1>ATA (Average)</td><td rowspan=1 colspan=1>11.41%</td><td rowspan=1 colspan=1>50.21%</td><td rowspan=1 colspan=1>51.81%</td><td rowspan=1 colspan=1>53.20%</td></tr><tr><td rowspan=1 colspan=1>ATA (Max-Average)</td><td rowspan=1 colspan=1>2.09%</td><td rowspan=1 colspan=1>47.53%</td><td rowspan=1 colspan=1>50.63%</td><td rowspan=1 colspan=1>52.40%</td></tr><tr><td rowspan=1 colspan=1>ATA (Worst-Case)</td><td rowspan=1 colspan=1>2.09%</td><td rowspan=1 colspan=1>47.53%</td><td rowspan=1 colspan=1>50.63%</td><td rowspan=1 colspan=1>51.05%</td></tr><tr><td rowspan=1 colspan=1>Average MFlops</td><td rowspan=1 colspan=1>65.74</td><td rowspan=1 colspan=1>55.27</td><td rowspan=1 colspan=1>58.27</td><td rowspan=1 colspan=1>59.67</td></tr><tr><td rowspan=1 colspan=1>Computation Saving</td><td rowspan=1 colspan=1>17.21%</td><td rowspan=1 colspan=1>30.40%</td><td rowspan=1 colspan=1>26.40%</td><td rowspan=1 colspan=1>24.86%</td></tr></table>
|
| 349 |
+
|
| 350 |
+
Table 10: The performance evaluation on RDI-ResNet38 (defended with PGD) against WRM attack. The perturbation size is 0.3. The ATA of the original defended ResNet38 by PGD under the same attacker is $8 3 . 3 5 \%$ .
|
| 351 |
+
|
| 352 |
+
<table><tr><td rowspan=1 colspan=1>Defence Method</td><td rowspan=1 colspan=1>Standard</td><td rowspan=1 colspan=1>Main Branch</td><td rowspan=1 colspan=1>Average</td><td rowspan=1 colspan=1>Max-Average</td></tr><tr><td rowspan=1 colspan=1>TA</td><td rowspan=1 colspan=1>92.43%</td><td rowspan=1 colspan=1>83.74%</td><td rowspan=1 colspan=1>82.42%</td><td rowspan=1 colspan=1>83.79%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch1)</td><td rowspan=1 colspan=1>46.60%</td><td rowspan=1 colspan=1>83.73%</td><td rowspan=1 colspan=1>82.42%</td><td rowspan=1 colspan=1>83.78%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch2)</td><td rowspan=1 colspan=1>71.33%</td><td rowspan=1 colspan=1>83.73%</td><td rowspan=1 colspan=1>82.42%</td><td rowspan=1 colspan=1>83.79%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch3)</td><td rowspan=1 colspan=1>23.51%</td><td rowspan=1 colspan=1>83.73%</td><td rowspan=1 colspan=1>82.41%</td><td rowspan=1 colspan=1>83.78%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch4)</td><td rowspan=1 colspan=1>33.41%</td><td rowspan=1 colspan=1>83.73%</td><td rowspan=1 colspan=1>82.42%</td><td rowspan=1 colspan=1>83.78%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch5)</td><td rowspan=1 colspan=1>42.35%</td><td rowspan=1 colspan=1>83.73%</td><td rowspan=1 colspan=1>82.41%</td><td rowspan=1 colspan=1>83.78%</td></tr><tr><td rowspan=1 colspan=1>ATA (Branch6)</td><td rowspan=1 colspan=1>47.77%</td><td rowspan=1 colspan=1>83.74%</td><td rowspan=1 colspan=1>82.40%</td><td rowspan=1 colspan=1>83.78%</td></tr><tr><td rowspan=1 colspan=1>ATA (Main Branch)</td><td rowspan=1 colspan=1>34.42%</td><td rowspan=1 colspan=1>83.74%</td><td rowspan=1 colspan=1>82.42%</td><td rowspan=1 colspan=1>83.78%</td></tr><tr><td rowspan=1 colspan=1>ATA (Average)</td><td rowspan=1 colspan=1>26.48%</td><td rowspan=1 colspan=1>83.69%</td><td rowspan=1 colspan=1>82.36%</td><td rowspan=1 colspan=1>83.77%</td></tr><tr><td rowspan=1 colspan=1>ATA (Max-Average)</td><td rowspan=1 colspan=1>23.51%</td><td rowspan=1 colspan=1>83.73%</td><td rowspan=1 colspan=1>82.40%</td><td rowspan=1 colspan=1>83.78%</td></tr><tr><td rowspan=1 colspan=1>ATA (Worst-Case)</td><td rowspan=1 colspan=1>23.51%</td><td rowspan=1 colspan=1>83.69%</td><td rowspan=1 colspan=1>82.36%</td><td rowspan=1 colspan=1>83.77%</td></tr><tr><td rowspan=1 colspan=1>Average MFlops</td><td rowspan=1 colspan=1>50.05</td><td rowspan=1 colspan=1>50.46</td><td rowspan=1 colspan=1>52.89</td><td rowspan=1 colspan=1>52.38</td></tr><tr><td rowspan=1 colspan=1>Computation Saving</td><td rowspan=1 colspan=1>36.98%</td><td rowspan=1 colspan=1>36.46%</td><td rowspan=1 colspan=1>33.40%</td><td rowspan=1 colspan=1>34.04%</td></tr></table>
|
md/train/rJljdh4KDH/rJljdh4KDH.md
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MULTI-SCALE REPRESENTATION LEARNING FOR SPATIAL FEATURE DISTRIBUTIONS USING GRID CELLS
|
| 2 |
+
|
| 3 |
+
Gengchen Mai1, Krzysztof Janowicz1, Bo Yan2, Rui $\mathbf { Z } \mathbf { h } \mathbf { u } ^ { 1 }$ , Ling Cai1 & Ni Lao3
|
| 4 |
+
1STKO Lab, University of California, Santa Barbara, CA, USA, 93106
|
| 5 |
+
{gengchen_mai,janowicz,ruizhu,lingcai}@ucsb.edu
|
| 6 |
+
2LinkedIn Corporation, Mountain View, CA, USA, 94043
|
| 7 |
+
boyan1@linkedin.com
|
| 8 |
+
3SayMosaic Inc., Palo Alto, CA, USA, 94303
|
| 9 |
+
ni.lao@mosaix.ai
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Unsupervised text encoding models have recently fueled substantial progress in Natural Language Processing (NLP). The key idea is to use neural networks to convert words in texts to vector space representations (embeddings) based on word positions in a sentence and their contexts, which are suitable for end-to-end training of downstream tasks. We see a strikingly similar situation in spatial analysis, which focuses on incorporating both absolute positions and spatial contexts of geographic objects such as Points of Interest (POIs) into models. A general-purpose representation model for space is valuable for a multitude of tasks. However, no such general model exists to date beyond simply applying discretization or feedforward nets to coordinates, and little effort has been put into jointly modeling distributions with vastly different characteristics, which commonly emerges from GIS data. Meanwhile, Nobel Prize-winning Neuroscience research shows that grid cells in mammals provide a multi-scale periodic representation that functions as a metric for location encoding and is critical for recognizing places and for path-integration. Therefore, we propose a representation learning model called Space2Vec to encode the absolute positions and spatial relationships of places. We conduct experiments on two real-world geographic data for two different tasks: 1) predicting types of POIs given their positions and context, 2) image classification leveraging their geo-locations. Results show that because of its multiscale representations, Space2Vec outperforms well-established ML approaches such as RBF kernels, multi-layer feed-forward nets, and tile embedding approaches for location modeling and image classification tasks. Detailed analysis shows that all baselines can at most well handle distribution at one scale but show poor performances in other scales. In contrast, Space2Vec ’s multi-scale representation can handle distributions at different scales.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Unsupervised text encoding models such as Word2Vec (Mikolov et al., 2013), Glove (Pennington et al., 2014), ELMo (Peters et al., 2018), and BERT (Devlin et al., 2018) have been effectively utilized in many Natural Language Processing (NLP) tasks. At their core they train models which encode words into vector space representations based on their positions in the text and their context. A similar situation can be encountered in the field of Geographic Information Science (GIScience). For example, spatial interpolation aims at predicting an attribute value, e.g., elevation, at an unsampled location based on the known attribute values of nearby samples. Geographic information has become an important component to many tasks such as fine-grained image classification (Mac Aodha et al., 2019), point cloud classification and semantic segmentation (Qi et al., 2017), reasoning about Point of Interest (POI) type similarity (Yan et al., 2017), land cover classification (Kussul et al., 2017), and geographic question answering (Mai et al., 2019b). Developing a general model for vector space representation of any point in space would pave the way for many future applications.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: The challenge of joint modeling distributions with very different characteristics. (a)(b) The POI locations (red dots) in Las Vegas and Space2Vec predicted conditional likelihood of Women’s Clothing (with a clustered distribution) and Education (with an even distribution). The dark area in (b) indicates that the downtown area has more POIs of other types than education. (c) Ripley’s K curves of POI types for which Space2Vec has the largest and smallest improvement over wrap (Mac Aodha et al., 2019). Each curve represents the number of POIs of a certain type inside certain radios centered at every POI of that type; (d) Ripley’s K curves renormalized by POI densities and shown in log-scale. To efficiently achieve multi-scale representation Space2Vec concatenates the grid cell encoding of 64 scales (with wave lengths ranging from 50 meters to $4 0 k$ meters) as the first layer of a deep model, and trains with POI data in an unsupervised fashion.
|
| 21 |
+
|
| 22 |
+
However, existing models often utilize specific methods to deal with geographic information and often disregards geographic coordinates. For example, Place2Vec (Yan et al., 2017) converts the coordinates of POIs into spatially collocated POI pairs within certain distance bins, and does not preserve information about the (cardinal) direction between points. Li et al. (2017) propose DCRNN for traffic forecasting in which the traffic sensor network is converted to a distance weighted graph which necessarily forfeits information about the spatial layout of sensors. There is, however, no general representation model beyond simply applying discretization (Berg et al., 2014; Tang et al., 2015) or feed-forward nets (Chu et al., 2019; Mac Aodha et al., 2019) to coordinates.
|
| 23 |
+
|
| 24 |
+
A key challenge in developing a general-purpose representation model for space is how to deal with mixtures of distributions with very different characteristics (see an example in Figure 1), which often emerges in spatial datasets (McKenzie et al., 2015). For example, there are POI types with clustered distributions such as women’s clothing, while there are other POI types with regular distributions such as education. These feature distributions co-exist in the same space, and yet we want a single representation to accommodate all of them in a task such as location-aware image classification (Mac Aodha et al., 2019). Ripley’s K is a spatial analysis method used to describe point patterns over a given area of interest. Figure 1c shows the K plot of several POI types in Las Vegas. One can see that as the radius grows the numbers of POIs increase at different rates for different POI types. In order to see the relative change of density at different scales, we renormalize the curves by each POI type’s density and show it in log scale in Figure 1d. One can see two distinct POI type groups with different distribution patterns with clustered and even distributions. If we want to model the distribution of these POIs by discretizing the study area into tiles, we have to use small grid sizes for women’s clothing while using larger grid sizes for educations because smaller grid sizes lead to over- parameterization of the model and overfitting. In order to jointly describe these distributions and their patterns, we need an encoding method which supports multi-scale representations.
|
| 25 |
+
|
| 26 |
+
Nobel Prize winning Neuroscience research (Abbott & Callaway, 2014) has demonstrated that grid cells in mammals provide a multi-scale periodic representation that functions as a metric for location encoding, which is critical for integrating self-motion. Moreover, Blair et al. (2007) show that the multi-scale periodic representation of grid cells can be simulated by summing three cosine grating functions oriented $6 0 ^ { \circ }$ apart, which may be regarded as a simple Fourier model of the hexagonal lattice. This research inspired us to encode locations with multi-scale periodic representations. Our assumption is that decomposed geographic coordinates helps machine learning models, such as deep neural nets, and multi-scale representations deal with the inefficiency of intrinsically single-scale methods such as RFB kernels or discretization (tile embeddings). To validate this intuition, we propose an encoder-decoder framework to encode the distribution of point-features2 in space and train such a model in an unsupervised manner. This idea of using sinusoid functions with different frequencies to encode positions is similar to the position encoding proposed in the Transformer model (Vaswani et al., 2017). However, the position encoding model of Transformer deals with a discrete 1D space – the positions of words in a sentence – while our model works on higher dimensional continuous spaces such as the surface of earth.
|
| 27 |
+
|
| 28 |
+
# In summary, the contributions of our work are as follows:
|
| 29 |
+
|
| 30 |
+
1. We propose an encoder-decoder encoding framework called Space2Vec using sinusoid functions with different frequencies to model absolute positions and spatial contexts. We also propose a multi-head attention mechanism based on context points. To the best of our knowledge, this is the first attention model that explicitly considers the spatial relationships between the query point and context points.
|
| 31 |
+
2. We conduct experiments on two real world geographic data for two different tasks: 1) predicting types of POIs given their positions and context, 2) image classification leveraging their geo-locations. Space2Vec outperforms well-established encoding methods such as RBF kernels, multi-layer feed-forward nets, and tile embedding approaches for location modeling and image classification.
|
| 32 |
+
3. To understand the advantages of Space2Vec we visualize the firing patterns (response maps) of location models’ encoding layer neurons and show how they handle spatial structures at different scales by integrating multi-scale representations. Furthermore the firing patterns for the spatial context models neurons give insight into how the grid-like cells capture the decreasing distance effect with multi-scale representations.
|
| 33 |
+
|
| 34 |
+
# 2 PROBLEM FORMULATION
|
| 35 |
+
|
| 36 |
+
Distributed representation of point-features in space can be formulated as follows. Given a set of points $\mathcal { P } _ { - } = \left\{ p _ { i } \right\}$ , i.e., Points of Interests (POIs), in $L { \mathrm { - } } \mathbf { D }$ space $( L = 2 , 3$ ) define a function $f _ { \mathcal { P } , \theta } ( \mathbf { x } ) : \mathbb { R } ^ { L } \mathbf { \bar { \mathbb { R } } } ^ { \dot { d } }$ $( L \ll d )$ , which is parameterized by $\theta$ and maps any coordinate $\mathbf { x }$ in space to a vector representation of $d$ dimension. Each point (e.g., a restaurant) $p _ { i } = ( \mathbf { x } _ { i } , \mathbf { v } _ { i } )$ is associated with a location $\mathbf { x } _ { i }$ and attributes $\mathbf { v } _ { i }$ (i.e., POI features such as type, name, capacity, etc.). The function $f _ { \mathcal { P } , \theta } ( \mathbf { x } )$ encodes the probability distribution of point features over space and can give a representation of any point in the space. Attributes (e.g. place types such as Museum) and coordinate of point can be seen as analogies to words and word positions in commonly used word embedding models.
|
| 37 |
+
|
| 38 |
+
# 3 RELATED WORK
|
| 39 |
+
|
| 40 |
+
There has been theoretical research on neural network based path integration/spatial localization models and their relationships with grid cells. Both Cueva & Wei (2018) and Banino et al. (2018) showed that grid-like spatial response patterns emerge in trained networks for navigation tasks which demonstrate that grid cells are critical for vector-based navigation. Moreover, Gao et al. (2019) propose a representational model for grid cells in navigation tasks which has good quality such as magnified local isometry. All these research is focusing on understanding the relationship between the grid-like spatial response patterns and navigation tasks from a theoretical perspective. In contrast, our goal focuses on utilizing these theoretical results on real world data in geoinformatics.
|
| 41 |
+
|
| 42 |
+
Radial Basis Function (RBF) kernel is a well-established approach to generating learning friendly representation from points in space for machine learning algorithms such as SVM classification (Baudat & Anouar, 2001) and regression (Bierens, 1994). However, the representation is example based – i.e., the resultant model uses the positions of training examples as the centers of Gaussian kernel functions (Maz’ya & Schmidt, 1996). In comparison, the grid cell based location encoding relies on sine and cosine functions, and the resultant model is inductive and does not store training examples.
|
| 43 |
+
|
| 44 |
+
Recently the computer vision community shows increasing interests in incorporating geographic information (e.g. coordinate encoding) into neural network architectures for multiple tasks such as image classification (Tang et al., 2015) and fine grained recognition (Berg et al., 2014; Chu et al., 2019; Mac Aodha et al., 2019). Both Berg et al. (2014) and Tang et al. (2015) proposed to discretize the study area into regular grids. To model the geographical prior distribution of the image categories, the grid id is used for GPS encoding instead of the raw coordinates. However, choosing the correct discretization is challenging (Openshaw, 1984; Fotheringham & Wong, 1991), and incorrect choices can significantly affect the final performance (Moat et al., 2018; Lechner et al., 2012). In addition, discretization does not scale well in terms of memory use. To overcome these difficulties, both Chu et al. (2019) and Mac Aodha et al. (2019) advocated the idea of inductive location encoders which directly encode coordinates into a location embedding. However, both of them directly feed the coordinates into a feed-forward neural network (Chu et al., 2019) or residual blocks (Mac Aodha et al., 2019) without any feature decomposition strategy. Our experiments show that this direct encoding approach is insufficient to capture the spatial feature distribution and Space2Vec significantly outperforms them by integrating spatial representations of different scales.
|
| 45 |
+
|
| 46 |
+
# 4 METHOD
|
| 47 |
+
|
| 48 |
+
We solve distributed representation of point-features in space (defined in Section 2) with an encoderdecoder architecture:
|
| 49 |
+
|
| 50 |
+
1. Given a point $p _ { i } = ( \mathbf { x } _ { i } , \mathbf { v } _ { i } )$ a point space encoder $E n c ^ { ( x ) } ( \ v r )$ encodes location $\mathbf { x } _ { i }$ into a location embedding $\mathbf { e } [ \mathbf { x } _ { i } ] \in \mathbb { R } ^ { d ^ { ( x ) } }$ and a point feature encoder $E n c ^ { ( v ) } ( )$ encodes its feature into a feature embedding $\mathbf { e } [ \mathbf { v } _ { i } ] \in \mathbb { R } ^ { d ^ { ( v ) } }$ . $\mathbf { e } = [ \mathbf { e } [ \mathbf { x } _ { i } ] ; \mathbf { e } [ \mathbf { v } _ { i } ] ] \in \mathbb { R } ^ { d }$ is the full representation of point $p _ { i } \in \mathcal { P }$ , where $d = d ^ { ( x ) } + d ^ { ( v ) }$ . $[ ; ]$ represents vector concatenation. In contrast, geographic entities not in $\mathcal { P }$ within the studied space can be represented by their location embedding $\mathbf { e } [ \mathbf { x } _ { j } ]$ since its $\mathbf { v } _ { i }$ is unknown. 2. We developed two types of decoders which can be used independently or jointly. A location decoder $D e c _ { s } ( )$ reconstructs point feature embedding $\mathbf { e } [ \mathbf { v } _ { i } ]$ given location embedding $\mathbf { e } [ \mathbf { x } _ { i } ]$ , and a spatial context decoder $D e c _ { c } ( )$ reconstructs the feature embedding $\mathbf { e } [ \mathbf { v } _ { i } ]$ of point $p _ { i }$ based on the space and feature embeddings $\left\{ \mathbf { e } _ { i 1 } , . . . , \mathbf { e } _ { i j } , . . . , \mathbf { e } _ { i n } \right\}$ of nearest neighboring points $\{ p _ { i 1 } , . . . , p _ { i j } , . . . , p _ { i n } \}$ , where $n$ is a hyper-parameter.
|
| 51 |
+
|
| 52 |
+
# 4.1 ENCODER
|
| 53 |
+
|
| 54 |
+
Point Feature Encoder Each point $p _ { i } = ( \mathbf { x } _ { i } , \mathbf { v } _ { i } )$ in a point set $\mathcal { P }$ is often associated with features such as the air pollution station data associate with some air quality measures, a set of POIs with POI types and names, a set of points from survey and mapping with elevation values, a set of points from geological survey with mineral content measure, and so on. The point feature encoder $E n c ^ { ( v ) } ( )$ encodes such features $\mathbf { v } _ { i }$ into a feature embedding $\mathbf { e } [ \mathbf { v } _ { i } ] \in \mathbb { R } ^ { d ^ { ( v ) } }$ . The implementation of $E n c ^ { ( v ) } ( )$ depends on the nature of these features. For example, if each point represents a POI with multiple POI types (as in this study), the feature embedding $\mathbf { e } [ \mathbf { v } _ { i } ]$ can simply be the mean of each POI types’ embeddings $\mathbf { e } [ \mathbf { v } _ { i } ] = \frac { 1 } { H } \sum _ { h = 1 } ^ { H } \mathbf { t } _ { h } ^ { ( \gamma ) }$ , where $\mathbf { t } _ { h } ^ { \left( \gamma \right) }$ indicates the $h$ th POI type embedding of a POI $p _ { i }$ with $H$ POI types. We apply $L _ { 2 }$ normalization to the POI type embedding matrix.
|
| 55 |
+
|
| 56 |
+
Point Space Encoder A part of the novelty of this paper is from the point space encoder $E n c ^ { ( x ) } ( \ v r )$ . We first introduce Theorem 1 which provide an analytical solution $\phi ( \mathbf { x } )$ as the base of encoding any location $\mathbf { x } \in \mathbb { R } ^ { 2 }$ in 2D space to a distributed representation:
|
| 57 |
+
|
| 58 |
+
Theorem 1. Let $\Psi ( \mathbf { x } ) = ( e ^ { i \langle \mathbf { a } _ { j } , \mathbf { x } \rangle } , j = 1 , 2 , 3 ) ^ { T } \in \mathbb { C } ^ { 3 }$ where $e ^ { i \theta } = \cos \theta + i \sin \theta$ is the Euler notation of complex values; $\langle \mathbf { a } _ { j } , \mathbf { x } \rangle$ is the inner product of ${ \bf a } _ { j }$ and $\mathbf { x } .$ $\mathfrak { c } . \ \mathbf { a } _ { 1 } , \mathbf { a } _ { 2 } , \mathbf { a } _ { 3 } \in \mathbb { R } ^ { 2 }$ are $2 D$ vectors such that the angle between ${ \bf a } _ { k }$ and ${ \bf a } _ { l }$ is $2 \pi / 3 , \forall j$ , $\| \mathbf { a } _ { j } \| = 2 { \sqrt { \alpha } }$ . Let $\mathbf { C } \in \mathbb { C } ^ { 3 \times 3 }$ be a random complex matrix such as $\mathbf { C } ^ { * } \mathbf { C } = \mathbf { I } .$ . Then $\phi ( \mathbf { x } ) = \mathbf { C } \Psi ( \mathbf { x } )$ , $M ( \Delta \mathbf { x } ) = \mathbf { C } d i a g ( \pmb { \Psi } ( \Delta \mathbf { x } ) ) \mathbf { C } ^ { * }$ satisfies
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\phi ( \mathbf { x } + \Delta \mathbf { x } ) = M ( \Delta \mathbf { x } ) \phi ( \mathbf { x } )
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
and
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\langle \phi ( \mathbf { x } + \Delta \mathbf { x } ) , \phi ( \mathbf { x } ) \rangle = d ( 1 - \alpha \| \Delta \mathbf { x } \| ^ { 2 } )
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $d = 3$ is the dimension of $\phi ( \mathbf { x } )$ and $\Delta \mathbf { x }$ is a small displacement from x.
|
| 71 |
+
|
| 72 |
+
The proof of Theorem 1 can be seen in Gao et al. (2019). $\phi ( \mathbf { x } ) = \mathbf { C } \pmb { \Psi } ( \mathbf { x } ) \in \mathbb { C } ^ { 3 }$ amounts to a 6-dimension real value vector and each dimension shows a hexagon firing pattern which models the grid cell behavior. Because of the periodicity of $s i n ( )$ and $c o s ( )$ , this single scale representation $\phi ( \mathbf { x } )$ does not form a global codebook of 2D positions, i.e. there can be $\mathbf x \neq \mathbf y$ , but $\phi ( \mathbf { x } ) = \phi ( \mathbf { y } )$ .
|
| 73 |
+
|
| 74 |
+
Inspired by Theorem 1 and the multi-scale periodic representation of grid cells in mammals (Abbott & Callaway, 2014) we set up our point space encoder $\mathbf { e } [ \mathbf { x } ] \stackrel { - } { = } E n c _ { t h e o r y } ^ { ( x ) } ( \mathbf { x } )$ to use sine and cosine functions of different frequencies to encode positions in space. Given any point $\mathbf { x }$ in the studied 2D space, the space encoder $E n c _ { t h e o r y } ^ { ( x ) } ( \mathbf { x } ) \ = \ \mathbf { N N } ( P E ^ { ( t ) } ( \mathbf { x } ) )$ where $P E ^ { ( t ) } ( \mathbf { x } ) \ =$ $[ P E _ { 0 } ^ { ( t ) } ( { \bf x } ) ; . . . ; P E _ { s } ^ { ( t ) } ( { \bf x } ) ; . . . ; P E _ { S - 1 } ^ { ( t ) } ( { \bf x } ) ]$ is a concatenation of multi-scale representations of $d ^ { ( x ) } =$ $6 S$ dimensions. Here $S$ is the total number of grid scales and $s = 0 , 1 , 2 , . . . , S - 1 . \ \mathbf { N N } ( )$ represents fully connected ReLU layers. Let $\mathbf { a } _ { 1 } = [ 1 , 0 ] ^ { T } , \mathbf { a } _ { 2 } = [ - 1 / 2 , \sqrt { 3 } / 2 ] ^ { T } , \mathbf { a } _ { 3 } = [ - 1 / 2 , - \sqrt { 3 } / 2 ] ^ { T } \in \mathbb { R } ^ { 2 }$ be three unit vectors and the angle between any of them is $2 \pi / 3$ . $\lambda _ { m i n } , \lambda _ { m a x }$ are the minimum and maximum grid scale and $\begin{array} { r } { g = \frac { \lambda _ { m a x } } { \lambda _ { m i n } } } \end{array}$ . At each scale $s , P E _ { s } ^ { ( t ) } ( \mathbf { x } ) = [ P E _ { s , 1 } ^ { ( t ) } ( \mathbf { x } ) ; P E _ { s , 2 } ^ { ( t ) } ( \mathbf { x } ) ; P E _ { s , 3 } ^ { ( t ) } ( \mathbf { x } ) ]$ is a concatenation of three components, where
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
P E _ { s , j } ^ { ( t ) } ( \mathbf { x } ) = [ \cos ( \frac { \langle \mathbf { x } , \mathbf { a } _ { j } \rangle } { \lambda _ { m i n } \cdot g ^ { s / ( S - 1 ) } } ) ; \sin ( \frac { \langle \mathbf { x } , \mathbf { a } _ { j } \rangle } { \lambda _ { m i n } \cdot g ^ { s / ( S - 1 ) } } ) ] \forall j = 1 , 2 , 3 ;
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
$\mathbf { N N } ( )$ and $P E ^ { ( t ) } ( \mathbf { x } )$ are analogies of $\mathbf { C }$ and $\Psi ( \mathbf { x } )$ in Theorem 1.
|
| 81 |
+
|
| 82 |
+
Similarly we can define another space encoder $E n c _ { g r i d } ^ { ( x ) } ( { \bf x } ) ~ = ~ { \bf N N } ( P E ^ { ( g ) } ( { \bf x } ) )$ inspired by the position encoding model of Transformer (Vaswani et al., 2017), where $\begin{array} { r l } { P E ^ { ( g ) } ( \mathbf { x } ) } & { { } = } \end{array}$ $[ { \bar { P E _ { 0 } ^ { ( g ) } } } ( \mathbf { x } ) ; . . . ; { \bar { P E _ { s } ^ { ( g ) } ( \mathbf { x } ) } } ; . . . ; { \bar { P E _ { S - 1 } ^ { ( g ) } ( \mathbf { x } ) } } ]$ is still a concatenation of its multi-scale representations, while $P E _ { s } ^ { ( g ) } ( \mathbf { x } ) = [ P E _ { s , 1 } ^ { ( g ) } ( \mathbf { x } ) ; P E _ { s , 2 } ^ { ( g ) } ( \mathbf { x } ) ]$ handles each component $l$ of $\mathbf { x }$ separately:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
P E _ { s , l } ^ { ( g ) } ( \mathbf { x } ) = [ \cos ( \frac { \mathbf { x } ^ { [ l ] } } { \lambda _ { m i n } \cdot g ^ { s / ( S - 1 ) } } ) ; \sin ( \frac { \mathbf { x } ^ { [ l ] } } { \lambda _ { m i n } \cdot g ^ { s / ( S - 1 ) } } ) ] \forall l = 1 , 2
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
# 4.2 DECODER
|
| 89 |
+
|
| 90 |
+
Two types of decoders are designed for two major types of GIS problems: location modeling and spatial context modeling (See Section 5.1).
|
| 91 |
+
|
| 92 |
+
Location Decoder $D e c _ { s } ( )$ directly reconstructs point feature embedding $\mathbf { e } [ \mathbf { v } _ { i } ]$ given its space embedding $\mathbf { e } [ \mathbf { x } _ { i } ]$ . We use one layer feed-forward neural network $\mathbf { N N } _ { \mathrm { d e c } } ($ q
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\mathbf { e } [ \mathbf { v } _ { i } ] ^ { \prime } = D e c _ { s } ( \mathbf { x } _ { i } ; \theta _ { \mathrm { d e c } _ { s } } ) = \mathbf { N } \mathbf { N } _ { \mathrm { d e c } } ( \mathbf { e } [ \mathbf { x } _ { i } ] )
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
For training we use inner product to compare the reconstructed feature embedding $\mathbf { e } [ \mathbf { v } _ { i } ] ^ { \prime }$ against the real feature embeddings of $\mathbf { e } [ \mathbf { v } _ { i } ]$ and other negative points (see training detail in Sec 4.3).
|
| 99 |
+
|
| 100 |
+
Spatial Context Decoder $D e c _ { c } ( )$ reconstructs the feature embedding $\mathbf { e } [ \mathbf { v } _ { i } ]$ of the center point $p _ { i }$ based on the space and feature embeddings $\left\{ \mathbf { e } _ { i 1 } , . . . , \mathbf { e } _ { i j } , . . . , \mathbf { e } _ { i n } \right\}$ of $n$ nearby points $\{ p _ { i 1 } , . . . , p _ { i j } , . . . , p _ { i n } \}$ . Note that the feed-in order of context points should not affect the prediction results, which can be achieved by permutation invariant neural network architectures (Zaheer et al., 2017) like PointNet (Qi et al., 2017).
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\mathbf { e } [ \mathbf { v } _ { i } ] ^ { \prime } = D e c _ { c } ( \mathbf { x } _ { i } , \{ \mathbf { e } _ { i 1 } , . . . , \mathbf { e } _ { i j } , . . . , \mathbf { e } _ { i n } \} ; \theta _ { \mathrm { d e c } _ { c } } ) = g ( \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \sum _ { j = 1 } ^ { n } \alpha _ { i j k } \mathbf { e } [ \mathbf { v } _ { i j } ] )
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
Here g is an activation function such as sigmoid. αijk “ $\begin{array} { r } { \alpha _ { i j k } = \frac { e x p ( \sigma _ { i j k } ) } { \sum _ { o = 1 } ^ { n } e x p ( \sigma _ { i o k } ) } } \end{array}$ is the attention of $p _ { i }$ with its $j$ th neighbor through the $k$ th attention head, and
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\sigma _ { i j k } = L e a k y R e L U ( \mathbf { a } _ { k } ^ { T } [ \mathbf { e } [ \mathbf { v } _ { i } ] _ { i n i t } ; \mathbf { e } [ \mathbf { v } _ { i j } ] ; \mathbf { e } [ \mathbf { x } _ { i } - \mathbf { x } _ { i j } ] ] )
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where $\mathbf { a } _ { k } \in \mathbb { R } ^ { 2 d ^ { ( v ) } + d ^ { ( x ) } }$ is the attention parameter in the $k$ th attention head. The multi-head attention mechanism is inspired by Graph Attention Network (Velickovi ˇ c et al., 2018) and Mai et al. (2019a). ´
|
| 113 |
+
|
| 114 |
+
To represent the spatial relationship (distance and direction) between each context point $\begin{array} { r l } { p _ { i j } } & { { } = } \end{array}$ $( \mathbf { x } _ { i j } , \mathbf { v } _ { i j } )$ and the center point $p _ { i } = ( \mathbf { x } _ { i } , \mathbf { v } _ { i } )$ , we use the space encoder $E n c ^ { ( x ) } ( \ v r )$ to encode the displacement between them $\Delta { \bf x } _ { i j } = { \bf x } _ { i } - { \bf x } _ { i j }$ . Note that we are modeling the spatial interactions between the center point and $n$ context points simultaneously.
|
| 115 |
+
|
| 116 |
+
In Eq. $7 , \mathbf { e } [ \mathbf { v } _ { i } ] _ { i n i t }$ indicates the initial guess of the feature embedding $\mathbf { e } [ \mathbf { v } _ { i } ]$ of point $p _ { i }$ which is computed by using another multi-head attention layer as Eq. 6 where the weight $\begin{array} { r } { \alpha _ { i j k } ^ { \prime } = \frac { e x p ( \sigma _ { i j k } ^ { \prime } ) } { \sum _ { o = 1 } ^ { n } e x p ( \sigma _ { i o k } ^ { \prime } ) } } \end{array}$ . Here, $\sigma _ { i j k } ^ { \prime }$ is computed as Eq. 8 where the query embedding $\mathbf { e } [ \mathbf { v } _ { i } ]$ is excluded.
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\sigma _ { i j k } ^ { \prime } = L e a k y R e L U ( \mathbf { a } _ { k } ^ { \prime T } [ \mathbf { e } [ \mathbf { v } _ { i j } ] ; \mathbf { e } [ \mathbf { x } _ { i } - \mathbf { x } _ { i j } ] ] )
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
# 4.3 UNSUPERVISED TRAINING
|
| 123 |
+
|
| 124 |
+
The unsupervised learning task can simply be maximizing the log likelihood of observing the true point $p _ { i }$ at position $\mathbf { x } _ { i }$ among all the points in $\mathcal { P }$
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\mathcal { L } _ { \mathcal { P } } ( \boldsymbol { \theta } ) = - \sum _ { p _ { i } \in \mathcal { P } } \log P ( p _ { i } | p _ { i 1 } , . . . , p _ { i j } , . . . , p _ { i n } ) = - \sum _ { p _ { i } \in \mathcal { P } } \log \frac { \exp ( \mathbf { e } [ \mathbf { v } _ { i } ] ^ { T } \mathbf { e } [ \mathbf { v } _ { i } ] ^ { \prime } ) } { \sum _ { p _ { o } \in \mathcal { P } } \exp ( \mathbf { e } [ \mathbf { v } _ { o } ] ^ { T } \mathbf { e } [ \mathbf { v } _ { i } ] ^ { \prime } ) }
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
Here only the feature embedding of $p _ { i }$ is used (without location embedding) to prevent revealing the identities of the point candidates, and $\theta = [ \theta _ { \mathrm { { e n c } } } ; \theta _ { \mathrm { { d e c } } } ]$
|
| 131 |
+
|
| 132 |
+
Negative sampling by Mikolov et al. (2013) can be used to improve the efficiency of training
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\mathcal { L } _ { \mathcal { P } } ^ { \prime } ( \boldsymbol { \theta } ) = - \sum _ { p _ { i } \in \mathcal { P } } \Big ( \log \sigma ( \mathbf { e } [ \mathbf { v } _ { i } ] ^ { T } \mathbf { e } [ \mathbf { v } _ { i } ] ^ { \prime } ) + \frac { 1 } { | \mathcal { N } _ { i } | } \sum _ { p _ { o } \in \mathcal { N } _ { i } } \log \sigma ( - \mathbf { e } [ \mathbf { v } _ { o } ] ^ { T } \mathbf { e } [ \mathbf { v } _ { i } ] ^ { \prime } ) \Big )
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
Here ${ \mathcal { N } } _ { i } \subseteq { \mathcal { P } }$ is a set of sampled negative points for $p _ { i } \ ( p _ { i } \notin { \mathcal { N } } _ { i } )$ and $\sigma ( x ) = 1 / ( 1 + e ^ { - x } )$ .
|
| 139 |
+
|
| 140 |
+
# 5 EXPERIMENT
|
| 141 |
+
|
| 142 |
+
In this section we compare Space2Vec with commonly used position encoding methods, and analyze them both quantitatively and qualitatively.
|
| 143 |
+
|
| 144 |
+
Baselines Our baselines include 1) direct directly applying feed-forward nets (Chu et al., 2019); 2) tile discretization (Berg et al., 2014; Adams et al., 2015; Tang et al., 2015); 3) wrap feed-forward nets with coordinate wrapping (Mac Aodha et al., 2019); and 4) rbf Radial Basis Function (RBF) kernels (Baudat & Anouar, 2001; Bierens, 1994). See Appendix A.1 for details of the baselines.
|
| 145 |
+
|
| 146 |
+
# 5.1 POI TYPE CLASSIFICATION TASKS
|
| 147 |
+
|
| 148 |
+
Dataset and Tasks To test the proposed model, we conduct experiments on geographic datasets with POI position and type information. We utilize the open-source dataset published by Yelp Data Challenge and select all POIs within the Las Vegas downtown area3. There are 21,830 POIs with 1,191 different POI types in this dataset. Note that each POI may be associated with one or more types, and we do not use any other meta-data such as business names, reviews for this study. We project geographic coordinates into projection coordinates using the NAD83/Conus Albers projection coordinate system4. The POIs are split into training, validation, and test dataset with ratios $8 0 \% { : } 1 0 \% { : } 1 0 \%$ . We create two tasks setups which represent different types of modeling need in Geographic Information Science:
|
| 149 |
+
|
| 150 |
+
Location Modeling predicts the feature information associated with a POI based on its location $\mathbf { x } _ { i }$ represented by the location decoder $D e c _ { s } ( )$ . This represents a large number of location prediction problems such as image fine grained recognition with geographic prior (Chu et al., 2019), and species potential distribution prediction (Zuo et al., 2008). Spatial Context Modeling predicts the feature information associated with a POI based on its context $\left\{ \mathbf { e } _ { i 1 } , . . . , \mathbf { e } _ { i j } , . . . , \mathbf { e } _ { i n } \right\}$ represented by the spatial context decoder $D e c _ { c } ( )$ . This represents a collections of spatial context prediction problem such as spatial context based facade image classification (Yan et al., 2018), and all spatial interpolation problems.
|
| 151 |
+
|
| 152 |
+
We use POI prediction metrics to evaluate these models. Given the real point feature embedding $\mathbf { e } [ \mathbf { v } _ { i } ]$ and $N$ negative feature embeddings ${ \mathcal { N } } _ { i } = \{ \mathbf { e } [ \mathbf { v } _ { i } ] ^ { - } \}$ , we compare the predicted $\mathbf { e } [ \mathbf { v } _ { i } ] ^ { \prime }$ with them by cosine distance. The cosine scores are used to rank $\mathbf { e } [ \mathbf { v } _ { i } ]$ and $N$ negative samples. The negative feature embeddings are the feature embeddings of points $p _ { j }$ randomly sampled from $\mathcal { P }$ and $p _ { i } \neq p _ { j }$ . We evaluate each model using Negative Log-Likelihood (NLL), Mean Reciprocal Rank (MRR) and $\mathrm { H I T } @ 5$ (the chance of the true POI being ranked to top 5. We train and test each model 10 times to estimate standard deviations. See Appendix A.2 for hyper-parameter selection details.
|
| 153 |
+
|
| 154 |
+
# 5.1.1 LOCATION MODELING EVALUATION
|
| 155 |
+
|
| 156 |
+
We first study location modeling with the location decoder $D e c _ { s } ( )$ in Section 4.2. We use a negative sample size of $N = 1 0 0$ . Table 1 shows the average metrics of different models with their best hyperparameter setting on the validation set. We can see that direct and theorydiag are less competitive, only beating the random selection baseline. Other methods with single scale representations – including tile, wrap, and $r b f$ – perform better. The best results come from various version of the grid cell models, which are capable of dealing with multi-scale representations.
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 2: Embedding clustering of (a) direct; (b) tile with the best cell size $c = 5 0 0$ ; (c) wrap $( h = 3 , o =$ 512); (d) $r b f$ with the best $\sigma$ (1k) and 200 anchor points (red) and (e)(f)(h) theory models with different $\lambda _ { m i n }$ but fixed $\lambda _ { m a x } = 4 0 k$ and $S = 6 4$ . All models use 1 hidden ReLU layers of 512 neurons except wrap.
|
| 160 |
+
|
| 161 |
+
Table 1: The evaluation results of different location models on the validation and test dataset.
|
| 162 |
+
|
| 163 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Train NLL</td><td colspan="3">Validation</td><td colspan="2">Testing</td></tr><tr><td>NLL</td><td>MRR</td><td>HIT@5</td><td>MRR</td><td>HIT@5</td></tr><tr><td>random</td><td></td><td>-</td><td>0.052 (0.002)</td><td>4.8 (0.5)</td><td>0.051 (0.002)</td><td>5.0 (0.5)</td></tr><tr><td>direct</td><td>1.285</td><td>1.332</td><td>0.089 (0.001)</td><td>10.6 (0.2)</td><td>0.090 (0.001)</td><td>11.3 (0.2)</td></tr><tr><td>tile (c=500)</td><td>1.118</td><td>1.261</td><td>0.123 (0.001)</td><td>16.8 (0.2)</td><td>0.120 (0.001)</td><td>17.1 (0.3)</td></tr><tr><td>wrap(h=3,0=512)</td><td>1.222</td><td>1.288</td><td>0.112 (0.001)</td><td>14.6 (0.1)</td><td>0.119 (0.001)</td><td>15.8 (0.2)</td></tr><tr><td>rbf (σ=1k)</td><td>1.209</td><td>1.279</td><td>0.115 (0.001)</td><td>15.2 (0.2)</td><td>0.123 (0.001)</td><td>16.8 (0.3)</td></tr><tr><td>grid (Xmin=50)</td><td>1.156</td><td>1.258</td><td>0.128 (0.001)</td><td>18.1 (0.3)</td><td>0.139 (0.001)</td><td>20.0 (0.2)</td></tr><tr><td>hexa (Xmin=50)</td><td>1.230</td><td>1.297</td><td>0.107 (0.001)</td><td>14.0 (0.2)</td><td>0.105 (0.001)</td><td>14.5 (0.2)</td></tr><tr><td>theorydiag (Xmin=50)</td><td>1.277</td><td>1.324</td><td>0.094 (0.001)</td><td>12.3 (0.3)</td><td>0.094 (0.002)</td><td>11.2 (0.3)</td></tr><tr><td>theory (Xmin=1k)</td><td>1.207</td><td>1.281</td><td>0.123 (0.002)</td><td>16.3 (0.5)</td><td>0.121 (0.001)</td><td>16.2 (0.1)</td></tr><tr><td>theory (Xmin=500)</td><td>1.188</td><td>1.269</td><td>0.132 (0.001)</td><td>17.6 (0.3)</td><td>0.129 (0.001)</td><td>17.7 (0.2)</td></tr><tr><td>theory (Xmin=50)</td><td>1.098</td><td>1.249</td><td>0.137 (0.002)</td><td>19.4 (0.1)</td><td>0.144 (0.001)</td><td>20.0 (0.2)</td></tr></table>
|
| 164 |
+
|
| 165 |
+
In order to understand the reason for the superiority of grid cell models we provide qualitative analysis of their representations. We apply hierarchical clustering to the location embeddings produced by studied models using cosine distance as the distance metric (See Fig. 2). we can see that when restricted to large grid sizes $( \lambda _ { m i n } = 1 k )$ ), theory has similar representation (Fig. 2d, 2e, and Fig. 4d, 4e) and performance compared to $r b f$ $\mathit { \Pi } _ { \overline { { \sigma } } } = 1 k \mathit { \Pi } _ { \overline { { \theta } } }$ ). However it is able to significantly outperform $r b f$ $\sigma = 1 k$ ) (and tile and wrap) when small grid sizes $\langle \lambda _ { m i n } = 5 0 0 , 5 0 )$ are available. The relative improvements over $r b f$ $( \sigma = 1 k )$ ) are $- 0 . 2 \%$ , $+ 0 . 6 \%$ , $+ 2 . 1 \%$ MRR for $\lambda _ { m i n } { = } 1 \mathrm { k }$ , 500, 50 respectively.
|
| 166 |
+
|
| 167 |
+
# 5.1.2 MULTI-SCALE ANALYSIS OF LOCATION MODELING
|
| 168 |
+
|
| 169 |
+
In order to show how our multi-scale location representation model will affect the prediction of POI types with different distribution patterns, we classify all 1,191 POI types into three groups based on radius $r$ , which is derived from each POI types’ renormalized Ripley’s K curve (See Figure 1d for examples). It indicates the $\mathbf { X }$ axis value of the intersection between the curve and the line of $y = 3 . 0$ A lower $r$ indicates a more clustered distribution patterns. These three groups are listed below:
|
| 170 |
+
|
| 171 |
+
1. Clustered $( r \leqslant 1 0 0 m )$ ): POI types with clustered distribution patterns;
|
| 172 |
+
2. Middle ( $1 0 0 m < r < 2 0 0 m$ ): POI types with less extreme scales;
|
| 173 |
+
3. Even $r \geqslant 2 0 0 m$ ): POI types with even distribution patterns.
|
| 174 |
+
|
| 175 |
+
Table 2 shows the performance $( M R R )$ of direct, tile, wrap, rbf , and our theory model on the test dataset of the location modeling task with respect to these three different POI distribution groups. The numbers in pq indicate the MRR difference betweeb a baseline and theory. # POI refers to total number of POI belong to each group5. We can see that 1) The two neural net approaches (direct and wrap) have no scale related parameter and are not performing ideally across all scales, with direct
|
| 176 |
+
|
| 177 |
+
Table 2: Comparing performances in different POI groups. We classify all 1,191 POI types into three groups based on the radius $r$ of their root types, where their renormalized Ripley’s K curve (See Figure 1d) reach 3.0: 1) Clustered $( r \leqslant 1 0 0 m )$ ): POI types with clustered distribution patterns; 2) Middle $1 0 0 m < r < 2 0 0 m$ ): POI types with unclear distribution patterns; 3) Even $( r \geqslant 2 0 0 m )$ : POI types with even distribution patterns. The MRR of wrap and theory on those three groups are shown. The numbers in pq indicate the difference between the MRR of a baseline model and the MRR of theory with respect to a specific group. $\# P O I$ refers to the total number of POIs belonging to each group. Root Types indicates the root categories of those POI types belong to each group.
|
| 178 |
+
|
| 179 |
+
<table><tr><td>POI Groups</td><td>Clustered (r≤100m)</td><td>Middle (100m<r<200m)</td><td>Even (r≥ 200m)</td></tr><tr><td>direct</td><td>0.080 (-0.047)</td><td>0.108 (-0.030)</td><td>0.084 (-0.047)</td></tr><tr><td>wrap</td><td>0.106 (-0.021)</td><td>0.126 (-0.012)</td><td>0.122 (-0.009)</td></tr><tr><td>tile</td><td>0.108 (-0.019)</td><td>0.135 (-0.003)</td><td>0.111 (-0.020)</td></tr><tr><td>rbf</td><td>0.112 (-0.015)</td><td>0.136 (-0.002)</td><td>0.119 (-0.012)</td></tr><tr><td>theory</td><td>0.127 (-)</td><td>0.138(-)</td><td>0.131(-)</td></tr><tr><td>#POI</td><td>16,016</td><td>7,443</td><td>3,915</td></tr><tr><td>Root Types</td><td>Restaurants; Shopping; Food; Nightlife; Automotive; Active Life; Arts & Entertainment; Financial Services</td><td>Beauty & Spas; Health & Medical; Local Services;Hotels & Travel; Professional Services; Public Services & Government</td><td>Home Services; Event Planning & Services; Pets; Education</td></tr></table>
|
| 180 |
+
|
| 181 |
+
performs worse because of its simple single layer network. 2) The two approaches with built-in scale parameter (tile and $r b f$ ) have to trade off the performance of different scales. Their best parameter settings lead to close performances to that of Space2Vec at the middle scale, while performing poorly in both clustered and regular groups. These observation clearly shows that all baselines can at most well handle distribution at one scale but show poor performances in other scales. In contrast, Space2Vec’s multi-scale representation can handle distributions at different scales.
|
| 182 |
+
|
| 183 |
+
# 5.1.3 SPATIAL CONTEXT MODELING EVALUATION
|
| 184 |
+
|
| 185 |
+
Next, we evaluate the spatial context decoder $D e c _ { c } ( )$ in Sec. 4.2. We use the same evaluation set up as location modeling. The context points are obtained by querying the $n$ -th nearest points using PostGIS $( n = 1 0$ ). As for validation and test datasets, we make sure the center points are all unknown during the training phase. Table 3 shows the evaluation results of different models for spatial context modeling. The baseline approaches (direct, tile, wrap, $r b f$ ) generally perform poorly in context modeling. We designed specialized version of these approaches (polar, polar_tile, scaled_rbf) with polar coordinates, which lead to significantly improvements. Note that these are models proposed by us specialized for context modeling and therefore are less general than the grid cell approaches.
|
| 186 |
+
|
| 187 |
+
Table 3: The evaluation results of different spatial context models on the validation and test dataset. All encoders contains a 1 hidden layer FFN. All grid cell encoders set $\lambda _ { m i n } { = } 1 0$ , $\lambda _ { m a x } { = } 1 0 \mathbf { k }$ .
|
| 188 |
+
|
| 189 |
+
<table><tr><td rowspan="2">Space2Vec</td><td rowspan="2">Train NLL</td><td colspan="3"></td><td colspan="2">Testing</td></tr><tr><td>NLL</td><td>Validation MRR</td><td>HIT@5</td><td>MRR</td><td>HIT@5</td></tr><tr><td>none</td><td>1.163</td><td>1.297</td><td>0.159 (0.002)</td><td>22.4 (0.5)</td><td>0.167 (0.006)</td><td>23.4 (0.7)</td></tr><tr><td>direct</td><td>1.151</td><td>1.282</td><td>0.170 (0.002)</td><td>24.6 (0.4)</td><td>0.175 (0.003)</td><td>24.7 (0.5)</td></tr><tr><td>polar</td><td>1.157</td><td>1.283</td><td>0.176 (0.004)</td><td>25.4 (0.4)</td><td>0.178 (0.006)</td><td>24.9 (0.1)</td></tr><tr><td>tile(c = 50)</td><td>1.163</td><td>1.298</td><td>0.173 (0.004)</td><td>24.0 (0.6)</td><td>0.173 (0.001)</td><td>23.4 (0.1)</td></tr><tr><td>polar_tile(S =64)</td><td>1.161</td><td>1.282</td><td>0.173 (0.003)</td><td>25.0 (0.1)</td><td>0.177 (0.001)</td><td>24.5 (0.3)</td></tr><tr><td>wrap (h=2,0=512)</td><td>1.167</td><td>1.291</td><td>0.159 (0.001)</td><td>23.0 (0.1)</td><td>0.170 (0.001)</td><td>23.9 (0.2)</td></tr><tr><td>rbf (σ= 50)</td><td>1.160</td><td>1.281</td><td>0.179 (0.002)</td><td>25.2 (0.6)</td><td>0.172 (0.001)</td><td>25.0 (0.1)</td></tr><tr><td>scaled_rbf (o=40,β=0.1)</td><td>1.150</td><td>1.272</td><td>0.177 (0.002)</td><td>25.7 (0.1)</td><td>0.181 (0.001)</td><td>25.3 (0.1)</td></tr><tr><td>grid(Xmin=10)</td><td>1.172</td><td>1.285</td><td>0.178 (0.004)</td><td>24.9 (0.5)</td><td>0.181 (0.001)</td><td>25.1 (0.3)</td></tr><tr><td>hexa (Xmin=10)</td><td>1.156</td><td>1.289</td><td>0.173 (0.002)</td><td>24.0 (0.2)</td><td>0.183 (0.002)</td><td>25.3 (0.2)</td></tr><tr><td>theorydiag (Xmin = 10)</td><td>1.156</td><td>1.287</td><td>0.168 (0.001)</td><td>24.1 (0.4)</td><td>0.174 (0.005)</td><td>24.9 (0.1)</td></tr><tr><td>theory(Xmin=200)</td><td>1.168</td><td>1.295</td><td>0.159 (0.001)</td><td>23.1 (0.2)</td><td>0.170 (0.001)</td><td>23.2 (0.2)</td></tr><tr><td>theory(Xmin=50)</td><td>1.157</td><td>1.275</td><td>0.171 (0.001)</td><td>24.2 (0.3)</td><td>0.173 (0.001)</td><td>24.8 (0.4)</td></tr><tr><td>theory(Xmin=10)</td><td>1.158</td><td>1.280</td><td>0.177 (0.003)</td><td>25.2 (0.3)</td><td>0.185 (0.002)</td><td>25.7 (0.3)</td></tr></table>
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
Figure 3: Embedding clustering in the original space of (a) direct; (b) polar; (c) wrap, $h { = } 2 , o { = } 5 1 2$ ; (d) polar_tile, $S = 6 4$ , (e) scaled_ $. r b f$ , $\sigma = 4 0$ , $\beta { = } 0 . 1$ ; and (f) theory, $\lambda _ { m i n } = 1 0$ , $\lambda _ { m a x } = 1 0 k$ , $S = 6 4$ . $( \mathrm { g } ) ( \mathrm { h } ) ( \mathrm { i } ) ( \mathrm { j } ) ( \mathrm { k } ) ( \mathrm { l } )$ are the clustering results of the same models in the polar-distance space using $\log ( \Vert \ \Delta \mathbf { x } _ { i j } \ \Vert + 1 )$ . All models use 1 hidden ReLU (except wrap) layers of 512 neurons. Most models except wrap can capture a shift when distance is around $e ^ { 5 } - 1 \approx 1 5 0$ meters.
|
| 193 |
+
|
| 194 |
+
Nevertheless the grid cell approaches are able to perform better than the specialized approaches on the test dataset while have competitive performance on validation dataset. See Appendix ?? for the visualization of context models. Actually the gains are small for all baseline approaches also. The reason is that we expect location encoding to be less important when context information is accessible. Similarly as discussed in (Gao et al., 2019), it is when there is a lack of visual clues that the grid cells of animals are the most helpful for their navigation.
|
| 195 |
+
|
| 196 |
+
Figure 6 shows the location embedding clustering results in both Cartesian and polar coordinate systems. We can see that direct (Fig. 3a, 3g) only captures the distance information when the context POI is very close $( l o g ( \parallel \Delta \mathbf { x } _ { i j } \parallel + 1 ) \leqslant 5 $ ) while in the farther spatial context it purely models the direction information. polar (Fig. 3b, 3h) has the similar behaviors but captures the distance information in a more fine-grained manner. wrap (Fig. 3c, 3i) mainly focuses on differentiating relative positions in farther spatial context cont which might explain its lower performance6. polar_tile (Fig. 3d) mostly responds to distance information. Interestingly, scaled_rbf and theory have similar representations in the polar coordinate system (Fig. 3k, 3l) and similar performance (Table 3). While scaled_rbf captures the gradually decreased distance effect with a scaled kernel size which becomes larger in farther distance, theory achieves this by integrating representations of different scales.
|
| 197 |
+
|
| 198 |
+
# 5.2 FINE-GRAINED IMAGE CLASSIFICATION TASKS
|
| 199 |
+
|
| 200 |
+
To demonstrate the generalizability of Space2Vec for space representation we utilized the proposed point space encoder $E n c ^ { ( x ) } ( \ v r )$ model in a well-known computer vision task: fine-grained image classification. As we discussed in Section 3, many studies (Berg et al., 2014; Chu et al., 2019; Mac Aodha et al., 2019) have shown that geographic prior information - where (and when) the image is taken - is very important additional information for the fine-grained image classification task and can substantially improve the model performance. For example, the appearance information is usually not sufficient to differentiate two visually similar species. In this case, the geographic prior becomes much more important because these two species may have very different spatial prior distributions such as the example of European Toads and Spiny Toads in Figure 1 of Mac Aodha et al. (2019).
|
| 201 |
+
|
| 202 |
+
We adopt the task setup of Mac Aodha et al. (2019). During training we have a set of tuples $D =$ $\{ ( I _ { i } , \mathbf { x } _ { i } , y _ { i } , p _ { i } ) \mid i = 1 , . . . , N \}$ where $I _ { i }$ indicates an image, $y _ { i } \in \{ 1 , 2 , . . . , C \}$ is the corresponding class label (species category), $\mathbf { x } _ { i } = \left[ l o n g i t u d e _ { i } , l a t i t u d e _ { i } \right]$ is the geographic coordinates where the image was taken, and $p _ { i }$ is the id of the photographer who took this image. At training time, a location encoder is trained to capture the spatial prior information $P ( y \mid \mathbf { x } )$ . At inference time, $p _ { i }$ information is not available and the final image classification prediction is calculated based on the combination of two models: 1) the trained location encoder which captures the spatial priors $P ( y \mid \mathbf { x } )$ and 2) the pretrained image classification model, InceptionV3 network (Szegedy et al., 2016), which captures ${ \bar { P } } ( y \mid I )$ . Bayesian theory has been used to derive the joint distribution $P ( y \mid I , \mathbf { x } )$ . See Mac Aodha et al. (2019) for detail explanation as well as the loss function. Note that while Space2Vec outperforms specialized density estimation methods such as Adaptive Kernel (Berg et al., 2014), it would be interesting to explore early fusion Space2Vec ’s representations with the image module.
|
| 203 |
+
|
| 204 |
+
Table 4: Fine-grained image classification results on two datasets: BirdSnap: and NABirds:. The classification accuracy is calculated by combining image classification predictions $P ( y \mid I )$ with different spatial priors $P ( y \mid \mathbf { x } )$ . The grid and theory model use 1 hidden ReLU layers of 512 neurons. The evaluation results of the baseline models are from Table 1 of Mac Aodha et al. (2019).
|
| 205 |
+
|
| 206 |
+
<table><tr><td></td><td>BirdSnapt</td><td>NABirdst</td></tr><tr><td>No Prior (i.e.uniform)</td><td>70.07</td><td>76.08</td></tr><tr><td>Nearest Neighbor (num)</td><td>77.76</td><td>79.99</td></tr><tr><td>Nearest Neighbor (spatial)</td><td>77.98</td><td>80.79</td></tr><tr><td>Adaptive Kernel (Berg et al., 2014)</td><td>78.65</td><td>81.11</td></tr><tr><td>tile (Tang et al.,2015) (location only)</td><td>77.19</td><td>79.58</td></tr><tr><td>wrap (Mac Aodha et al.,2019) (location only)</td><td>78.65</td><td>81.15</td></tr><tr><td>rbf (σ=1k)</td><td>78.56</td><td>81.13</td></tr><tr><td>grid (入min=0.0001,入max=360,S= 64)</td><td>79.44</td><td>81.28</td></tr><tr><td>theory (入min=0.0001, λmax=360,S=64)</td><td>79.35</td><td>81.59</td></tr></table>
|
| 207 |
+
|
| 208 |
+
We use two versions of our point space encoder $E n c ^ { ( x ) } ( \ v r )$ model (grid, theory) as the location encoder to capture the spatial prior information $P ( y \mid \mathbf { x } )$ . The evaluation results of our models as well as multiple baselines are shown in Table 4. We can see that both grid, theory outperform previous models as well as that of Mac Aodha et al. (2019) on two fine-grained image classification datasets with significant sizes: BirdSnap:, NABirds:. theory shows superiority over grid on NABirds: while fail to outperform grid on BirdSnap:. Note that we only pick baseline models which capture spatial-only prior and drop models which additionally consider time information. Both grid and theory use 1 hidden ReLU layers of 512 neurons for $\mathbf { N N } ( )$ and they have the same hyperparameters: $\lambda _ { m i n } { = } 0 . 0 0 0 1$ , $\lambda _ { m a x } { = } 3 6 0$ , $S = 6 4$ . Like Mac Aodha et al. (2019), the location embedding size $d ^ { ( x ) }$ is 1024 and we train the location encoder for 30 epochs. Our implementation is based on the original code7 of Mac Aodha et al. (2019) for both model training and evaluation phase.
|
| 209 |
+
|
| 210 |
+
# 6 CONCLUSION
|
| 211 |
+
|
| 212 |
+
We introduced an encoder-decoder framework as a general-purpose representation model for space inspired by biological grid cells’ multi-scale periodic representations. The model is an inductive learning model and can be trained in an unsupervised manner. We conduct two experiments on POI type prediction based on 1) POI locations and 2) nearby POIs. The evaluation results demonstrate the effectiveness of our model. Our analysis reveals that it is the ability to integrate representations of different scales that makes the grid cell models outperform other baselines on these two tasks. In the future, we hope to incorporate the presented framework to more complex GIS tasks such as social network analysis, and sea surface temperature prediction.
|
| 213 |
+
|
| 214 |
+
# ACKNOWLEDGMENTS
|
| 215 |
+
|
| 216 |
+
The presented work is partially funded by the NSF award 1936677 C-Accel Pilot - Track A1 (Open Knowledge Network): Spatially-Explicit Models, Methods, And Services For Open Knowledge Networks, Esri Inc., and Microsoft AI for Earth Grant: Deep Species Spatio-temporal Distribution Modeling for Biodiversity Hotspot Prediction. We thank Dr. Ruiqi Gao for discussions about grid cells, Dr. Wenyun Zuo for discussion about species potential distribution prediction and Dr. Yingjie Hu for his suggestions about the introduction section.
|
| 217 |
+
|
| 218 |
+
# REFERENCES
|
| 219 |
+
|
| 220 |
+
Alison Abbott and Ewen Callaway. Nobel prize for decoding brain’s sense of place. Nature News, 514(7521):153, 2014.
|
| 221 |
+
|
| 222 |
+
Benjamin Adams, Grant McKenzie, and Mark Gahegan. Frankenplace: interactive thematic mapping for ad hoc exploratory search. In Proceedings of the 24th international conference on world wide web, pp. 12–22. International World Wide Web Conferences Steering Committee, 2015.
|
| 223 |
+
|
| 224 |
+
Andrea Banino, Caswell Barry, Benigno Uria, Charles Blundell, Timothy Lillicrap, Piotr Mirowski, Alexander Pritzel, Martin J Chadwick, Thomas Degris, Joseph Modayil, et al. Vector-based navigation using grid-like representations in artificial agents. Nature, 557(7705):429, 2018.
|
| 225 |
+
|
| 226 |
+
G Baudat and F Anouar. Kernel-based methods and function approximation. volume 2, pp. 1244 – 1249 vol.2, 02 2001. ISBN 0-7803-7044-9. doi: 10.1109/IJCNN.2001.939539.
|
| 227 |
+
|
| 228 |
+
Thomas Berg, Jiongxin Liu, Seung Woo Lee, Michelle L Alexander, David W Jacobs, and Peter N Belhumeur. Birdsnap: Large-scale fine-grained visual categorization of birds. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2011–2018, 2014.
|
| 229 |
+
|
| 230 |
+
Herman J. Bierens. The nadaraya–watson kernel regression function estimator. Topics in Advanced Econometrics, 16:212–247, 1994.
|
| 231 |
+
|
| 232 |
+
Hugh T Blair, Adam C Welday, and Kechen Zhang. Scale-invariant memory representations emerge from moire interference between grid fields that produce theta oscillations: a computational model. Journal of Neuroscience, 27(12):3211–3229, 2007.
|
| 233 |
+
|
| 234 |
+
Grace Chu, Brian Potetz, Weijun Wang, Andrew Howard, Yang Song, Fernando Brucher, Thomas Leung, and Hartwig Adam. Geo-aware networks for fine grained recognition. arXiv preprint arXiv:1906.01737, 2019.
|
| 235 |
+
|
| 236 |
+
Christopher J Cueva and Xue-Xin Wei. Emergence of grid-like representations by training recurrent neural networks to perform spatial localization. arXiv preprint arXiv:1803.07770, 2018.
|
| 237 |
+
|
| 238 |
+
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.
|
| 239 |
+
|
| 240 |
+
A Stewart Fotheringham and David WS Wong. The modifiable areal unit problem in multivariate statistical analysis. Environment and planning A, 23(7):1025–1044, 1991.
|
| 241 |
+
|
| 242 |
+
Ruiqi Gao, Jianwen Xie, Song-Chun Zhu, and Ying Nian Wu. Learning grid cells as vector representation of self-position coupled with matrix representation of self-motion. In Proceedings of ICLR 2019, 2019.
|
| 243 |
+
|
| 244 |
+
Nataliia Kussul, Mykola Lavreniuk, Sergii Skakun, and Andrii Shelestov. Deep learning classification of land cover and crop types using remote sensing data. IEEE Geoscience and Remote Sensing Letters, 14(5):778–782, 2017.
|
| 245 |
+
|
| 246 |
+
Alex M Lechner, William T Langford, Simon D Jones, Sarah A Bekessy, and Ascelin Gordon. Investigating species–environment relationships at multiple scales: Differentiating between intrinsic scale and the modifiable areal unit problem. Ecological Complexity, 11:91–102, 2012.
|
| 247 |
+
|
| 248 |
+
Yaguang Li, Rose Yu, Cyrus Shahabi, and Yan Liu. Diffusion convolutional recurrent neural network: Data-driven traffic forecasting. arXiv preprint arXiv:1707.01926, 2017.
|
| 249 |
+
|
| 250 |
+
Oisin Mac Aodha, Elijah Cole, and Pietro Perona. Presence-only geographical priors for fine-grained image classification. arXiv preprint arXiv:1906.05272, 2019.
|
| 251 |
+
|
| 252 |
+
Gengchen Mai, Krzysztof Janowicz, Bo Yan, Rui Zhu, Ling Cai, and Ni Lao. Contextual graph attention for answering logical queries over incomplete knowledge graphs. In Proceedings of the 10th International Conference on Knowledge Capture, pp. 171–178, 2019a.
|
| 253 |
+
|
| 254 |
+
Gengchen Mai, Bo Yan, Krzysztof Janowicz, and Rui Zhu. Relaxing unanswerable geographic questions using a spatially explicit knowledge graph embedding model. In AGILE: The 22nd Annual International Conference on Geographic Information Science, pp. 21–39. Springer, 2019b.
|
| 255 |
+
|
| 256 |
+
V Maz’ya and G Schmidt. On approximate approximations using gaussian kernels. IMA Journal of Numerical Analysis, 16:13–29, 01 1996.
|
| 257 |
+
|
| 258 |
+
Grant McKenzie, Krzysztof Janowicz, Song Gao, Jiue-An Yang, and Yingjie Hu. Poi pulse: A multi-granular, semantic signature–based information observatory for the interactive visualization of big geosocial data. Cartographica: The International Journal for Geographic Information and Geovisualization, 50(2):71–85, 2015.
|
| 259 |
+
|
| 260 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111–3119, 2013.
|
| 261 |
+
|
| 262 |
+
Justin Moat, Steven P Bachman, Richard Field, and Doreen S Boyd. Refining area of occupancy to address the modifiable areal unit problem in ecology and conservation. Conservation biology, 32 (6):1278–1289, 2018.
|
| 263 |
+
|
| 264 |
+
Stan Openshaw. The modifiable areal unit problem. Concepts and techniques in modern geography, 1984.
|
| 265 |
+
|
| 266 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 1532–1543, 2014.
|
| 267 |
+
|
| 268 |
+
Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. arXiv preprint arXiv:1802.05365, 2018.
|
| 269 |
+
|
| 270 |
+
Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 652–660, 2017.
|
| 271 |
+
|
| 272 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2818–2826, 2016.
|
| 273 |
+
|
| 274 |
+
Kevin Tang, Manohar Paluri, Li Fei-Fei, Rob Fergus, and Lubomir Bourdev. Improving image classification with location context. In Proceedings of the IEEE international conference on computer vision, pp. 1008–1016, 2015.
|
| 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 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. In ICLR 2018, 2018.
|
| 279 |
+
|
| 280 |
+
Bo Yan, Krzysztof Janowicz, Gengchen Mai, and Song Gao. From itdl to place2vec: Reasoning about place type similarity and relatedness by learning embeddings from augmented spatial contexts. In Proceedings of the 25th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems, pp. 35. ACM, 2017.
|
| 281 |
+
|
| 282 |
+
Bo Yan, Krzysztof Janowicz, Gengchen Mai, and Rui Zhu. xnet+ sc: Classifying places based on images by incorporating spatial contexts. In 10th International Conference on Geographic Information Science (GIScience 2018). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2018.
|
| 283 |
+
|
| 284 |
+
Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in neural information processing systems, pp. 3391–3401, 2017.
|
| 285 |
+
|
| 286 |
+
Wenyun Zuo, Ni Lao, Yuying Geng, and Keping Ma. Geosvm: an efficient and effective tool to predict species’ potential distributions. Journal of Plant Ecology, 1(2):143–145, 2008.
|
| 287 |
+
|
| 288 |
+
# A APPENDIX
|
| 289 |
+
|
| 290 |
+
# A.1 BASELINES
|
| 291 |
+
|
| 292 |
+
To help understand the mechanism of distributed space representation we compare multiple ways of encoding spatial information. Different models use different point space encoder $E n c ^ { ( x ) } ( \ v r )$ to encode either location $\mathbf { x } _ { i }$ (for location modeling loc) or the displacement between the center point and one context point $\Delta { \bf x } _ { i j } = { \bf x } _ { i } - { \bf x } _ { i j }$ (for spatial context modeling cont)8.
|
| 293 |
+
|
| 294 |
+
• random shuffles the order of the correct POI and $N$ negative samples randomly as the predicted ranking. This shows the lower bound of each metrics.
|
| 295 |
+
• direct directly encode location $\mathbf { x } _ { i }$ (or $\Delta { \bf x } _ { i j }$ for cont) into a location embedding $\mathbf { e } [ \mathbf { x } _ { i } ]$ (or $\mathbf { e } [ \Delta \mathbf { x } _ { i j } ] )$ using a feed-forward neural networks $\left( \mathrm { F F N s } \right) ^ { 9 }$ , denoted as $E n c _ { d i r e c t } ^ { ( x ) } ( { \bf x } )$ without decomposing coordinates into a multi-scale periodic representation. This is essentially the GPS encoding method used by Chu et al. (2019). Note that Chu et al. (2019) is not open sourced and we end up implementing the model architecture ourselves.
|
| 296 |
+
• tile divides the study area $A _ { l o c }$ (for loc) or the range of spatial context defined by $\lambda _ { m a x }$ , $A _ { c o n t }$ , (for cont) into grids with equal grid sizes $c$ . Each grid has an embedding to be used as the encoding for every location $\mathbf { x } _ { i }$ or displacement $\Delta { \bf x } _ { i j }$ fall into this grid. This is a common practice by many previous work when dealing with coordinate data (Berg et al., 2014; Adams et al., 2015; Tang et al., 2015). wrap is a location encoder model recently introduced by Mac Aodha et al. (2019). It first normalizes $\mathbf { x }$ (or $\Delta \mathbf { x } )$ ) into the range $[ - 1 , 1 ]$ and uses a coordinate wrap mechanism $[ \sin ( \pi \mathbf { x } ^ { [ l ] } ) ; \cos ( \pi \mathbf { x } ^ { [ l ] } ) ]$ to convert each dimension of $\mathbf { x }$ into 2 numbers. This is then passed through an initial fully connected layer, followed by a series of $h$ residual blocks, each consisting of two fully connected layers $\scriptstyle { \dot { } } _ { o }$ hidden neurons) with a dropout layer in between. We adopt the official code of Mac Aodha et al. $( 2 0 1 9 ) ^ { 1 0 }$ for this implementation.
|
| 297 |
+
• $r b f$ randomly samples $M$ points from the training dataset as RBF anchor points $\{ \mathbf { x } _ { m } ^ { a n c h o r } , m \stackrel { \cdot } { = } 1 . . . \bar { M } \}$ (or samples $M \Delta \mathbf { x } _ { m } ^ { a n c h o r }$ from $A _ { c o n t }$ for cont) 11, and use gaussian kernels $\exp \big ( - \frac { \parallel \mathbf { x } _ { i } - \mathbf { x } _ { m } ^ { a n c h o r } \parallel ^ { 2 } } { 2 \sigma ^ { 2 } } \big )$ (or $\exp \big ( - \frac { \parallel \Delta \mathbf { x } _ { i j } - \Delta \mathbf { x } _ { m } ^ { a n c h o r } \parallel ^ { 2 } } { 2 \sigma ^ { 2 } } \big )$ for cont) on each anchor points, where $\sigma$ is the kernel size. Each point $p _ { i }$ has a $M$ -dimension RBF feature vector which is fed into a FNN to obtain the spatial embedding. This is a strong baseline for representing floating number features in machine learning models.
|
| 298 |
+
• grid as described in Section 4.1 inspired by the position encoding in Transformer (Vaswani et al., 2017).
|
| 299 |
+
• hexa Same as grid but use $s i n ( \theta ) , s i n ( \theta + 2 \pi / 3 )$ , and $s i n ( \theta + 4 \pi / 3 )$ in $P E _ { s , l } ^ { ( g ) } ( \mathbf { x } )$ .
|
| 300 |
+
• theory as described in Section 4.1, uses the theoretical models (Gao et al., 2019) as the first layer of $E n c _ { t h e o r y } ^ { ( x ) } ( \mathbf { x } )$ or $E n c _ { t h e o r y } ^ { ( x ) } ( \Delta \mathbf { x } _ { i j } )$ .
|
| 301 |
+
• theorydiag further constrains $\mathbf { N N } ( )$ as a block diagonal matrix, with each scale as a block.
|
| 302 |
+
|
| 303 |
+
We also have the following baselines which are specific to the spatial context modeling task.
|
| 304 |
+
|
| 305 |
+
• none the decoder $D e c _ { c } ( )$ does not consider the spatial relationship between the center point and context points but only the co-locate patterns such as Place2Vec (Yan et al., 2017). That means we drop the $\mathbf { e } [ \Delta \mathbf { x } _ { i j } ]$ from the attention mechanism in Equ. 7 and 8. polar first converts the displacement $\Delta \mathbf { x } _ { i j }$ into polar coordinates $( r , \theta )$ centered at the center point where $r = l o g ( \parallel \Delta \mathbf { x } _ { i j } \parallel + 1 ) ^ { - }$ . Then it uses $[ r , \theta ]$ as the input for a FFN to obtain the spatial relationship embedding in Equ. 7. We find out that it has a significant performance improvement over the variation with $r = \parallel \Delta \mathbf { x } _ { i j } \parallel$ .
|
| 306 |
+
|
| 307 |
+
• polar_tile is a modified version of tile but the grids are extracted from polar coordinates $( r , \theta )$ centered at the center point where $r = l o g ( \parallel \Delta \mathbf { x } _ { i j } \parallel + 1 )$ . Instead of using grid size $c$ , we use the number of grids along $\theta$ (or $r$ ) axis, $F$ , as the only hyperparameter. Similarly, We find that $r = l o g ( \parallel \Delta \mathbf { x } _ { i j } \parallel + \mathrm { 1 } \bar { ) }$ outperform $r = \parallel \Delta \mathbf { x } _ { i j } \parallel$ significantly. • scaled_rbf is a modified version of $r b f$ for cont whose kernel size is proportional to the distance between the current anchor point and the origin, $\parallel \Delta \mathbf { x } _ { m } ^ { a n c \hat { h } o r ^ { * } } \parallel$ . That is ´ 2σ2scbasic kernel size and $\exp \big ( - \frac { \parallel \Delta \mathbf { x } _ { i j } - \Delta \mathbf { x } _ { m } ^ { a n c h o r } \parallel ^ { 2 } } { 2 \sigma _ { s c a l e d } ^ { 2 } } \big )$ $\beta$ d scaled “ \` m is kernel rescale factor, a constant. We developed this me $\sigma$ anism to help RFB to deal with relations at different scale, and we observe that it produces significantly better result than vanilla RBFs.
|
| 308 |
+
|
| 309 |
+
# A.2 HYPER-PARAMETER SELECTION
|
| 310 |
+
|
| 311 |
+
We perform grid search for all methods based on their performance on the validation sets.
|
| 312 |
+
|
| 313 |
+
Location Modeling The hyper-parameters of theory models are based on grid search with $d ^ { ( v ) } \ = \ ( 3 2 , 6 4 , 1 2 \bar { 8 } , 2 5 6 )$ , $d ^ { ( x ) } \ = \ ( 3 2 , 6 4 , 1 2 8 , 2 5 6 )$ , $S \ = \ ( 4 , 8 , 1 6 , 3 2 , 6 4 , 1 2 8 )$ , and $\lambda _ { m i n } ~ =$ $( 1 , 5 , 1 0 , 5 0 , 1 0 0 , 2 0 0 , 5 0 0 , 1 k )$ while $\lambda _ { m a x } = 4 0 k$ is decided based on the total size of the study area. We find out the best performances of different grid cell based models are obtained when $d ^ { ( v ) } = 6 4$ , $d ^ { ( x ) } = 6 4$ , $S \ : = \ : 6 4$ , and $\lambda _ { m i n } = 5 0$ . In terms of tile, the hyper-parameters are selected from $c = ( 1 0 , 5 0 , 1 0 0 , 2 0 0 , 5 0 0 , 1 0 0 0 )$ while $c = 5 0 0$ gives us the best performance.As for $r b f$ , we do grid search on the hyper-parameters: $M \ = \ ( 1 0 , 5 0 , 1 0 0 , 2 0 0 , 4 0 0 , 8 0 0 )$ and $\sigma = ( \mathrm { 1 0 ^ { 2 } } , \mathrm { 1 0 ^ { 3 } } , \mathrm { 1 0 ^ { 4 } } , \mathrm { 1 0 ^ { 5 } } , \mathrm { 1 0 ^ { 6 } } , \mathrm { 1 0 ^ { 7 } } )$ . The best performance of $r b f$ is obtain when $M = 2 0 0$ and $\sigma = 1 0 ^ { 3 }$ . As for wrap, grid search is performed on: $h = ( 1 , 2 , 3 , 4 )$ and $o = ( 6 4 , 1 2 8 , 2 5 6 , 5 1 2 )$ while $h = 3$ and $o = 5 1 2$ gives us the best result. All models use FFNs in their $E n c ^ { ( x ) } ( \ v r )$ except wrap. The number of layers $f$ and the number of hidden state neurons $u$ of the FFN are selected from $f = ( 1 , 2 , 3 )$ and $u = ( 1 2 8 , 2 5 6 , 5 1 2 )$ . We find out $f = 1$ and $u = 5 1 2$ give the best performance for direct, tile, $r b f$ , and theory. So we use them for every model for a fair comparison.
|
| 314 |
+
|
| 315 |
+
Spatial Context Modeling Grid search is used for hyperparameter tuning and the best performance of different grid cell models is obtain when $d ^ { ( v ) } = 6 \dot { 4 }$ , $d ^ { ( \bar { x } ) } = 6 4$ , $S = 6 4$ , and $\lambda _ { m i n } = 1 0$ . We set $\lambda _ { m a x } = 1 0 k$ based on the maximum displacement between context points and center points to make the location encoding unique. As for multiple baseline models, grid search is used again to obtain the best model. The best model hyperparameters are shown in () besides the model names in Table 3. Note that both $r b f$ and scaled_rbf achieve the best performance with $M = 1 0 0$ .
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
A.3 FIRING PATTERN FOR THE NEURONS
|
| 319 |
+
Figure 4: The firing pattern for the first 8 neurons (out of 64) given different encoders in location modeling.
|
| 320 |
+
|
| 321 |
+

|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure 5: Embedding clustering in the original space of (a)(b)(c)(d) theory with different $\lambda _ { m i n }$ , but the same $\lambda _ { m a x } = 1 0 k$ and $S = 6 4$ . (e)(f)(g)(h) are the embedding clustering results of the same models in the polar-distance space. All models use 1 hidden ReLU layers of 512 neurons.
|
| 325 |
+
Figure 6: Embedding clustering of RBF models with different kernel rescalar factor $\beta$ (a)(b)(c)(d) in the original space; (e)(f)(g)(h) in the polar-distance space. Here $\beta { = } 0 . 0$ indicates the original RBF model. All models use $\sigma { = } 1 0 \mathrm { m }$ as the basic kernel size and 1 hidden ReLU layers of 512 neurons.
|
md/train/rJxGLlBtwH/rJxGLlBtwH.md
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON THE INTERACTION BETWEEN SUPERVISION AND SELF-PLAY IN EMERGENT COMMUNICATION
|
| 2 |
+
|
| 3 |
+
Ryan Lowe∗, Abhinav Gupta∗ MILA
|
| 4 |
+
|
| 5 |
+
Jakob Foerster, Douwe Kiela Facebook AI Research
|
| 6 |
+
|
| 7 |
+
Joelle Pineau Facebook AI Research MILA
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
A promising approach for teaching artificial agents to use natural language involves using human-in-the-loop training. However, recent work suggests that current machine learning methods are too data inefficient to be trained in this way from scratch. In this paper, we investigate the relationship between two categories of learning signals with the ultimate goal of improving sample efficiency: imitating human language data via supervised learning, and maximizing reward in a simulated multi-agent environment via self-play (as done in emergent communication), and introduce the term supervised self-play $( S 2 P )$ for algorithms using both of these signals. We find that first training agents via supervised learning on human data followed by self-play outperforms the converse, suggesting that it is not beneficial to emerge languages from scratch. We then empirically investigate various S2P schedules that begin with supervised learning in two environments: a Lewis signaling game with symbolic inputs, and an image-based referential game with natural language descriptions. Lastly, we introduce population based approaches to S2P, which further improves the performance over single-agent methods.1
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Language is one of the most important aspects of human intelligence; it allows humans to coordinate and share knowledge with each other. It is also crucial for human-machine interaction, as human language is a natural means by which to exchange information, give feedback, and specify goals. A promising approach for training agents to solve problems with natural language is to have a “human in the loop”, meaning we collect problem-specific data from humans interacting directly with our agents for learning. However, human-in-the-loop data is expensive and time-consuming to obtain as it requires continuously collecting human data as the agent’s policy improves, and recent work suggests that current machine learning methods (e.g. from deep reinforcement learning) are too data-inefficient to be trained in this way from scratch (Chevalier-Boisvert et al., 2019). Thus, an important open problem is: how can we make human-in-the-loop training as data efficient as possible?
|
| 16 |
+
|
| 17 |
+
To maximize data efficiency, it is important to fully leverage all available training signals. In this paper, we study two categories of such training methods: imitating human data via supervised learning, and self-play to maximize reward in a multi-agent environment, both of which provide rich signals for endowing agents with language-using capabilities. However, these are potentially competing objectives, as maximizing environmental reward can lead to the resulting communication protocol drifting from natural language (Lewis et al., 2017; Lee et al., 2019). The crucial question, then, is how do we best combine self-play and supervised updates? This question has received surprisingly little attention from the emergent communication literature, where the question of how to bridge the gap from emergent protocols to natural language is generally left for future work (Mordatch & Abbeel, 2018; Lazaridou et al., 2018; Cao et al., 2018).
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: (a) Diagram of the supervised self-play (S2P) procedure (phases 1-3) and the testing procedure considered in this work (phase 4). (b) The environments considered in this paper (Sec. 4).
|
| 21 |
+
|
| 22 |
+
Our goal in this paper is to investigate algorithms for combining supervised learning with self-play — which we call supervised self-play (S2P) algorithms — using two classic emergent communication tasks: a Lewis signaling game with symbolic inputs, and a more complicated image-based referential game with natural language descriptions. Our first finding is that supervised learning followed by self-play outperforms emergent communication with supervised fine-tuning in these environments, and we provide three reasons for why this is the case. We then empirically investigate several supervised-first S2P methods in our environments. Existing approaches in this area have used various ad-hoc schedules for alternating between the two kinds of updates (Lazaridou et al., 2017), but to our knowledge there has been no systematic study that has compared these approaches. Lastly, we propose the use of population-based methods for S2P, and find that it leads to improved performance in the more challenging image-based referential game. Our findings highlight the need for further work in combining supervised learning and self-play to develop more sample-efficient language learners.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
In the past few years, there has been a renewed interest in the field of emergent communication (Sukhbaatar et al., 2016; Foerster et al., 2016; Lazaridou et al., 2017; Havrylov & Titov, 2017) culminating in 3 NeurIPS workshops. Empirical studies have showed that agents can autonomously evolve a communication protocol using discrete symbols when deployed in a multi-agent environment which helps them to play a cooperative or competitive game (Singh et al., 2019; Cao et al., 2018; Choi et al., 2018; Resnick\* et al., 2019; Evtimova et al., 2018).
|
| 27 |
+
|
| 28 |
+
While the idea of promoting coordination among agents through communication sounds promising, recent experiments (Lowe et al., 2019; Chaabouni et al., 2019; Kottur et al., 2017; Jaques et al., 2019) have emphasized the difficulty in learning meaningful emergent communication protocols even with centralized training.
|
| 29 |
+
|
| 30 |
+
Apart from the above advances in emergent communication, there has been a long outstanding goal of learning intelligent conversational agents to be able to interact with humans. This involves training the artificial agents in a way so that they achieve high scores while solving the task and their language is interpretable by humans or close to natural language. Recent works also add another axis orthogonal to communication where the agent also takes a discrete action in an interactive environment (de Vries et al., 2018; Mul et al., 2019). Lewis et al. (2017) introduced a negotiation task which involves learning linguistic and reasoning skills. They train models imitating human utterances using supervised learning and found that the model generated human-like captions but were poor negotiators. So they perform self-play with these pretrained agents in an interleaved manner and found that the performance improved drastically while avoiding language drift. Lee et al. (2019) also propose using an auxiliary task for grounding the communication to counter language drift. They use visual grounding to learn the semantics of the language while still generating messages that are close to English.
|
| 31 |
+
|
| 32 |
+
A recent trend on using population based training for multi-agent communication is a promising avenue for research using inspirations from language evolution literature (Smith et al., 2003; Kirby,
|
| 33 |
+
|
| 34 |
+
2014; Raviv & Arnon, 2018). Cultural transmission is one such technique which focuses on the structure and compression of languages, since a language must be used and learned by all individuals of the culture in which it resides and at the same time be suitable for a variety of tasks. Harding Graesser et al. (2019) shows the emergence of linguistic phenomena when a pool of agents contact each other giving rise to novel creole languages. Li & Bowling (2019); Cogswell et al. (2019); Tieleman et al. (2018) have also tried different ways of imposing cultural pressures on agents, by simulating a large population of them and pairing agents to solve a cooperative game with communication. They train the agent against a sampled generation of agents where the generation corresponds to the different languages of the different agent at different times in the history.
|
| 35 |
+
|
| 36 |
+
Our work is inspired from these works where we aim to formalize the recent advancements in using self-play in dialog modeling, through the lens of emergent communication.
|
| 37 |
+
|
| 38 |
+
# 3 METHODS
|
| 39 |
+
|
| 40 |
+
# 3.1 PROBLEM DEFINITION
|
| 41 |
+
|
| 42 |
+
Our agents are embedded in a multi-agent environment with $N$ agents where they receive observations $o \in O$ (which are functions of a hidden state $S$ ) and perform actions $a \in A$ . Some actions $A _ { L } \subset A$ involve sending a message $m \in A _ { L }$ over a discrete, costless communication channel (i.e. a cheap talk channel (Farrell & Rabin, 1996)). The agents are rewarded with a reward $r \in R$ for their performance in the environment. We assume throughout that the environment is cooperative and thus the agents are trained to maximize the sum of rewards $\begin{array} { r } { R = \sum _ { t = 1 : T } \sum _ { i = 1 : N } r _ { i , t } } \end{array}$ across both agents. This can be thought of as a cooperative partially-observable Markov game (Littman (1994)).
|
| 43 |
+
|
| 44 |
+
We define a target language $L ^ { * } \in { \mathcal { L } }$ , usually corresponding to natural language, that we want our agents to learn (we further assume $L ^ { * }$ can be used to achieve high task reward). In this paper, we consider a language $L \in { \mathcal { L } }$ to be simply a set of valid messages $A _ { L }$ and a mapping between observations and messages in the environment, $L : O \times A _ { L } \mapsto [ 0 , 1 ]$ . For example, in an English image-based referential game (Section 4) this corresponds to the mapping between images and image descriptions in English. We are given a dataset $\mathcal { D }$ consisting of $| \mathcal D |$ (observation, action) pairs, corresponding to $N _ { e }$ ‘experts’ (for us, $N _ { e } = 2$ ) playing the game using the target language $L ^ { * }$ . Our goal is to train agents to achieve a high reward in the game while speaking language $L ^ { * }$ with an ‘expert’. Specifically, we want our agents to generalize and to perform well on examples that are not contained in $\mathcal { D }$ .
|
| 45 |
+
|
| 46 |
+
To summarize, we want agents that can perform well on a collaborative task with English-speaking humans, and we can train them using a supervised dataset $\mathcal { D }$ and via self-play.
|
| 47 |
+
|
| 48 |
+
# 3.2 SUPERVISED SELF-PLAY (S2P)
|
| 49 |
+
|
| 50 |
+
In recent years, there have been several approaches to language learning that have combined supervised or imitation learning with self-play. In this paper, we propose an umbrella term for these algorithms called supervised self-play (S2P). S2P requires two things: (1) a multi-agent environment where at least one agent can send messages over a dedicated communication channel, along with a reward function that measures how well the agents are doing at some task; and (2) a supervised dataset $\mathcal { D }$ of experts acting and speaking language $L ^ { * }$ in the environment (such that they perform well on the task). Given these ingredients, we define S2P below (see Figure 2).
|
| 51 |
+
|
| 52 |
+
Definition 3.1. Supervised self-play (S2P). Supervised self-play is a class of language learning algorithms that combines: (1) self-play updates in a multi-agent language environment, and (2) supervised updates on an expert dataset $\mathcal { D }$ .
|
| 53 |
+
|
| 54 |
+
S2P algorithms can differ in how they combine self-play and supervised learning updates on $\mathcal { D }$ . When supervised learning is performed before self-play, we refer to the dataset $\mathcal { D }$ as the seed data. Why might we want to train our agents via self-play? Won’t their language diverge from $L ^ { * } ?$ One way to intuitively understand why S2P is beneficial is to think in terms of constraints. In our set-up, there are two known constraints on the target language $L ^ { * }$ : (1) it is consistent with the samples from the supervised dataset $\mathcal { D }$ , and (2) $L ^ { * }$ can be used to obtain a high reward in the environment. Thus, finding $L ^ { * }$ can be loosely viewed as a constrained optimization problem, and enforcing both constraints should clearly lead to better performance.
|
| 55 |
+
|
| 56 |
+
# 3.3 ALGORITHMS FOR S2P
|
| 57 |
+
|
| 58 |
+
Here we describe several methods for S2P training. Our goal is not to exhaustively enumerate all possible optimization strategies, but rather provide a categorization of some well-known ways to combine self-play and supervised learning. To help describe these methods, we further split the seed dataset $\mathcal { D }$ into $\mathcal { D } _ { t r a i n }$ , which is used for training, and $\mathcal { D } _ { v a l }$ which is used for early-stopping. We also visualize the schedules in Figure 2.
|
| 59 |
+
|
| 60 |
+
Emergent communication with supervised fine-tuning (sp2sup): We first perform self-play updates until the learning converges on the task performance. It is then followed by supervised updates on $\mathcal { D } _ { t r a i n }$ until the listener performance converges on the dataset $\mathcal { D } _ { v a l }$ .
|
| 61 |
+
|
| 62 |
+
Supervised learning with self-play (sup2sp): This is the complement of the above method which involves doing supervised updates until convergence on $\mathcal { D } _ { v a l }$ followed by self-play updates until convergence on the task performance.
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 2: A visual representation of the different S2P methods.
|
| 66 |
+
|
| 67 |
+
Random updates $( \tt r a n d )$ : This is the method used in (Lazaridou et al., 2017). At each time step, we sample a bernoulli random variable $z \sim B e r n o u l l i ( q )$ where $q$ is fixed. If $z = 1$ , we perform one supervised update, else we do one self-play update, and repeat until both losses convergence on $\mathcal { D } _ { v a l }$ .
|
| 68 |
+
|
| 69 |
+
Scheduled updates (sched): We first pretrain the listener and the speaker until convergence on $\mathcal { D } _ { v a l }$ . Then we create a schedule, where we perform $l$ self-play updates followed by $m$ supervised updates, and repeat until convergence on the dataset.
|
| 70 |
+
|
| 71 |
+
Scheduled updates with speaker freezing (sched_ $\pmb { \mathcal { \tt { f r } } } \mathbf { z }$ ): This method is based on the findings of Lewis et al. (2017), who do sched S2P while freezing the parameters of the speaker during self-play to reduce the amount of language drift. In our case, we freeze the parameters of the speaker after the initial supervised learning.
|
| 72 |
+
|
| 73 |
+
Scheduled updates with random speaker freezing (sched_rand_frz): Experimentally, we noticed that sched_frz didn’t perform well in self-play. Thus, we introduce a variation, we sample a bernoulli random variable $z \sim B e r n o u l l i ( r )$ where $r$ is fixed. If $z = 1$ , we freeze the parameters of the speaker during both self-play and supervised learning, else we allow updates to the speaker as well.
|
| 74 |
+
|
| 75 |
+
# 3.4 POPULATION-BASED S2P (POP-S2P)
|
| 76 |
+
|
| 77 |
+
As explained above, the goal of S2P is to produce agents that follow dataset $\mathcal { D }$ while maximizing reward in the environment. However, there are many such policies satisfying these criteria. This results in a large space of possible solutions, that increases as the environment grows more complex (but decreases with increasing $| \mathcal { D } | )$ . Experimentally, we find that this can result in diverse agent policies. We show this in Figure 3 by training 50 randomly initialized agents on the image-based referential game (defined in Sec. 4) the agents can often make diverse predictions for a given image (Figure 3a) and achieve variable performance when playing with other populations with a slight preference towards their own partner (the diagonal in Figure 3b).
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 3: Results from training $5 0 \ : \mathrm { S 2 P }$ agents on the IBR game with $| \mathcal { D } | = 1 0 0 0 0$ . (a) The agents have a range of predictions on many images. (b) When playing with each other, the agents exhibit uneven performance (color is mean reward, yellow is higher), indicating policy variability.
|
| 81 |
+
|
| 82 |
+
ment S2P by training a population of $N$ agents, and subsequently aggregating them back into a single agent (the ‘student’). We call this population-based S2P (Pop-S2P). While there are many feasible ways of doing this, in this paper we train the populations by simply randomizing the initial seed, and we aggregate the populations using a simple form of policy distillation (Rusu et al., 2016). Another simple technique to boost performance is via ensembling where we simply take the majority prediction at each time step.
|
| 83 |
+
|
| 84 |
+
# 4 ENVIRONMENTS & IMPLEMENTATION DETAILS
|
| 85 |
+
|
| 86 |
+
We consider environments based on classical problems in emergent communication. These environments are cooperative and involve the interaction between a speaker, who makes an observation and sends a message, and a listener, who observes the message and makes a prediction (see Figure 1b). Our goal is to train a listener such that it achieves high reward when playing with an expert speaking the target language $L ^ { * }$ on inputs unseen during training.2
|
| 87 |
+
|
| 88 |
+
Environment 1: Object Reconstruction (OR) Our first game is a Lewis signaling game (Lewis, 1969) and a simpler version of the Task & Talk game from Kottur et al. (2017), with a single turn and a much larger input space. The speaker agent observes an object with a certain set of properties, and must describe the object to the listener using a sequence of words. The listener then attempts to reconstruct the object. More specifically, the input space consists of $p$ properties (e.g. shape, color) of $t$ types each (e.g. triangle, square). The speaker observes a symbolic representation of the input, consisting of the concatenation of $p = 6$ one-hot vectors, each of length $t = 1 0$ . The number of possible inputs scales as $t ^ { p }$ . We define the vocabulary size (length of each one-hot vector sent from the speaker) as $| V | = 6 0$ , and the number of words (fixed length message) sent to be $T = 6$ .
|
| 89 |
+
|
| 90 |
+
For our target language $L ^ { * }$ for this task, we programatically generate a perfectly compositional language, by assigning each object a unique word. In other words, to describe a ‘blue shaded triangle’, we create a language where the output description would be “blue, triangle, shaded”, in some arbitrary order. By ‘unique symbol’, we mean that no two properties are assigned the same word. The speaker and listener policies are parameterized using a 2-layer linear network (results were similar with added non-linearity and significantly worse with 1-layer linear networks) with 200 hidden units. During both supervised learning and self-play, the listener is trained to minimize the cross-entropy loss over property predictions.
|
| 91 |
+
|
| 92 |
+
Environment 2: Image-Based Referential game with natural language (IBR) Our second game is the communication task introduced in Lee et al. (2018). The speaker observes a target image $d ^ { * }$ , and must describe the image using a set of words. The listener observes the target image along with $D$ distractor images sampled uniformly at random from the training set (for us, $D = 9$ ), and the message $y _ { d ^ { * } }$ from the speaker, and is rewarded for correctly selecting the target image. For this game, the target language $L ^ { * }$ is English — we obtain English image descriptions using caption data from MS COCO and Flickr30k. We set the vocabulary size $| V | = 1 0 0$ , and filter out any descriptions that contain more than $30 \%$ unknown tokens while keeping the maximum message length $T$ to 15.
|
| 93 |
+
|
| 94 |
+
Similar to (Mordatch & Abbeel, 2018; Sukhbaatar et al., 2016), we train our agents end-to-end with backpropagation. Since the speaker sends discrete messages, we use the Straight-Through version of Gumbel-Softmax (Jang et al., 2017; Maddison et al., 2017) to allow gradient flow to the speaker during self-play $\left( \mathcal { I } _ { \mathrm { s e l f - p l a y } } \right)$ . The speaker’s predictions are trained on the ground truth English captions $m ^ { * }$ using the cross entropy loss $\mathcal { I } _ { \mathrm { s p k } }$ -supervised. The listener is trained using the cross-entropy loss $\mathcal { I } _ { \mathrm { l s n } }$ -supervised where the logits are the reciprocal of the mean squared error which was found to perform better than directly minimizing MSE loss in Lee et al. (2018). The mean squared error is taken over the listener’s image representation $b _ { l s n }$ of the distractor (or target) image and the message representation given as input. The loss functions are defined as:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\begin{array} { c } { { \mathcal { I } _ { \mathrm { s p k \mathrm { s u p e r v i s e d } } } ( d ^ { * } ) = \displaystyle - \sum _ { t = 1 } ^ { T } \log p _ { s p k } ( m _ { t } | m _ { < t } , d ^ { * } ) } } \\ { { \mathcal { I } _ { \mathrm { l s n \mathrm { - } s u p e r v i s e d } } ( m ^ { * } , d ^ { * } , D ) = \displaystyle - \sum _ { d = 1 } ^ { D + 1 } \log ( \mathsf { s o f t r m a x } ( 1 / p _ { l s n } ( m ^ { * } ) - b _ { \mathrm { l s n } } ( d ) ) ^ { 2 } ) } } \end{array}
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+

|
| 101 |
+
Figure 4: (a) Left: In the OR game, best performance (number of total samples required to achieve $9 5 \%$ test accuracy, lower is better) for S2P is achieved when all of the samples are in the seed. 0 on the $\mathbf { X }$ -axis corresponds to sp2sup and Optimal is the actual (minimum) number of samples required to solve this optimization problem (see Appenix B). Right: This is also the case in the IBR game, where performance is measured by the generalization accuracy using $1 0 \mathrm { k }$ total training samples (higher is better). (b) Adding more samples to initial supervised learning in the IBR game improves agents’ generalization to $L ^ { * }$ . (c) Even when we learn the perfect distribution with emergent communication in the OR game, it still performs worse than Pop-S2P (using sup2sp S2P).
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\mathcal { I } _ { \mathrm { s e l f - p l a y } } ( d ^ { * } , D ) = - \sum _ { d = 1 } ^ { D + 1 } \log ( \mathsf { s o f t m a x } ( 1 / p _ { l s n } ( y _ { d ^ { * } } ) - b _ { \mathrm { l s n } } ( d ) ) ^ { 2 } )
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where $y _ { d ^ { * } }$ is the concatenation of $T$ one-hot vectors $y _ { d ^ { * } } ^ { t } = \mathtt { S T - G u m b e l S o f t m a x } ( p _ { s p k } ^ { t } ) .$
|
| 108 |
+
|
| 109 |
+
We use the same architecture as described in Lee et al. (2018). The speaker and listener are parameterized by recurrent policies, both using an embedding layer of size 256 followed by a GRU (Cho et al., 2014) of size 512. We provide further hyperparameter details in Table 1 in the Appendix.
|
| 110 |
+
|
| 111 |
+
# 5 DO SUPERVISED LEARNING BEFORE SELF-PLAY
|
| 112 |
+
|
| 113 |
+
A central question in our work is how to combine supervised and self-play updates for effective pre-training of conversational agents. In this section, we study this question by conducting experiments with two schedules: training with emergent communication followed by supervised learning $( { \tt s p 2 s u p } )$ , and training with supervised learning followed by self-play (sup2sp). We also interpolate between these two regimes by performing the rand and sched on $0 < n < | \mathcal { D } |$ samples, followed by supervised fine-tuning on the remaining $| \mathcal { D } | - n$ samples.
|
| 114 |
+
|
| 115 |
+
Our first finding is that it is best to use all of your samples for supervised learning before doing self-play. This can be seen in Figure 4: when all of the samples are used first for supervised learning, the number of total samples required to solve the OR game drastically, and in the IBR game the accuracy for a fixed number of samples is maximized (Figure 4a). While this may seem to be common sense, it in fact runs counter to the prevailing wisdom in some emergent communication literature, where languages are emerged from scratch with the ultimate goal of translating them to natural language.
|
| 116 |
+
|
| 117 |
+
To better understand why it is best to do supervised learning first, we now conduct a set of targeted experiments using the environments from Section 4. Results of our experiments suggest three main explanations:
|
| 118 |
+
|
| 119 |
+
(1) Emerging a language is hard. For many environments, with emergent communication it’s often hard to find an equilibrium where the agents meaningfully communicate. The difficulty of ‘emergent language discovery’ has been well-known in emergent communication (Lowe et al., 2017), so we will only briefly discuss it here. In short, to discover a useful communication protocol agents have to coordinate repeatedly over time, which is difficult when agents are randomly initialized, particularly in environments with sparse reward. Compounding the difficulty is that, if neither agent communicates and both agents act optimally given their lack of knowledge, they converge to a Nash equilibrium called babbling equilibrium (Farrell & Rabin, 1996). This equilibrium must be overcome to learn a useful communication protocol. In S2P, the initial language supervision can help overcome the discovery problem, as it provides an initial policy for how agents could usefully communicate (Lewis et al., 2017).
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 5: Results from the OR game with 1 property and 10 types. When the supervised updates are performed first (supervised data available for words $0 - 3 )$ , then the self-play updates make sensible predictions for the unknown words $4 - 7$ . When the self-play updates are performed first, the subsequent supervised updates merely correct the predictions for words $1 - 4$ , without enforcing the constraint that each word should result in a separate type to solve the task.
|
| 123 |
+
|
| 124 |
+
(2) Emergent languages are different than natural language. Even if one does find an equilibrium where agents communicate and perform well on the task, the distribution of languages they find will usually be very different from natural language. This is a problem because, if the languages obtained through self-play are sufficiently different from $L ^ { * }$ , they will not be helpful for learning. This is seen for the OR game in Figure 4a, where 17 samples are required in the seed before S2P outperforms the supervised learning baseline. We speculate that this is due to the different pressures exerted during the emergence of artificial languages and human languages.
|
| 125 |
+
|
| 126 |
+
Thankfully, we can learn languages closer to $L ^ { * }$ by simply adding more samples to our initial supervised learning phase. We show this in Figure 4b, where we train populations of 50 agents on the IBR game and use Pop-S2P to produce a single distilled agent. With both 1K and 10K initial supervised samples, the distill agent generalizes to agents in the validation set of their population. However, the distilled agent trained with 10000 samples performs significantly better when playing with an expert agent speaking $L ^ { * }$ , indicating that the training agents from that population speak languages closer to $L ^ { * }$ .
|
| 127 |
+
|
| 128 |
+
(3) Starting with self-play violates constraints. Even if you have ‘perfect emergent communication’ that learns a distribution over languages under which $L ^ { * }$ has high probability, current methods of supervised fine-tuning do not properly learn from this distribution. What if we had all the correct learning pressures, such that we emerged a distribution over languages $\mathcal { L }$ with structure identical to $L ^ { * }$ , and then trained a Pop-S2P agent using this distribution? Surprisingly, we find that S2P with all of the samples in the seed performs better than even this optimistic case, in terms of providing useful information for training a Pop-S2P agent. We conduct an experiment in the OR game where we programmatically define a distribution over compositional languages $\mathcal { L } _ { c }$ , of which our target language $L ^ { * }$ is a sample. Each language $L \in \mathcal { L } _ { c }$ has the same structure and are obtained by randomly permuting the mapping between the word IDs and the corresponding type IDs, along with the order of properties in an utterance. Next, we compare two distilled policies using 50 populations: one is distilled from S2P populations (trained with $X$ samples), and the other is distilled from ‘perfect emergent communication’ and fine-tuned on $X$ samples. As can be seen in Figure 4c, we show that when we train a Pop-S2P agent on 50 of these compositional populations, we still need $3 X$ more samples than regular Pop-S2P (trained on ${ 5 0 } \thinspace \mathrm { S 2 P }$ agents with all of the samples in the seed) to reach $9 5 \%$ test accuracy3.
|
| 129 |
+
|
| 130 |
+
To understand why this happens, we conduct a case study in an even simpler setting: single-agent S2P in the OR game with $p = 1 , t = 1 0 , | V | = 1 0$ . We find that agents trained via emergent communication consistently learn to solve this task. However, as shown in Figure 5, when subsequently trained via supervised learning on $\mathcal { D }$ to learn $L ^ { * }$ , the learned language is no longer coherent (it maps different words to the same type) and doesn’t solve the task. On the other hand, agents trained first with supervised learning are able to learn a language that both solves the task and is consistent with $\mathcal { D }$ .
|
| 131 |
+
|
| 132 |
+
Intuitively, what’s happening is that the samples in $\mathcal { D }$ are also valid for solving the task, since we assume agents speaking $L ^ { * }$ can solve the task. Thus, self-play after supervised learning simply ‘fills in the gaps’ for examples not in $\mathcal { D }$ .4 Emergent languages that start with self-play, on the other hand, contain input-output mappings that are inconsistent with $L ^ { * }$ , which must be un-learned during subsequent supervised learning.
|
| 133 |
+
|
| 134 |
+
In theory, the above issue could be resolved using Pop-S2P; if the distilled agent could use the population of emergent languages to discover structural rules (e.g. discovering that the languages in the OR game in Figure 4c are compositional), it could use the samples from $\mathcal { D }$ to refine a posterior distribution over target languages that is consistent with these rules (e.g. learning the distribution of compositional languages consistent with $\mathcal { D }$ ). Current approaches to supervised fine-tuning in language, though, do not do this (Lazaridou et al., 2017; Lewis et al., 2017). An interesting direction for future work is examining how to apply Bayesian techniques to S2P.
|
| 135 |
+
|
| 136 |
+
# 6 EXPLORING VARIANTS OF S2P
|
| 137 |
+
|
| 138 |
+
# 6.1 POPULATION-BASED S2P
|
| 139 |
+
|
| 140 |
+
In this section, we aim to show that (1) S2P outperforms the supervised learning baseline, and (2) Pop-S2P outperforms S2P. We conduct our experiments in the more complex IBR game, since the agents must communicate in English, and measure performance by calculating the accuracy at different (fixed) numbers of samples. Our baseline is then the performance of a supervised learner on a fixed number of samples.
|
| 141 |
+
|
| 142 |
+
We show the results in Figure 6. We first note that, when both 1k and 10k samples are used for supervised learning, S2P (sched) outperforms the supervised learning baseline. We can also see that the population-based approach outperforms single agent S2P (sched) by a significant margin. We also compare our distillation method to an ensembling method that keeps all 50 populations at test time, and find that ensembling performs significantly better, although it is much less efficient. This suggests that there is room to push distilled Pop-S2P to even better performance.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 6: S2P (sched) outperforms the supervised baseline in the IBR game, and is in turn outperformed by PopS2P.
|
| 146 |
+
|
| 147 |
+
# 6.2 EXAMINING S2P SCHEDULES
|
| 148 |
+
|
| 149 |
+
In this section, we aim to: (1) evaluate several S2P schedules empirically on the IBR game; and (2) attain a better understanding of S2P through quantitative experiments.
|
| 150 |
+
|
| 151 |
+
Parameter freezing improves S2P We show the results comparing different S2P schedules in Figure 7a. We find that in this more complex game, the sup2sp S2P performs much worse than the other options. We also see that adding freezing slightly improves the performance on the target language (Figure 8 in the Appendix also shows that it converges more quickly). We hypothesize that this is because it reduces the language drift that is experienced during each round of self-play updates (Lee et al., 2019). Overall, however, the difference between different S2P schedules is relatively small, and it’s unclear if the same ordering will hold in a different domain.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 7: (a) Comparing test performances of different S2P methods on the IBR game. For each method, we picked the model that gave the best performance on $\mathcal { D } _ { v a l }$ . (b) 2D visualization of S2P (sched) performance over the course of training, in terms of performance on $L ^ { * }$ (vertical axis) and performance in self-play (horizontal axis). The zig-zag patterns indicates that most self-play updates result in a short-term decrease in target language performance. (c) Visualization of the role of the supervised and self-play updates in sched S2P.
|
| 155 |
+
|
| 156 |
+
Self-play acts as a regularizer What is the role of self-play in S2P? We can start to decipher this by taking a closer look at the sched S2P. We plot the training performance of this method in Figure 7b. Interestingly, we notice from the zig-zag pattern that the validation performance usually goes down after every set of self-play updates. However, the overall validation performance goes up after the next round of supervised updates. This is also reflected in the poor performance of the sup2sp S2P in Figure 6.
|
| 157 |
+
|
| 158 |
+
This phenomenon can be explained by framing self-play as a form of regularization: alternating between supervised and self-play updates is a way to satisfy the parallel constraints of ‘is consistent with the dataset $\mathcal { D } ^ { \ast }$ and ‘performs well on the task’. We visualize this pictorially in Figure 7b: while a set of self-play updates results in poor performance on $\mathcal { D }$ , eventually the learned language moves closer to satisfying both constraints.
|
| 159 |
+
|
| 160 |
+
# 7 DISCUSSION
|
| 161 |
+
|
| 162 |
+
In this work, we investigated the research question of how to combine supervised and self-play updates, with a focus on training agents to learn a language. However, this research question is not only important for language learning; it is also a important in equilibrium selection and learning social conventions (Lerer & Peysakhovich, 2019) in general games. For example, in robotics there may be a trade-off between performing a task well (moving an object to a certain place) and having your policy be interpretable by humans (so that they will not stumble over you). Examining how to combine supervised and self-play updates in these settings is an exciting direction for future work.
|
| 163 |
+
|
| 164 |
+
There are several axes of complexity not addressed in our environments and problem set-up. First, we consider only single-state environments, and agents don’t have to make temporally extended decisions. Second, we do not consider pre-training on large text corpora that are separate from the desired task (Radford et al., 2019; Devlin et al., 2018). Third, we limit our exploration of self-play to the multi-agent setting, which is not the case in works such as instruction following (Andreas & Klein, 2015). Introducing these elements may result in additional practical considerations for S2P learning, which we leave for future work. Our goal in this paper is not to determine the best method of S2P in all of these settings, but rather to inspire others to use the framing of ‘supervised self-play algorithms’ to make progress on sample efficient human-in-the-loop language learning.
|
| 165 |
+
|
| 166 |
+
# ACKNOWLEDGEMENTS
|
| 167 |
+
|
| 168 |
+
We are very grateful to Angeliki Lazaridou, with whom discussions at ICML 2019 and her simultaneous work (Lazaridou et al., 2020) shifted the direction of this work considerably. We also thank Jean Harb, Liam Fedus, Amy Zhang, Evgeny Naumov, Cinjon Resnick, Igor Mordatch, and others at MILA and Facebook AI Research for discussions related to the ideas in this paper. Special thanks to Arthur Szlam and Kavya Srinet for discussing their ongoing work with us. RL is supported in part by a Vanier Scholarship.
|
| 169 |
+
|
| 170 |
+
# REFERENCES
|
| 171 |
+
|
| 172 |
+
Jacob Andreas and Dan Klein. Alignment-based compositional semantics for instruction following. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 1165–1174, Lisbon, Portugal, September 2015. Association for Computational Linguistics. doi: 10.18653/v1/D15-1138. URL https://www.aclweb.org/anthology/D15-1138.
|
| 173 |
+
|
| 174 |
+
Kris Cao, Angeliki Lazaridou, Marc Lanctot, Joel Z Leibo, Karl Tuyls, and Stephen Clark. Emergent communication through negotiation. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id ${ . } =$ Hk6WhagRW.
|
| 175 |
+
|
| 176 |
+
Rahma Chaabouni, Eugene Kharitonov, Emmanuel Dupoux, and Marco Baroni. Anti-efficient encoding in emergent communication. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d\textquotesingle Alché-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems 32, pp. 6290–6300. Curran Associates, Inc., 2019. URL http://papers.nips.cc/paper/ 8859-anti-efficient-encoding-in-emergent-communication.pdf.
|
| 177 |
+
|
| 178 |
+
Maxime Chevalier-Boisvert, Dzmitry Bahdanau, Salem Lahlou, Lucas Willems, Chitwan Saharia, Thien Huu Nguyen, and Yoshua Bengio. BabyAI: First steps towards grounded language learning with a human in the loop. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ rJeXCo0cYX.
|
| 179 |
+
|
| 180 |
+
Kyunghyun Cho, Bart van Merriënboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using RNN encoder–decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1724–1734, Doha, Qatar, October 2014. Association for Computational Linguistics. doi: 10.3115/v1/D14-1179. URL https://www.aclweb.org/ anthology/D14-1179.
|
| 181 |
+
|
| 182 |
+
Edward Choi, Angeliki Lazaridou, and Nando de Freitas. Multi-agent compositional communication learning from raw visual input. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ rknt2Be0-.
|
| 183 |
+
|
| 184 |
+
Michael Cogswell, Jiasen Lu, Stefan Lee, Devi Parikh, and Dhruv Batra. Emergence of Compositional Language with Deep Generational Transmission. arXiv:1904.09067 [cs, stat], April 2019. arXiv: 1904.09067.
|
| 185 |
+
|
| 186 |
+
Harm de Vries, Kurt Shuster, Dhruv Batra, Devi Parikh, Jason Weston, and Douwe Kiela. Talk the walk: Navigating new york city through grounded dialogue. arXiv preprint arXiv:1807.03367, 2018.
|
| 187 |
+
|
| 188 |
+
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.
|
| 189 |
+
|
| 190 |
+
Katrina Evtimova, Andrew Drozdov, Douwe Kiela, and Kyunghyun Cho. Emergent communication in a multi-modal, multi-step referential game. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ rJGZq6g0-.
|
| 191 |
+
|
| 192 |
+
Joseph Farrell and Matthew Rabin. Cheap talk. Journal of Economic Perspectives, 10(3): 103–118, September 1996. doi: 10.1257/jep.10.3.103. URL http://www.aeaweb.org/ articles?id=10.1257/jep.10.3.103.
|
| 193 |
+
|
| 194 |
+
Jakob Foerster, Ioannis Alexandros Assael, Nando de Freitas, and Shimon Whiteson. Learning to Communicate with Deep Multi-Agent Reinforcement Learning. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 2137–2145. Curran Associates, Inc., 2016.
|
| 195 |
+
|
| 196 |
+
Laura Harding Graesser, Kyunghyun Cho, and Douwe Kiela. Emergent linguistic phenomena in multi-agent communication games. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 3691–3701, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1384. URL https:// www.aclweb.org/anthology/D19-1384.
|
| 197 |
+
|
| 198 |
+
Serhii Havrylov and Ivan Titov. Emergence of Language with Multi-agent Games: Learning to Communicate with Sequences of Symbols. 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. 2149–2159. Curran Associates, Inc., 2017.
|
| 199 |
+
|
| 200 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical Reparameterization with GumbelSoftmax. In International Conference on Learning Representations, 2017. URL https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ rkE3y85ee.
|
| 201 |
+
|
| 202 |
+
Natasha Jaques, Angeliki Lazaridou, Edward Hughes, Caglar Gulcehre, Pedro Ortega, Dj Strouse, Joel Z. Leibo, and Nando De Freitas. Social Influence as Intrinsic Motivation for Multi-Agent Deep Reinforcement Learning. In International Conference on Machine Learning, pp. 3040–3049, May 2019. URL http://proceedings.mlr.press/v97/jaques19a.html.
|
| 203 |
+
|
| 204 |
+
Simon Kirby. Iterated learning and the evolution of language. Current Opinion in Neurobiology, pp. 7, 2014.
|
| 205 |
+
|
| 206 |
+
Satwik Kottur, José Moura, Stefan Lee, and Dhruv Batra. Natural language does not emerge ‘naturally’ in multi-agent dialog. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 2962–2967, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. doi: 10.18653/v1/D17-1321. URL https://www.aclweb.org/ anthology/D17-1321.
|
| 207 |
+
|
| 208 |
+
Angeliki Lazaridou, Alexander Peysakhovich, and Marco Baroni. Multi-Agent Cooperation and the Emergence of (Natural) Language. In International Conference on Learning Representations, 2017. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ Hk8N3Sclg.
|
| 209 |
+
|
| 210 |
+
Angeliki Lazaridou, Karl Moritz Hermann, Karl Tuyls, and Stephen Clark. Emergence of linguistic communication from referential games with symbolic and pixel input. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id= HJGv1Z-AW.
|
| 211 |
+
|
| 212 |
+
Angeliki Lazaridou, Anna Potapenko, and Olivier Tieleman. Multi-agent communication meets natural language: Synergies between functional and structural language learning. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 7663–7674, Online, July 2020. Association for Computational Linguistics. URL https://www.aclweb.org/ anthology/2020.acl-main.685.
|
| 213 |
+
|
| 214 |
+
Jason Lee, Kyunghyun Cho, Jason Weston, and Douwe Kiela. Emergent translation in multiagent communication. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $_ { \cdot } =$ H1vEXaxA-.
|
| 215 |
+
|
| 216 |
+
Jason Lee, Kyunghyun Cho, and Douwe Kiela. Countering language drift via visual grounding. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 4376–4386, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1447. URL https://www.aclweb.org/anthology/D19-1447.
|
| 217 |
+
|
| 218 |
+
Adam Lerer and Alexander Peysakhovich. Learning existing social conventions via observationally augmented self-play. In Proceedings of the 2019 AAAI/ACM Conference on AI, Ethics, and Society, pp. 107–114. ACM, 2019.
|
| 219 |
+
|
| 220 |
+
David Lewis. Convention: A philosophical study. Harvard University Press, 1969.
|
| 221 |
+
|
| 222 |
+
Mike Lewis, Denis Yarats, Yann Dauphin, Devi Parikh, and Dhruv Batra. Deal or no deal? endto-end learning of negotiation dialogues. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 2443–2453, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. doi: 10.18653/v1/D17-1259. URL https: //www.aclweb.org/anthology/D17-1259.
|
| 223 |
+
|
| 224 |
+
Fushan Li and Michael Bowling. Ease-of-Teaching and Language Structure from Emergent Communication. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d\textquotesingle Alché-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems 32, pp. 15825–15835. Curran Associates, Inc., 2019. URL http://papers.nips.cc/paper/9714-ease-ofteaching-and-language-structure-from-emergent-communication.pdf.
|
| 225 |
+
|
| 226 |
+
Michael L Littman. Markov games as a framework for multi-agent reinforcement learning. In International Conference on Machine Learning, volume 157, pp. 157–163, 1994.
|
| 227 |
+
|
| 228 |
+
Ryan Lowe, YI WU, Aviv Tamar, Jean Harb, OpenAI Pieter Abbeel, and Igor Mordatch. MultiAgent Actor-Critic for Mixed Cooperative-Competitive Environments. 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. 6379–6390. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/7217-multi-agent-actor-critic-formixed-cooperative-competitive-environments.pdf.
|
| 229 |
+
|
| 230 |
+
Ryan Lowe, Jakob Foerster, Y-Lan Boureau, Joelle Pineau, and Yann Dauphin. On the pitfalls of measuring emergent communication. In Proceedings of the 18th International Conference on Autonomous Agents and MultiAgent Systems, AAMAS ’19, pp. 693–701. International Foundation for Autonomous Agents and Multiagent Systems, 2019. ISBN 978-1-4503-6309-9. URL http: //www.ifaamas.org/Proceedings/aamas2019/pdfs/p693.pdf.
|
| 231 |
+
|
| 232 |
+
Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. The Concrete Distribution: A Continuous Relaxation of Discrete Random Variables. In International Conference on Learning Representations, 2017. URL https://openreview.net/forum?id $\scriptstyle 1 = \ S 1$ jE5L5gl.
|
| 233 |
+
|
| 234 |
+
Igor Mordatch and Pieter Abbeel. Emergence of grounded compositional language in multi-agent populations. In AAAI Conference on Artificial Intelligence, 2018. URL https://aaai.org/ ocs/index.php/AAAI/AAAI18/paper/view/17007.
|
| 235 |
+
|
| 236 |
+
Mathijs Mul, Diane Bouchacourt, and Elia Bruni. Mastering emergent language: learning to guide in simulated navigation. arXiv:1908.05135 [cs], August 2019. arXiv: 1908.05135.
|
| 237 |
+
|
| 238 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. 2019. URL https://d4mucfpksywv.cloudfront.net/better-language-models/ language_models_are_unsupervised_multitask_learners.pdf.
|
| 239 |
+
|
| 240 |
+
Limor Raviv and Inbal Arnon. Systematicity, but not compositionality: Examining the emergence of linguistic structure in children and adults using iterated learning. Cognition, 181:160–173, December 2018. ISSN 0010-0277.
|
| 241 |
+
|
| 242 |
+
Cinjon Resnick\*, Abhinav Gupta\*, Jakob N. Foerster, Andrew M. Dai, and Kyunghyun Cho. Capacity, bandwidth, and compositionality in emergent language learning. ArXiv, abs/1910.11424, 2019.
|
| 243 |
+
|
| 244 |
+
Andrei A Rusu, Sergio Gomez Colmenarejo, Caglar Gulcehre, Guillaume Desjardins, James Kirkpatrick, Razvan Pascanu, Volodymyr Mnih, Koray Kavukcuoglu, and Raia Hadsell. Policy distillation. In International Conference on Learning Representations, 2016. URL https: //arxiv.org/pdf/1511.06295.pdf.
|
| 245 |
+
|
| 246 |
+
Amanpreet Singh, Tushar Jain, and Sainbayar Sukhbaatar. Individualized controlled continuous communication model for multiagent cooperative and competitive tasks. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id= rye7knCqK7.
|
| 247 |
+
|
| 248 |
+
Kenny Smith, Henry Brighton, and Simon Kirby. Complex Systems In Language Evolution: The Cultural Emergence Of Compositional Structure. Advances in Complex Systems (ACS), 6(04): 537–558, 2003. doi: 10.1142/S0219525903001055. URL https://ideas.repec.org/a/ wsi/acsxxx/v06y2003i04ns0219525903001055.html.
|
| 249 |
+
|
| 250 |
+
Sainbayar Sukhbaatar, Arthur Szlam, and Rob Fergus. Learning multiagent communication with backpropagation. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 2244–2252. Curran Associates, Inc., 2016. URL http://papers.nips.cc/paper/6398-learning-multiagentcommunication-with-backpropagation.pdf.
|
| 251 |
+
|
| 252 |
+
Olivier Tieleman, Angeliki Lazaridou, Shibl Mourad, Charles Blundell, and Doina Precup. Shaping representations through communication. 2018. URL https://openreview.net/pdf?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ HkzL4hR9Ym.
|
| 253 |
+
|
| 254 |
+
# A HYPERPARAMETERS
|
| 255 |
+
|
| 256 |
+
We provide hyperparameter details in Table 1.
|
| 257 |
+
|
| 258 |
+
Table 1: Hyperparameters considered in S2P training.
|
| 259 |
+
|
| 260 |
+
<table><tr><td>Hyperparameter</td><td>Values</td></tr><tr><td>Learning rate</td><td>1e-2,1e-3,2e-3, 6e-3,1e-4, 5e-4,6e-4</td></tr><tr><td>Model architecture</td><td>Linear, Bilinear, Non-Linear</td></tr><tr><td>Number of encoders (perfect emcomm)</td><td>1,2,5,10,20,50,100,200,500,1000</td></tr><tr><td>Hidden layer size (Linear)</td><td>200,500,1000</td></tr><tr><td>Number of encoders (Pop-S2P)</td><td>20,40,50,60,80,100</td></tr><tr><td>Number of distractors</td><td>1,4,9</td></tr><tr><td>GRU hidden size Word embedding size</td><td>256</td></tr><tr><td>Image embedding size (from pretrained Resnet50)</td><td>512 2048</td></tr><tr><td>Batch size</td><td>1,512,1000</td></tr><tr><td>Random seeds</td><td></td></tr><tr><td>Optimizer</td><td>0,1, 2,3,4</td></tr><tr><td>Dropout</td><td>Adam, SGD</td></tr><tr><td>Gumbel relaxation temperature</td><td>0, 0.3</td></tr><tr><td>Vocabulary size</td><td>1</td></tr><tr><td>Max sentence length</td><td>100,200,500,1000,5000</td></tr><tr><td>m in sched</td><td>12,15,20,30, 50</td></tr><tr><td>lin sched</td><td>0,1, 30,40, 50, 70</td></tr><tr><td></td><td>0,30,40,50</td></tr><tr><td>qin rand</td><td>0.75</td></tr><tr><td>rinsched_rand_frz</td><td>0.5</td></tr><tr><td>Number of initial supervised steps (pretraining)</td><td>0,1000,2000,3000,5000</td></tr></table>
|
| 261 |
+
|
| 262 |
+
# B CALCULATION OF OPTIMAL SAMPLE COMPLEXITY IN OR GAME
|
| 263 |
+
|
| 264 |
+
Here we provide a quick calculation for how quickly a human might learn a new compositional language $L$ in the OR game in as few examples as possible, which we use as a baseline in Figure 4a. We assume a OR game with $p = 6$ properties, $t = 1 0$ types, $T = 6$ words sent per message (concatenated together), and $| V | = 6 0$ vocabulary size. If this language $L$ is compositional, then each word in the vocabulary is assigned to 1 type. Thus, we need to learn 60 total assignments. In this analysis we assume we can construct (i.e. hand-design) the samples seen by the human, and thus the final number should be considered something like a lower bound.
|
| 265 |
+
|
| 266 |
+
Since $T = 6$ , we get information about 6 word type assignments for every sample. However, this information is entangled as we don’t know which word corresponded to which type. Thus, we (1) divide the problem up by first constructing 9 (word sequence, object) sample pairs where none of the object types overlap between each sample. With this information, we are able to narrow down the word $\gets$ type assignments into 10 groups of 6 (that is, in each group we have 6 words corresponding to 6 types, but we don’t know which type belongs to which word). Note we don’t need 10 samples as the last one can be inferred by exclusion. (2) We then construct 5 more samples where each type belongs to a separate group. We can do this because $t > p$ . Because each type belongs to a separate group, cross-referencing the words observed from samples in (1) and (2) uniquely defines each word $\gets$ type assignment. Note again we don’t need 6 samples as the last one can be inferred by exclusion. This gives us a total of $9 + 5 = 1 4$ samples.
|
| 267 |
+
|
| 268 |
+
# C ADDITIONAL PLOTS
|
| 269 |
+
|
| 270 |
+
We show training curves for various S2P schedules.
|
| 271 |
+
|
| 272 |
+

|
| 273 |
+
Figure 8: Training curves for various S2P methods in the IBR game described in $\ S 4$
|
md/train/rdT5GV-LnZU/rdT5GV-LnZU.md
ADDED
|
@@ -0,0 +1,529 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Not All Attention Is All You Need
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Beyond the success story of pre-trained language models (PrLMs) in recent natu
|
| 11 |
+
2 ral language processing, they are susceptible to over-fitting due to unusual large
|
| 12 |
+
3 model size. To this end, dropout serves as a therapy. However, existing methods
|
| 13 |
+
4 like random-based, knowledge-based and search-based dropout are more general
|
| 14 |
+
5 but less effective onto self-attention based models, which are broadly chosen as
|
| 15 |
+
6 the fundamental architecture of PrLMs. In this paper, we propose a novel dropout
|
| 16 |
+
7 method named AttendOut to let self-attention empowered PrLMs capable of more
|
| 17 |
+
8 robust task-specific tuning. We demonstrate that state-of-the-art models with elab
|
| 18 |
+
9 orate training design may achieve much stronger results. We verify the universal
|
| 19 |
+
10 ity of our approach on extensive natural language processing tasks.
|
| 20 |
+
|
| 21 |
+
# 11 1 Introduction
|
| 22 |
+
|
| 23 |
+
12 Self-attention network (SAN) empowered models like Transformer [1] have achieved remarkable
|
| 24 |
+
13 success in recent natural language processing, which have been broadly chosen as basic architec
|
| 25 |
+
14 ture in a series successful pre-trained language models (PrLMs) such as BERT [2], RoBERTa [3],
|
| 26 |
+
15 ALBERT [4], ELECTRA [5], DeBERTa [6] and GPT [7].
|
| 27 |
+
16 SAN has drawn a great deal of curiosity on its conceptually simple but powerful attention mecha
|
| 28 |
+
17 nism. However, SAN still remains a black box and more and more works attempt to unveil its inner
|
| 29 |
+
18 principle, where the biggest mystery lies in its attention matrix. Our work is inspired by several
|
| 30 |
+
19 recent discoveries which turn our views up and down. [8, 9] show that fixed Gaussian or even ran
|
| 31 |
+
20 dom alignment attention matrix may rival standard SAN, while more recently, [10, 11] prove that
|
| 32 |
+
21 SAN may encounter a rank collapse with deepening of layers. A more concrete explanation is in
|
| 33 |
+
22 formation diffusion [12], which states that the input vectors are progressively assimilating through
|
| 34 |
+
23 continuously making self-attention. We attribute these problems to the sever co-adaption [13] be
|
| 35 |
+
24 tween attention elements, a form of over-fitting onto SAN. As a result, self-attention empowered
|
| 36 |
+
25 PrLMs hardly bring into their full play, especially for the fine-tuning stage, where task-specific data
|
| 37 |
+
26 is always with limited capacity.
|
| 38 |
+
27 Dropout [13] serves as a therapy to deal with the problem, by randomly shutting down a set of units
|
| 39 |
+
28 during training stage. When specified on self-attention, dropout is equivalent to adding attention
|
| 40 |
+
29 mask to the attention matrix. However, random-based dropout methods like vanilla Dropout [13] or
|
| 41 |
+
30 DropConnect [14] are all subject to a pre-defined distribution like Bernoulli or Gaussian, longing for
|
| 42 |
+
31 exhaustive grid search for an optimal probability. Thereby a variety of works attempt to utilize man
|
| 43 |
+
32 ual attention mask to obtain a more informative attention matrix [15, 16], whereas all these methods
|
| 44 |
+
33 require prior knowledge on model or data, which could be costly or unavailable. More recently, the
|
| 45 |
+
34 rise of Neural Architecture Search [17, 18] gives birth to search-based dropout [19], which automat
|
| 46 |
+
35 ically chooses an optimal dropout pattern based on additional validation performances. However,
|
| 47 |
+
36 the huge search space brings heavy consumption and more importantly, the obtained dropout pattern
|
| 48 |
+
37 is still fixed with a pre-defined probability, which is static and sample-independent, ignoring the
|
| 49 |
+
38 dynamics within different samples. In this paper, we focus on task-specific tuning of self-attention
|
| 50 |
+
39 empowered PrLMs and propose a novel dropout method named AttendOut onto attention layers,
|
| 51 |
+
40 which leverages self-attention to dynamically generate dropout patterns for each attention layer as
|
| 52 |
+
41 well as each sample through an end-to-end manner. We demonstrate that the previous state-of-the-art
|
| 53 |
+
42 models with elaborate training design may achieve much stronger results. We verify the universality
|
| 54 |
+
43 of our approach on extensive natural language processing tasks. Guided by AttendOut, we pro
|
| 55 |
+
44 pose another two attention regularizers to enable simple but effective performance boost with no
|
| 56 |
+
45 additional cost.
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 1: A diagram of different dropout methods, where $p$ refers to the dropout probabilities while $R$ refers to the reward in reinforcement learning.
|
| 60 |
+
|
| 61 |
+
# 46 2 Related Work
|
| 62 |
+
|
| 63 |
+
47 Dropout is proposed to alleviate over-fitting problem in DNNs. Apart from vanilla Dropout [13]
|
| 64 |
+
48 and DropConnect [14] which randomly shut down a subset of activations or hidden weights, there
|
| 65 |
+
49 are a variety of dropout methods proposed, e.g. Alpha Dropout [20], Variational Dropout [21, 22],
|
| 66 |
+
50 Adversarial Dropout [23], Energy-based Dropout [24]. However, random-based dropout encounters
|
| 67 |
+
51 slow experiment cycle due to inevitable grid search. Inspired by Neural Architecture Search [17, 18],
|
| 68 |
+
52 [19] proposes AutoDropout to automate the process of designing dropout patterns. A similar line of
|
| 69 |
+
53 work is dynamic tuning of dropout, which further allows adaptive dropout probabilities under differ
|
| 70 |
+
54 ent training moments. [25] proposes Concrete Dropout with continuous relaxation under Concrete
|
| 71 |
+
55 distribution, [26] proposes Learnable Bernoulli Dropout under discrete Bernoulli distribution using
|
| 72 |
+
56 Augment-REINFORCE-Merge estimator [27], while [28] proposes Context Dropout by optimizing
|
| 73 |
+
57 the evidence lower bound.
|
| 74 |
+
58 With self-attention network continuously stands out, dropout is being explored onto self-attention
|
| 75 |
+
59 based models. LayerDrop [29] randomly removes entire SAN blocks, while DropHead [30], Head
|
| 76 |
+
60 Mask [31] randomly remove certain attention heads. UniDrop [32] unifies these dropout methods,
|
| 77 |
+
61 which facilitates text classification and machine translation tasks. Additionally, prior knowledge is
|
| 78 |
+
62 shown highly effective for guiding attention dropout as in SG-Net [15] and SIT [16], which inten
|
| 79 |
+
63 tionally discard syntax-unrelated attention units with the help of structural clues.
|
| 80 |
+
|
| 81 |
+
# 64 3 Preliminaries
|
| 82 |
+
|
| 83 |
+
65 In this section, we provide the preliminaries for the proposed approach. We first review the details
|
| 84 |
+
66 of self-attention proposed in [1]. Based on the specific architecture, we elaborate the concerned
|
| 85 |
+
67 attention dropout.
|
| 86 |
+
|
| 87 |
+
# 3.1 Self-Attention
|
| 88 |
+
|
| 89 |
+
69 Generally, a standard SAN block is mainly composed of an attention layer and several feed-forward
|
| 90 |
+
70 layers (actually there are residual connection, layer normalization, etc. as well). The input of it is a
|
| 91 |
+
71 sentence or batch of sentences of length $n$ , which is first embedded through an embedding layer. The
|
| 92 |
+
72 embedded input $E$ may go through three linear projections $W _ { Q }$ , $W _ { K }$ and $W _ { V }$ referring to query, key
|
| 93 |
+
73 and value layers respectively, and then obtain three matrices $Q$ , $K$ and $V$ referring to the query, key
|
| 94 |
+
74 and value components of self-attention. Subsequently, a dot-product of $Q$ and $K$ is taken and then
|
| 95 |
+
75 normalized using Sof tmax function to obtain the attention matrix $A$ . Then another dot-product of
|
| 96 |
+
76 $A$ and $V$ follows. The mentioned calculation can be formalized as follow:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
A t t e n t i o n ( Q , K , V ) = S o f t m a x \left( \frac { Q \cdot K ^ { T } } { \sqrt { d _ { k } } } \right) \cdot V
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where 77 $\sqrt { d _ { k } }$ is a scaling factor. Finally, the self-attention layer ends up with a linear projection $W _ { O }$ 78 to output.
|
| 103 |
+
|
| 104 |
+
79 During the aforementioned process, we highlight a key phases, that is the attention matrix $A$ , which
|
| 105 |
+
80 is a dot-product of $n \times n$ from two separate linear projections $W _ { Q }$ and $W _ { K }$ . $A$ is viewed as a feature
|
| 106 |
+
81 map which stores the node-to-node significance in different scores. Various works show that there
|
| 107 |
+
82 hides implicit but highly needed semantic clues.
|
| 108 |
+
|
| 109 |
+
# 3.2 Dropout on Self-Attention
|
| 110 |
+
|
| 111 |
+
84 Our dropout will apply to the attention matrix of the concerned attention layer. We first define two
|
| 112 |
+
85 specific dropouts onto Eq. 1, where both implementations are just as simple as in standard dropout
|
| 113 |
+
86 via a mask matrix $M$ .
|
| 114 |
+
|
| 115 |
+
Weights Dropout. Weights dropout is applied to the attention matrix after Sof tmax function by default, which is formulated as:
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
{ \cal A } t t e n t i o n ( Q , K , V ) = \left( S o f t m a x \left( { \frac { Q \cdot K ^ { T } } { \sqrt { d _ { k } } } } \right) \odot { \cal M } \right) \cdot V
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
9 where $M$ is a binary matrix with elements in $\{ 0 , 1 \}$ and $\odot$ refers to element-wise multiplication.
|
| 122 |
+
|
| 123 |
+
90 Scores Dropout. Different from weights dropout, scores dropout is applied before Sof tmax func
|
| 124 |
+
91 tion, which is formulated as:
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
A t t e n t i o n ( Q , K , V ) = S o f t m a x \left( \frac { Q \cdot K ^ { T } } { \sqrt { d _ { k } } } + M \right) \cdot V
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
92 Since the outer Sof tmax, we conduct an addition instead of multiplication, where elements in $M$
|
| 131 |
+
93 are set to 0 for kept units and $- i n f$ for removed ones. Note that the Sof tmax takes a similar
|
| 132 |
+
94 function as the scaling factor of $1 / p$ in vanilla Dropout [13], which balances the expectation of the
|
| 133 |
+
95 network.
|
| 134 |
+
96 Weights dropout is commonly used in self-attention based models, while scores dropout is less
|
| 135 |
+
97 explored, which is our focus in this paper. For scores dropout, we need to pay attention to a special
|
| 136 |
+
98 case, when all attentions are shut down, that is, all elements in $M$ equal to $- i n f$ at the same time.
|
| 137 |
+
99 Such case can be formulated as follow:
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
A t t e n t i o n ( Q , K , V ) = S o f t m a x \left( M \right) \cdot V
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
100 Note that Sof tmax $( M )$ obtains to a constant matrix, where each unit equals to $1 / n$ . In this case,
|
| 144 |
+
101 the attention matrix is fixed and consequently the $W _ { Q }$ , $W _ { K }$ and dot-product in between are skipped.
|
| 145 |
+
|
| 146 |
+
# 102 4 Methodology
|
| 147 |
+
|
| 148 |
+
103 In this paper, we propose Attention differentiable dropOut (AttendOut), which contributes technique
|
| 149 |
+
104 novelty in the following way: (1) dynamic and task-specific tuned; (2) end-to-end trained; (3) gra
|
| 150 |
+
105 dient optimized dropout method onto self-attention empowered PrLMs. We elaborate our approach
|
| 151 |
+
106 with two parts, in which the first is composition, while the second is training algorithm.
|
| 152 |
+
|
| 153 |
+
# 4.1 Elements of AttendOut
|
| 154 |
+
|
| 155 |
+
108 Our training architecture is composed of three modules, A-Net (Attacker), D-Net (Defender) and
|
| 156 |
+
109 G-Net (Generator). D-Net and A-Net are two identical models and trained simultaneously through
|
| 157 |
+
110 standard gradient descent, while G-Net is a learnable dropout maker and trained through policy
|
| 158 |
+
111 gradient. Now we elaborate each of them.
|
| 159 |
+
112 Defender - Attacker As suggested, defender and attacker are two competitors playing a game
|
| 160 |
+
113 with each other on specific criteria, e.g. training accuracy, training loss. Specifically, D-Net and A
|
| 161 |
+
114 Net are two identical self-attention empowered PrLMs, e.g. BERT, RoBERTa. However, they follow
|
| 162 |
+
115 different dropout strategies. D-Net receives regular dropout as default in specific models, while A
|
| 163 |
+
116 Net receives additional dropout decision from G-Net onto its corresponding attention layers.
|
| 164 |
+
117 Generator G-Net acts as a dropout maker through generating a mask matrix for each attention
|
| 165 |
+
118 layer during training stage. As aforementioned, the common dropout strategies rely on randomness,
|
| 166 |
+
119 which intends to shut down the co-adaption but not powerful enough. However, our dropout maker
|
| 167 |
+
120 is an agent which is able to intelligently choose and learn dropout patterns for each sample. Specif
|
| 168 |
+
121 ically, after training for a fixed number of steps, we conduct evaluation for both A-Net and D-Net.
|
| 169 |
+
122 When A-Net obtains a higher score than D-Net, which means attacker wins the game, G-Net will be
|
| 170 |
+
123 rewarded positively. When defender wins, G-Net will be punished with a negative reward. In con
|
| 171 |
+
124 sequence, G-Net learns appropriate dropout patterns through the game between D-Net and A-Net,
|
| 172 |
+
125 while assisting A-Net to win the game. On the other hand, A-Net needs to be stronger when training
|
| 173 |
+
126 under such powerful dropout, which makes it much more robust from over-fitting. Compared to
|
| 174 |
+
127 search-based dropout, G-Net is triggered by the difference between two model derivatives with and
|
| 175 |
+
128 without dropout, instead of the final feedback on validation set, which makes it end-to-end-possible
|
| 176 |
+
129 and sample-dependent.
|
| 177 |
+
130 The design of G-Net is the most delicate part, which is also a self-attention based model with iden
|
| 178 |
+
131 tical number of layers with D-Net and A-Net. However, we make several improvements. 1) G-Net
|
| 179 |
+
132 only exports the attention scores from attention layers with no extra output layers, from which we
|
| 180 |
+
133 apply Gumbel [33, 34] to sample the actions to obtain the dropout mask. 2) G-Net only makes
|
| 181 |
+
134 one-head attention and share one group of parameters for all attention layers. 3) G-Net is excluded
|
| 182 |
+
135 of feed-forward layers, which may obscure the impact of self-attention [11, 10].
|
| 183 |
+
|
| 184 |
+
# 4.2 Training with AttendOut
|
| 185 |
+
|
| 186 |
+
37 The core of training with AttendOut is to find a way to optimize G-Net, which receives signals from
|
| 187 |
+
38 the difference between D-Net and A-Net. Supposing there is a list of dropout actions by G-Net:
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
a _ { 1 : T } = \{ a _ { 1 } , a _ { 2 } , a _ { 3 } , \cdot \cdot \cdot , a _ { T } \}
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
139 where $T$ refers to the number of samples, for each action $a _ { t }$ , G-Net may achieve a reward $r _ { t }$ . The
|
| 194 |
+
140 optimization objective is to maximize the overall rewards of list $a _ { 1 : T }$ , denoted as $R$ , that is:
|
| 195 |
+
|
| 196 |
+
$$
|
| 197 |
+
J ( \theta _ { G } ) = E _ { P ( a _ { 1 : T } ; \theta _ { G } ) } [ R ]
|
| 198 |
+
$$
|
| 199 |
+
|
| 200 |
+
where 141 $\begin{array} { r } { R = \sum _ { t = 1 } ^ { T } r _ { t } } \end{array}$ . Since $R$ is non-differentiable, we use policy gradient to update $\theta _ { G }$
|
| 201 |
+
|
| 202 |
+
$$
|
| 203 |
+
\nabla _ { \theta _ { G } } J ( \theta _ { G } ) = \sum _ { t = 1 } ^ { T } E _ { P ( a _ { 1 : T } ; \theta _ { G } ) } [ \nabla _ { \theta _ { G } } \log P ( a _ { t } | a _ { ( t - 1 ) : 1 } ; \theta _ { G } ) r _ { t } ]
|
| 204 |
+
$$
|
| 205 |
+
|
| 206 |
+
142 The above equation could be approximated as:
|
| 207 |
+
|
| 208 |
+
$$
|
| 209 |
+
\frac { 1 } { m } \sum _ { k = 1 } ^ { m } \sum _ { t = 1 } ^ { T } \nabla _ { \theta _ { G } } \log P ( a _ { t } | a _ { ( t - 1 ) : 1 } ; \theta _ { G } ) r _ { t }
|
| 210 |
+
$$
|
| 211 |
+
|
| 212 |
+
143 For a model with $n$ attention layers, each dropout decision is composed of $n$ inner decisions of each
|
| 213 |
+
144 layer. Additionally, each attention layer contains an attention matrix of $l \times l$ , namely $l ^ { 2 }$ elements
|
| 214 |
+
145 dropped or kept. Thus, we denote a dropout unit as $d ^ { i j }$ , where $i$ refers to the $i ^ { t h }$ layer while $j$ refers
|
| 215 |
+
146 to the $j ^ { t h }$ element of the attention matrix.
|
| 216 |
+
147 However, $n l ^ { 2 }$ dropout units bring a huge space, which makes it impossible to calculate the joint prob
|
| 217 |
+
148 ability. To this end, we introduce the independence assumption that each dropout unit is independent
|
| 218 |
+
149 with each other. Under the relaxation, we can make the following probability likelihood:
|
| 219 |
+
|
| 220 |
+
$$
|
| 221 |
+
\log P ( a _ { t } | a _ { ( t - 1 ) : 1 } ; \theta _ { G } ) = \frac { 1 } { n l ^ { 2 } } \sum _ { i , j } \log P ( d _ { t } ^ { i j } | d _ { ( t - 1 ) : 1 } ^ { i j } ; \theta _ { G } )
|
| 222 |
+
$$
|
| 223 |
+
|
| 224 |
+
where the summation 150 $\textstyle \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { l ^ { 2 } }$ is briefly denoted as $\textstyle \sum _ { i , j }$
|
| 225 |
+
|
| 226 |
+
151 Thus, the final gradient could be formalized as:
|
| 227 |
+
|
| 228 |
+
$$
|
| 229 |
+
\nabla _ { \theta _ { G } } J ( \theta _ { G } ) = \frac { 1 } { m } \frac { 1 } { n l ^ { 2 } } \sum _ { k = 1 } ^ { m } \sum _ { t = 1 } ^ { T } \sum _ { i , j } \nabla _ { \theta _ { G } } \log P ( d _ { t } ^ { i j } | d _ { ( t - 1 ) : 1 } ^ { i j } ; \theta _ { G } ) ( r _ { t } - b )
|
| 230 |
+
$$
|
| 231 |
+
|
| 232 |
+
152 where $b$ is a baseline function of moving average [35]. Note that we do not apply additional regular
|
| 233 |
+
153 izers like L0 and L1 penalty, which impose unnecessary bias.
|
| 234 |
+
154 Algorithm 1 summarizes the overall procedure of training PrLMs with AttendOut. We first initialize
|
| 235 |
+
155 all three networks. Note that D-Net and A-Net should be kept identical at the beginning of each
|
| 236 |
+
156 training step. A straightforward strategy is to choose the better one to cover the other. To add
|
| 237 |
+
157 randomness, we sample from D-Net and A-Net based on their evaluation performances, with higher
|
| 238 |
+
158 probability for the better one. Then for each step, D-Net and A-Net are fed with the same mini-batch
|
| 239 |
+
159 data and updated via standard gradient descent, meanwhile each batch will be cached. After training
|
| 240 |
+
160 for $T$ steps, which we denote as a dropout step, both D-Net and A-Net are evaluated on additional
|
| 241 |
+
161 validation samples, which could be development set data, noisy training data or a small split of train
|
| 242 |
+
162 ing data. In this paper, we simply use development set. For efficiency, we make random sampling
|
| 243 |
+
163 on it to retrieve $T$ samples for evaluation. Based on the evaluation scores, G-Net is rewarded with
|
| 244 |
+
164 $\{ r _ { 1 } , r _ { 2 } , r _ { 3 } , \cdot \cdot \cdot , r _ { T } \}$ and updated via Eq. 5. At the end of each dropout step, the cached samples
|
| 245 |
+
165 will be released and D-Net and A-Net will be re-initialized.
|
| 246 |
+
|
| 247 |
+
# Algorithm 1 AttendOut
|
| 248 |
+
|
| 249 |
+
Input: Attacker $A$ , Defender $D$ , Generator $G$ , dropout
|
| 250 |
+
step $T$
|
| 251 |
+
1: initialize $\theta _ { D }$ , $\theta _ { A }$ , $\theta _ { G }$ , where $\theta _ { D } = \theta _ { A }$
|
| 252 |
+
2: for each training step do
|
| 253 |
+
3: $\theta _ { D } \theta _ { D } ^ { \prime }$
|
| 254 |
+
4: dropout $A$ with $G$ via Eq. 3
|
| 255 |
+
5: $\theta _ { A } \theta _ { A } ^ { \prime }$
|
| 256 |
+
6: for each $T$ steps do
|
| 257 |
+
7: evaluate $D$ and $A$ and reward $G$
|
| 258 |
+
8: $\theta _ { G } \theta _ { G } ^ { \prime }$ via Eq. 5
|
| 259 |
+
9: initialize $\theta _ { D }$ , $\theta _ { A }$ for next step
|
| 260 |
+
10: end for
|
| 261 |
+
11: end for
|
| 262 |
+
167 Resource Usage We notice that training PrLMs with AttendOut may sacrifice time and memory
|
| 263 |
+
168 cost. The detailed resource usage is shown in Appendix. Taking RoBERTa as an example, the
|
| 264 |
+
169 algorithm requires two RoBERTa models as well as a smaller self-attention based generator, which
|
| 265 |
+
170 is $\mathrm { { \bar { 1 } / 3 } }$ of RoBERTa size. Considering cached samples, roughly speaking, AttendOut requires twice
|
| 266 |
+
171 graphic memory as well as twice training time compared to a single model, which is a middle speed
|
| 267 |
+
172 line between random-based dropout and neural architecture search (Dropout [13] $<$ AttendOut $\ll$
|
| 268 |
+
173 AutoDropout [19]). However, AttendOut contributes to remarkable performance gain compared to
|
| 269 |
+
174 other attention dropout methods.
|
| 270 |
+
175 Pre-training Our approach is both feasible for both fine-tuning and pre-training stage of PrLMs
|
| 271 |
+
176 but expensive for the latter. However, we try to serve for the most delicate part of concerned issue,
|
| 272 |
+
177 since pre-training is generally done on large-scale data with modest training epochs, which makes it
|
| 273 |
+
178 less susceptible from over-fitting.
|
| 274 |
+
|
| 275 |
+

|
| 276 |
+
Figure 2: Architecture of G-Net.
|
| 277 |
+
|
| 278 |
+
Table 1: Results (test / dev) of GLUE sub-tasks.
|
| 279 |
+
|
| 280 |
+
<table><tr><td>Model</td><td>SST-2 Acc</td><td>MRPC F1</td><td>QNLI Acc</td><td>MNLI-mm Acc</td><td>CoLA Mcc</td></tr><tr><td>BERT</td><td>92.9 / 92.2</td><td>86.6 / 86.3</td><td>89.7 /88.9</td><td>83.3 /84.0</td><td>51.2 / 58.8</td></tr><tr><td>+ AtendOut</td><td>93.6 / 93.8</td><td>88.1 / 87.5</td><td>90.2 / 91.1</td><td>84.2 /84.6</td><td>57.4 / 60.9</td></tr><tr><td>RoBERTa</td><td>95.4 / 94.4</td><td>90.5 /90.2</td><td>92.9 /92.0</td><td>86.1 /86.6</td><td>61.3 / 62.5</td></tr><tr><td>+ AtendOut</td><td>96.2 / 95.1</td><td>91.2 / 90.9</td><td>93.3 /93.0</td><td>87.3 /87.8</td><td>63.0 / 63.8</td></tr></table>
|
| 281 |
+
|
| 282 |
+
Table 2: Results of IMDB, CoNLL03, PTB and SWAG respectively.
|
| 283 |
+
|
| 284 |
+
<table><tr><td>Model</td><td>IMDB Acc</td><td>CoNLL03 F1</td><td>PTB F1</td><td>SWAG Acc</td></tr><tr><td>BERT</td><td>92.2</td><td>94.1</td><td>95.4</td><td>81.1</td></tr><tr><td>+ AttendOut</td><td>92.9</td><td>94.7</td><td>96.5</td><td>81.6</td></tr><tr><td>RoBERTa</td><td>93.6</td><td>94.5</td><td>96.6</td><td>83.8</td></tr><tr><td>+ AttendOut</td><td>94.2</td><td>95.2</td><td>97.3</td><td>84.1</td></tr></table>
|
| 285 |
+
|
| 286 |
+
# 179 5 Experimental Setup
|
| 287 |
+
|
| 288 |
+
180 We demonstrate the universal effectiveness of AttendOut on extensive natural language processing
|
| 289 |
+
181 tasks. For all mentioned tasks, we apply our method on BERT [2] and its stronger variant RoBERTa
|
| 290 |
+
182 [3]. Our implementations are based on PyTorch using transformers [36]. For further training details,
|
| 291 |
+
183 please refer to Appendix.
|
| 292 |
+
184 Our experiments include: (1) natural language understanding: General Language Understanding
|
| 293 |
+
185 Evaluation (GLUE) benchmark [37], a collection of nine natural language understanding tasks (here
|
| 294 |
+
186 we experiment on five of them, SST-2, MRPC, QNLI, MNLI-mm and CoLA; (2) document clas
|
| 295 |
+
187 sification: IMDB [38], a sentiment analysis dataset where about $15 \%$ of the documents are longer
|
| 296 |
+
188 than 512 word-pieces; (3) named entity recognition: CoNLL2003 [39]; (4) part-of-speech tag
|
| 297 |
+
189 ging: English Penn Treebank (PTB) [40]; (5) multiple choices question answering: SWAG [41].
|
| 298 |
+
190 We report both test and development results for GLUE sub-tasks since the large bias between them,
|
| 299 |
+
191 while development results only for all the other tasks.
|
| 300 |
+
192 Note that we only adjust the dropout steps and keep all other parameters the same for strict fair
|
| 301 |
+
193 comparison. For example, the parameters we use in RoBERTa are identical with what we use in
|
| 302 |
+
194 training with AttendOut including both D-Net and A-Net.
|
| 303 |
+
|
| 304 |
+
# 6 Results
|
| 305 |
+
|
| 306 |
+
# 6.1 Significance Analysis
|
| 307 |
+
|
| 308 |
+
97 Pictorially in Table 1, RoBERTa is strong enough as it outperforms BERT by a big margin, while
|
| 309 |
+
98 AttendOut empowered RoBERTa still outperforms it on all five GLUE sub-tasks. For small-scale
|
| 310 |
+
99 datasets, which are more likely to over-fit, AttendOut helps unfold remarkable performance gain
|
| 311 |
+
00 $( 1 2 . 1 \% \ / \ 3 . 5 \%$ over BERT on CoLA, $1 . 7 \% / 1 . 4 \%$ over BERT on MRPC). However, for large
|
| 312 |
+
01 scale one like MNLI, which tends to be more stable, AttendOut still produces considerable boost,
|
| 313 |
+
02 $( 1 . 4 \% / 1 . 4 \%$ over RoBERTa, $1 . 1 \% / 0 . 7 \%$ over BERT).
|
| 314 |
+
203 Furthermore, AttendOut is shown universally effective as in Table 2. For POS Tagging, BERT
|
| 315 |
+
204 and RoBERTa have achieved very strong baselines, while AttendOut empowered ones are even
|
| 316 |
+
205 stronger, $3 . 1 \%$ over BERT on PTB). Similar results are seen on document classification and NER.
|
| 317 |
+
206 For SWAG, however, AttendOut seems weakly effective $\mathbf { 0 . 6 \% }$ over BERT, $0 . 4 \%$ over RoBERTa).
|
| 318 |
+
|
| 319 |
+

|
| 320 |
+
Figure 3: Dropout probabilities on specific attention layers over training steps.
|
| 321 |
+
|
| 322 |
+

|
| 323 |
+
Figure 4: Convergence over training epochs.
|
| 324 |
+
|
| 325 |
+
# 207 6.2 Visual Analysis
|
| 326 |
+
|
| 327 |
+
Dropout Patterns Another concerned issue is the dropout proportions by AttendOut. Figure 3 depicts the patterns on several datasets. We may find several interesting phenomenons. First, the overall patterns largely differ from datasets, which is fair since AttendOut is sample-dependent. However, we may observe something in common. Overall, the lower layers take higher dropout probabilities. For example on QNLI, the first layer almost remains steady with the probability of 0.55 during the training process, while the fourth one continuously decays in a higher rate. Intuitively, the first three layers undertake a similar trend in each dataset, while there might be an up and down for the fourth one as in SST-2 and CoLA. Especially for CoLA, we see unusual high dropout probabilities in the final period (around 0.9), which are close to complete dropout. We notice that CoLA is a small set with 8500 training samples, on which SAN model is more inclined to suffer from over-fitting. Therefore, PrLM on CoLA encounters more intensive dropout through AttendOut.
|
| 328 |
+
|
| 329 |
+
219 Convergence Figure 4 depicts the accuracy trends of RoBERTa on SST-2, QNLI, MNLI respec
|
| 330 |
+
220 tively. Due to a stronger dropout module, the one with AttendOut tends to fall behind (SST-2,
|
| 331 |
+
221 MNLI) at the beginning of training. However, model becomes stronger since the second epoch
|
| 332 |
+
222 (SST-2, QNLI). Especially on MNLI, RoBERTa obtains better results in the first two epochs and it
|
| 333 |
+
223 drops in the last one, while with AttendOut, the performance is steadily rising for all three epochs.
|
| 334 |
+
|
| 335 |
+
# 7 Ablation Study
|
| 336 |
+
|
| 337 |
+
In this section, we conduct further experiments to demonstrate the effectiveness of AttendOut. Due to space limitation, we conduct corresponding experiments on development sets only.
|
| 338 |
+
|
| 339 |
+
# 7.1 Attention Dropout
|
| 340 |
+
|
| 341 |
+
Vanilla Dropout We conduct comparison with vanilla Dropout [13], in which we dropout the attention matrix for all layers with Bernoulli distribution of $p$ . Here, we choose the dropout probabilities in {0.1, 0.2}.
|
| 342 |
+
|
| 343 |
+
Table 3: Comparison of AttendOut, vanilla Dropout and LayerDrop.
|
| 344 |
+
|
| 345 |
+
<table><tr><td>Model</td><td>CoLA</td><td>QNLI</td><td>MNLI-mm</td></tr><tr><td>RoBERTa</td><td>62.5</td><td>92.0</td><td>86.6</td></tr><tr><td>+ Vanilla</td><td>61.3</td><td>92.2</td><td>86.9</td></tr><tr><td>+ AttendOut</td><td>63.8</td><td>93.1</td><td>87.8</td></tr><tr><td>+ LayerDrop</td><td>62.1</td><td>92.6</td><td>87.1</td></tr><tr><td>+ Attn.LayerDrop</td><td>64.2</td><td>92.7</td><td>87.3</td></tr></table>
|
| 346 |
+
|
| 347 |
+
Table 4: Comparison of AttendOut and scheduled Bernoulli dropout.
|
| 348 |
+
|
| 349 |
+
<table><tr><td>Model</td><td>CoLA</td><td>QNLI</td><td>SWAG</td></tr><tr><td>RoBERTa</td><td>62.5</td><td>92.0</td><td>83.8</td></tr><tr><td>+ Scheduler</td><td>63.3</td><td>92.6</td><td>83.6</td></tr><tr><td>+ AttendOut</td><td>63.8</td><td>93.1</td><td>84.1</td></tr></table>
|
| 350 |
+
|
| 351 |
+
231 LayerDrop We also compare with LayerDrop [29], which focuses on skipping the entire encoder
|
| 352 |
+
232 blocks, Inspired of it, we design another strategy which randomly skips attention layers via Eq. 4.
|
| 353 |
+
233 For fair enough comparison, we set the dropout probabilities to 0.2 for both methods, following the
|
| 354 |
+
234 settings in [29].
|
| 355 |
+
235 Intuitively in Table 3, vanilla Dropout with fixed probability does not produce noticeable gain $( 1 . 9 \%$
|
| 356 |
+
236 bellow RoBERTa on CoLA). However, AttendOut shows powerful advantage $4 . 1 \%$ , $1 . 0 \%$ and $1 . 0 \%$
|
| 357 |
+
237 over vanilla Dropout on CoLA, QNLI and MNLI), which stresses the necessity of dynamic dropout
|
| 358 |
+
238 patterns rather than fixed static one. On the other hand, both layer-level regularizers are effective,
|
| 359 |
+
239 while attention LayerDrop performs stronger and more stable on all the three. Especially on CoLA,
|
| 360 |
+
240 it outperforms RoBERTa by 1.7 points, while LayerDrop meets a performance drop, which demon
|
| 361 |
+
241 strates that removing the attention layers act as a more effective regularizer than removing the entire
|
| 362 |
+
242 SAN block as for self-attention based models.
|
| 363 |
+
|
| 364 |
+
# 243 7.2 Pattern Approximation
|
| 365 |
+
|
| 366 |
+
244 Guided by AttendOut, we design a dropout scheduler, in which we utilize piece-wise linearity to
|
| 367 |
+
245 approximate the real curves as depicted in Figure 3. Taking QNLI as an example, we initialize
|
| 368 |
+
246 the dropout probabilities to 0.6 for all attention layers and set a a specific slope for each of them.
|
| 369 |
+
247 Note that here the corresponding mask matrices are randomly-generated and subject to Bernoulli
|
| 370 |
+
248 distribution. In AttendOut, however, the distribution are learned dynamically through self-attention
|
| 371 |
+
249 of G-Net.
|
| 372 |
+
250 As shown in Table 4, RoBERTa with scheduled Bernoulli dropout works surprisingly well on both
|
| 373 |
+
251 CoLA and QNLI, which outperforms RoBERTa by 0.8 and 0.6 points respectively, closer to At
|
| 374 |
+
252 tendOut, even if the strategy here is random-based and much looser. The guided scheduled dropout
|
| 375 |
+
253 helps unfold the correctness of the dynamic dropout patterns learned by AttendOut as well as the
|
| 376 |
+
254 self-attention based dropout maker.
|
| 377 |
+
|
| 378 |
+
# 255 8 Conclusion
|
| 379 |
+
|
| 380 |
+
This paper focuses on the co-adaption problem of deep self-attention networks, and presents a novel dropout method onto self-attention empowered pre-trained language models. Extensive experiments on multiple natural language processing tasks demonstrate that our proposed approach is universal and qualified to enable more robust task-specific tuning, which contributes to much stronger stateof-the-arts. We probe into the learned dropout patterns on different tasks, which empirically guide us to the very needed dynamic attention dropout design.
|
| 381 |
+
|
| 382 |
+
262 References
|
| 383 |
+
263 [1] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz
|
| 384 |
+
264 Kaiser, and Illia Polosukhin. Attention is all you need. In Isabelle Guyon, Ulrike von Luxburg, Samy
|
| 385 |
+
265 Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett, editors, Advances
|
| 386 |
+
266 in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing
|
| 387 |
+
267 Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 5998–6008, 2017.
|
| 388 |
+
268 [2] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidi
|
| 389 |
+
269 rectional transformers for language understanding. In Jill Burstein, Christy Doran, and Thamar Solorio,
|
| 390 |
+
270 editors, Proceedings of the 2019 Conference of the North American Chapter of the Association for Com
|
| 391 |
+
271 putational Linguistics: Human Language Technologies, NAACL-HLT 2019, Minneapolis, MN, USA, June
|
| 392 |
+
272 2-7, 2019, Volume 1 (Long and Short Papers), pages 4171–4186. Association for Computational Linguis
|
| 393 |
+
273 tics, 2019.
|
| 394 |
+
274 [3] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis,
|
| 395 |
+
275 Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized BERT pretraining approach.
|
| 396 |
+
276 CoRR, abs/1907.11692, 2019.
|
| 397 |
+
277 [4] Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut.
|
| 398 |
+
278 ALBERT: A lite BERT for self-supervised learning of language representations. In 8th International
|
| 399 |
+
279 Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. Open
|
| 400 |
+
280 Review.net, 2020.
|
| 401 |
+
281 [5] Kevin Clark, Minh-Thang Luong, Quoc V. Le, and Christopher D. Manning. ELECTRA: pre-training
|
| 402 |
+
282 text encoders as discriminators rather than generators. In 8th International Conference on Learning Rep
|
| 403 |
+
283 resentations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 404 |
+
284 [6] Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. {DEBERTA}: {DECODING}-
|
| 405 |
+
285 {enhanced} {bert} {with} {disentangled} {attention}. In International Conference on Learning Repre
|
| 406 |
+
286 sentations, 2021.
|
| 407 |
+
287 [7] Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding
|
| 408 |
+
288 by generative pre-training. 2018.
|
| 409 |
+
289 [8] Weiqiu You, Simeng Sun, and Mohit Iyyer. Hard-coded gaussian attention for neural machine translation.
|
| 410 |
+
290 In Dan Jurafsky, Joyce Chai, Natalie Schluter, and Joel R. Tetreault, editors, Proceedings of the 58th
|
| 411 |
+
291 Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020,
|
| 412 |
+
292 pages 7689–7700. Association for Computational Linguistics, 2020.
|
| 413 |
+
293 [9] Yi Tay, Dara Bahri, Donald Metzler, Da-Cheng Juan, Zhe Zhao, and Che Zheng. Synthesizer: Rethinking
|
| 414 |
+
294 self-attention in transformer models. CoRR, abs/2005.00743, 2020.
|
| 415 |
+
295 [10] Sinong Wang, Belinda Z. Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with
|
| 416 |
+
296 linear complexity. CoRR, abs/2006.04768, 2020.
|
| 417 |
+
297 [11] Yihe Dong, Jean-Baptiste Cordonnier, and Andreas Loukas. Attention is not all you need: Pure attention
|
| 418 |
+
298 loses rank doubly exponentially with depth. CoRR, abs/2103.03404, 2021.
|
| 419 |
+
299 [12] Saurabh Goyal, Anamitra Roy Choudhury, Saurabh Raje, Venkatesan T. Chakaravarthy, Yogish Sabhar
|
| 420 |
+
300 wal, and Ashish Verma. Power-bert: Accelerating BERT inference via progressive word-vector elimi
|
| 421 |
+
301 nation. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18
|
| 422 |
+
302 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 3690–3699.
|
| 423 |
+
303 PMLR, 2020.
|
| 424 |
+
304 [13] Nitish Srivastava, Geoffrey E. Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov.
|
| 425 |
+
305 Dropout: a simple way to prevent neural networks from overfitting. J. Mach. Learn. Res., 15(1):1929–
|
| 426 |
+
306 1958, 2014.
|
| 427 |
+
307 [14] Li Wan, Matthew D. Zeiler, Sixin Zhang, Yann LeCun, and Rob Fergus. Regularization of neural networks
|
| 428 |
+
308 using dropconnect. In Proceedings of the 30th International Conference on Machine Learning, ICML
|
| 429 |
+
309 2013, Atlanta, GA, USA, 16-21 June 2013, volume 28 of JMLR Workshop and Conference Proceedings,
|
| 430 |
+
310 pages 1058–1066. JMLR.org, 2013.
|
| 431 |
+
311 [15] Zhuosheng Zhang, Yuwei Wu, Junru Zhou, Sufeng Duan, Hai Zhao, and Rui Wang. Sg-net: Syntax
|
| 432 |
+
312 guided machine reading comprehension. In The Thirty-Fourth AAAI Conference on Artificial Intelligence,
|
| 433 |
+
313 AAAI 2020, The Thirty-Second Innovative Applications of Artificial Intelligence Conference, IAAI 2020,
|
| 434 |
+
314 The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, New York, NY,
|
| 435 |
+
315 USA, February 7-12, 2020, pages 9636–9643. AAAI Press, 2020.
|
| 436 |
+
|
| 437 |
+
[16] Hongqiu Wu, Hai Zhao, and Min Zhang. Code summarization with structure-induced transformer. arXiv preprint arXiv:2012.14710, 2020.
|
| 438 |
+
[17] Barret Zoph and Quoc V. Le. Neural architecture search with reinforcement learning. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017.
|
| 439 |
+
[18] Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: differentiable architecture search. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019.
|
| 440 |
+
[19] Hieu Pham and Quoc V. Le. Autodropout: Learning dropout patterns to regularize deep networks. CoRR, abs/2101.01761, 2021.
|
| 441 |
+
[20] Günter Klambauer, Thomas Unterthiner, Andreas Mayr, and Sepp Hochreiter. Self-normalizing neural networks. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett, editors, Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 971–980, 2017.
|
| 442 |
+
[21] Avrim Blum, Nika Haghtalab, and Ariel D. Procaccia. Variational dropout and the local reparameterization trick. In Corinna Cortes, Neil D. Lawrence, Daniel D. Lee, Masashi Sugiyama, and Roman Garnett, editors, Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pages 2575–2583, 2015.
|
| 443 |
+
[22] Dmitry Molchanov, Arsenii Ashukha, and Dmitry P. Vetrov. Variational dropout sparsifies deep neural networks. In Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, volume 70 of Proceedings of Machine Learning Research, pages 2498–2507. PMLR, 2017.
|
| 444 |
+
[23] Sungrae Park, Jun-Keon Park, Su-Jin Shin, and Il-Chul Moon. Adversarial dropout for supervised and semi-supervised learning. In Sheila A. McIlraith and Kilian Q. Weinberger, editors, Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, (AAAI-18), the 30th innovative Applications of Artificial Intelligence (IAAI-18), and the 8th AAAI Symposium on Educational Advances in Artificial Intelligence (EAAI-18), New Orleans, Louisiana, USA, February 2-7, 2018, pages 3917–3924. AAAI Press, 2018.
|
| 445 |
+
[24] Hojjat Salehinejad and Shahrokh Valaee. Edropout: Energy-based dropout and pruning of deep neural networks. CoRR, abs/2006.04270, 2020.
|
| 446 |
+
[25] Yarin Gal, Jiri Hron, and Alex Kendall. Concrete dropout. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett, editors, Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 3581–3590, 2017.
|
| 447 |
+
[26] Shahin Boluki, Randy Ardywibowo, Siamak Zamani Dadaneh, Mingyuan Zhou, and Xiaoning Qian. Learnable bernoulli dropout for bayesian deep learning. In Silvia Chiappa and Roberto Calandra, editors, The 23rd International Conference on Artificial Intelligence and Statistics, AISTATS 2020, 26-28 August 2020, Online [Palermo, Sicily, Italy], volume 108 of Proceedings of Machine Learning Research, pages 3905–3916. PMLR, 2020.
|
| 448 |
+
[27] Mingzhang Yin and Mingyuan Zhou. ARM: augment-reinforce-merge gradient for stochastic binary networks. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019.
|
| 449 |
+
[28] Xinjie Fan, Shujian Zhang, Korawat Tanwisuth, Xiaoning Qian, and Mingyuan Zhou. Contextual dropout: An efficient sample-dependent dropout module. CoRR, abs/2103.04181, 2021.
|
| 450 |
+
[29] Angela Fan, Edouard Grave, and Armand Joulin. Reducing transformer depth on demand with structured dropout. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 451 |
+
[30] Wangchunshu Zhou, Tao Ge, Furu Wei, Ming Zhou, and Ke Xu. Scheduled drophead: A regularization method for transformer models. In Trevor Cohn, Yulan He, and Yang Liu, editors, Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings, EMNLP 2020, Online Event, 16-20 November 2020, pages 1971–1980. Association for Computational Linguistics, 2020.
|
| 452 |
+
|
| 453 |
+
369 [31] Zewei Sun, Shujian Huang, Xinyu Dai, and Jiajun Chen. Alleviating the inequality of attention heads for
|
| 454 |
+
370 neural machine translation. CoRR, abs/2009.09672, 2020.
|
| 455 |
+
371 [32] Zhen Wu, Lijun Wu, Meng Qi, Yingce Xia, Shufang Xie, Tao Qin, Xinyu Dai, and Tie-Yan Liu. Unidrop:
|
| 456 |
+
372 A simple yet effective technique to improve transformer without extra cost. In Proceedings of the The 2021
|
| 457 |
+
373 Conference of the North American Chapter of the Association for Computational Linguistics - Human
|
| 458 |
+
374 Language Technologies, Volume 1 (Long Papers), 2021.
|
| 459 |
+
375 [33] Chris J. Maddison, Daniel Tarlow, and Tom Minka. $\mathbf { A } ^ { * }$ sampling. In Zoubin Ghahramani, Max Welling,
|
| 460 |
+
376 Corinna Cortes, Neil D. Lawrence, and Kilian Q. Weinberger, editors, Advances in Neural Information
|
| 461 |
+
377 Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December
|
| 462 |
+
378 8-13 2014, Montreal, Quebec, Canada, pages 3086–3094, 2014.
|
| 463 |
+
379 [34] Xinwei Geng, Longyue Wang, Xing Wang, Bing Qin, Ting Liu, and Zhaopeng Tu. How does selective
|
| 464 |
+
380 mechanism improve self-attention networks? In Dan Jurafsky, Joyce Chai, Natalie Schluter, and Joel R.
|
| 465 |
+
381 Tetreault, editors, Proceedings of the 58th Annual Meeting of the Association for Computational Linguis
|
| 466 |
+
382 tics, ACL 2020, Online, July 5-10, 2020, pages 2986–2995. Association for Computational Linguistics,
|
| 467 |
+
383 2020.
|
| 468 |
+
384 [35] Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement
|
| 469 |
+
385 learning. Mach. Learn., 8:229–256, 1992.
|
| 470 |
+
386 [36] Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pier
|
| 471 |
+
387 ric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen,
|
| 472 |
+
388 Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame,
|
| 473 |
+
389 Quentin Lhoest, and Alexander M. Rush. Transformers: State-of-the-art natural language processing.
|
| 474 |
+
390 In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System
|
| 475 |
+
391 Demonstrations, pages 38–45, Online, October 2020. Association for Computational Linguistics.
|
| 476 |
+
392 [37] Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. GLUE:
|
| 477 |
+
393 A multi-task benchmark and analysis platform for natural language understanding. In 7th International
|
| 478 |
+
394 Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenRe
|
| 479 |
+
395 view.net, 2019.
|
| 480 |
+
396 [38] Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts.
|
| 481 |
+
397 Learning word vectors for sentiment analysis. In Dekang Lin, Yuji Matsumoto, and Rada Mihalcea,
|
| 482 |
+
398 editors, The 49th Annual Meeting of the Association for Computational Linguistics: Human Language
|
| 483 |
+
399 Technologies, Proceedings of the Conference, 19-24 June, 2011, Portland, Oregon, USA, pages 142–150.
|
| 484 |
+
400 The Association for Computer Linguistics, 2011.
|
| 485 |
+
401 [39] Erik F. Tjong Kim Sang and Fien De Meulder. Introduction to the conll-2003 shared task: Language
|
| 486 |
+
402 independent named entity recognition. In Walter Daelemans and Miles Osborne, editors, Proceedings
|
| 487 |
+
403 of the Seventh Conference on Natural Language Learning, CoNLL 2003, Held in cooperation with HLT
|
| 488 |
+
404 NAACL 2003, Edmonton, Canada, May 31 - June 1, 2003, pages 142–147. ACL, 2003.
|
| 489 |
+
405 [40] Mitchell P. Marcus, Beatrice Santorini, and Mary Ann Marcinkiewicz. Building a large annotated corpus
|
| 490 |
+
406 of english: The penn treebank. Comput. Linguistics, 19(2):313–330, 1993.
|
| 491 |
+
407 [41] Rowan Zellers, Yonatan Bisk, Roy Schwartz, and Yejin Choi. SWAG: A large-scale adversarial dataset
|
| 492 |
+
408 for grounded commonsense inference. In Ellen Riloff, David Chiang, Julia Hockenmaier, and Jun’ichi
|
| 493 |
+
409 Tsujii, editors, Proceedings of the 2018 Conference on Empirical Methods in Natural Language Process
|
| 494 |
+
410 ing, Brussels, Belgium, October 31 - November 4, 2018, pages 93–104. Association for Computational
|
| 495 |
+
411 Linguistics, 2018.
|
| 496 |
+
|
| 497 |
+
# 412 Checklist
|
| 498 |
+
|
| 499 |
+
1. For all authors...
|
| 500 |
+
|
| 501 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 502 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 4.2.
|
| 503 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 504 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 505 |
+
|
| 506 |
+
2. If you are including theoretical results...
|
| 507 |
+
|
| 508 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] See Section 4.2. (b) Did you include complete proofs of all theoretical results? [No]
|
| 509 |
+
|
| 510 |
+
3. If you ran experiments...
|
| 511 |
+
|
| 512 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See supplemental material.
|
| 513 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4.2 and appendix.
|
| 514 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No]
|
| 515 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 4.2 and appendix.
|
| 516 |
+
|
| 517 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 518 |
+
|
| 519 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] See Section 5.
|
| 520 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 521 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No]
|
| 522 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 523 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No]
|
| 524 |
+
|
| 525 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 526 |
+
|
| 527 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 528 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 529 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/rkgNKkHtvB/rkgNKkHtvB.md
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REFORMER: THE EFFICIENT TRANSFORMER
|
| 2 |
+
|
| 3 |
+
Nikita Kitaev∗ U.C. Berkeley & Google Research kitaev@cs.berkeley.edu
|
| 4 |
+
|
| 5 |
+
Łukasz Kaiser∗ Anselm Levskaya Google Research Google Research {lukaszkaiser,levskaya}@google.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Large Transformer models routinely achieve state-of-the-art results on a number of tasks but training these models can be prohibitively costly, especially on long sequences. We introduce two techniques to improve the efficiency of Transformers. For one, we replace dot-product attention by one that uses locality-sensitive hashing, changing its complexity from $\mathrm { O } ( L ^ { 2 } )$ to $\mathrm { O } ( L \log L )$ , where $L$ is the length of the sequence. Furthermore, we use reversible residual layers instead of the standard residuals, which allows storing activations only once in the training process instead of $N$ times, where $N$ is the number of layers. The resulting model, the Reformer, performs on par with Transformer models while being much more memory-efficient and much faster on long sequences.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
The Transformer architecture (Vaswani et al., 2017) is widely used in natural language processing and yields state-of-the-art results on a number of tasks. To obtain these results, researchers have resorted to training ever larger Transformer models. The number of parameters exceeds 0.5B per layer in the largest configuration reported in (Shazeer et al., 2018) while the number of layers goes up to 64 in (Al-Rfou et al., 2018). Transformer models are also used on increasingly long sequences. Up to 11 thousand tokens of text in a single example were processed in (Liu et al., 2018) and when processing other modalities, like music (Huang et al., 2018) and images (Parmar et al., 2018), even longer sequences are commonplace. These large-scale long-sequence models yield great results but strain resources to the point where some argue that this trend is breaking NLP research1. Many large Transformer models can only realistically be trained in large industrial research laboratories and such models trained with model parallelism cannot even be fine-tuned on a single GPU as their memory requirements demand a multi-accelerator hardware setup even for a single training step.
|
| 14 |
+
|
| 15 |
+
Do large Transformer models fundamentally require such huge resources or are they simply inefficient? Consider the following calculation: the 0.5B parameters used in the largest reported Transformer layer account for 2GB of memory. Activations for 64K tokens with embedding size 1024 and batch size 8 account for $6 4 \mathrm { K } \times 1 \mathrm { K } \times 8 = 0 . 5 \mathrm { B }$ floats, requiring another 2GB of memory. If our memory use was only per-layer, then we should fairly easily fit a large Transformer even on sequences of length 64K on a single accelerator. Further, the whole corpus used to train BERT only requires 17GB to store. Why is it then that we cannot even fine-tune these models on single machines?
|
| 16 |
+
|
| 17 |
+
The above estimate includes only per-layer memory and input activations cost and does not take into account the following major sources of memory use in the Transformer.
|
| 18 |
+
|
| 19 |
+
• Memory in a model with $N$ layers is $N$ -times larger than in a single-layer model due to the fact that activations need to be stored for back-propagation. • Since the depth $d _ { f f }$ of intermediate feed-forward layers is often much larger than the depth $d _ { m o d e l }$ of attention activations, it accounts for a large fraction of memory use. • Attention on sequences of length $L$ is $\mathrm { O } ( L ^ { 2 } )$ in both computational and memory complexity, so even for a single sequence of 64K tokens can exhaust accelerator memory.
|
| 20 |
+
|
| 21 |
+
We introduce the Reformer model which solves these problems using the following techniques:
|
| 22 |
+
|
| 23 |
+
• Reversible layers, first introduced in Gomez et al. (2017), enable storing only a single copy of activations in the whole model, so the $N$ factor disappears.
|
| 24 |
+
• Splitting activations inside feed-forward layers and processing them in chunks removes the $d _ { f f }$ factor and saves memory inside feed-forward layers.
|
| 25 |
+
• Approximate attention computation based on locality-sensitive hashing replaces the $\mathrm { O } ( L ^ { 2 } )$ factor in attention layers with $\mathrm { O } ( L \log L )$ and so allows operating on long sequences.
|
| 26 |
+
|
| 27 |
+
We study these techniques and show that they have negligible impact on the training process compared to the standard Transformer. Splitting activations in fact only affects the implementation; it is numerically identical to the layers used in the Transformer. Applying reversible residuals instead of the standard ones does change the model but has a negligible effect on training in all configurations we experimented with. Finally, locality-sensitive hashing in attention is a more major change that can influence the training dynamics, depending on the number of concurrent hashes used. We study this parameter and find a value which is both efficient to use and yields results very close to full attention.
|
| 28 |
+
|
| 29 |
+
We experiment on a synthetic task, a text task (enwik8) with sequences of length 64K and an image generation task (imagenet-64 generation) with sequences of length 12K. In both cases we show that Reformer matches the results obtained with full Transformer but runs much faster, especially on the text task, and with orders of magnitude better memory efficiency.
|
| 30 |
+
|
| 31 |
+
# 2 LOCALITY-SENSITIVE HASHING ATTENTION
|
| 32 |
+
|
| 33 |
+
Dot-product attention. The standard attention used in the Transformer is the scaled dot-product attention (Vaswani et al., 2017). The input consists of queries and keys of dimension $d _ { k }$ , and values√ of dimension $d _ { v }$ . The dot products of the query with all keys are computed, scaled by $\sqrt { d _ { k } }$ , and a softmax function is applied to obtain the weights on the values. In practice, the attention function on a set of queries is computed simultaneously, packed together into a matrix $Q$ . Assuming the keys and values are also packed together into matrices $K$ and $V$ , the matrix of outputs is defined as:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\mathrm { A t t e n t i o n } ( Q , K , V ) = \mathrm { s o f t m a x } ( \frac { Q K ^ { T } } { \sqrt { d _ { k } } } ) V
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
Multi-head attention. In the Transformer, instead of performing a single attention function with $d _ { m o d e l }$ -dimensional keys, values and queries, one linearly projects the queries, keys and values $h$ times with different, learned linear projections to $d _ { k } , d _ { k }$ and $d _ { v }$ dimensions, respectively. Attention is applied to each of these projected versions of queries, keys and values in parallel, yielding $d _ { v }$ - dimensional output values. These are concatenated and once again projected, resulting in the final values. This mechanism is known as multi-head attention.
|
| 40 |
+
|
| 41 |
+
Memory-efficient attention. To calculate the memory use of the attention mechanism, let us focus on the attention computation from Equation 1. Let us assume that Q, K and $\mathrm { v }$ all have the shape $\left[ b a t c h \_ s i z e , l e n g t h , d _ { m o d e l } \right]$ . The main issue is the term $Q K ^ { T }$ , which has the shape [batch size, length, length]. In the experimental section we train a model on sequences of length $6 4 K$ – in this case, even at batch-size of 1, this is a $6 4 K \times 6 4 K$ matrix, which in 32-bit floats would take 16GB of memory. This is impractical and has hindered the use of the Transformer for long sequences. But it is important to note that the $Q K ^ { T }$ matrix does not need to be fully materialized in memory. The attention can indeed be computed for each query $q _ { i }$ separately, only calculating $\mathrm { s o f t m a x } ( \frac { q _ { i } K ^ { T } } { \sqrt { d _ { k } } } ) V$ once in memory, and then re-computing it on the backward pass when needed for gradients. This way of computing attention may be less efficient but it only uses memory proportional to length. We use this memory-efficient implementation of attention to run the full-attention baselines presented in the experimental section.
|
| 42 |
+
|
| 43 |
+
Where do Q, K, V come from? The multi-head attention described above operates on keys, queries and values, but usually we are only given a single tensor of activations A of the shape [batch size, length, $d _ { m o d e l } ]$ – e.g., coming from embedding the tokens in a sentence into vectors.
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
Figure 1: An angular locality sensitive hash uses random rotations of spherically projected points to establish buckets by an argmax over signed axes projections. In this highly simplified 2D depiction, two points $x$ and $y$ are unlikely to share the same hash buckets (above) for the three different angular hashes unless their spherical projections are close to one another (below).
|
| 47 |
+
|
| 48 |
+
To build Q, K and V from A, the Transformer uses 3 different linear layers projecting A into Q, K and $\mathrm { v }$ with different parameters. For models with LSH attention, we want queries and keys (Q and K) to be identical. This is easily achieved by using the same linear layer to go from A to Q and K, and a separate one for V. We call a model that behaves like this a shared-QK Transformer. It turns out that sharing QK does not affect the performance of Transformer, even if we additionally normalize the length of the keys K, as we show in the experimental Section 5.
|
| 49 |
+
|
| 50 |
+
Hashing attention. For the LSH attention, we start with two tensors, $\mathrm { Q } { = } \mathrm { K }$ and $\mathrm { v }$ of the shape [batch size, length, $d _ { m o d e l } ]$ . We keep the multi-head mechanism intact and focus on the attention computation from Equation 1. As already mentioned, the main issue is the term $Q K ^ { T }$ , which has the shape [batch size, length, length]. But note that we are actually only interested in softmax $\left( Q K ^ { T } \right)$ . Since softmax is dominated by the largest elements, for each query $q _ { i }$ we only need to focus on the keys in K that are closest to $q _ { i }$ . For example, if K is of length 64K, for each $q _ { i }$ we could only consider a small subset of, say, the 32 or 64 closest keys. That is much more efficient, but how can we find the nearest neighbors among the keys?
|
| 51 |
+
|
| 52 |
+
Locality sensitive hashing. The problem of finding nearest neighbors quickly in high-dimensional spaces can be solved by locality-sensitive hashing (LSH). A hashing scheme that assigns each vector $x$ to a hash $h ( x )$ is called locality-sensitive if nearby vectors get the same hash with high probability and distant ones do not. In our case, we actually only require that nearby vectors get the same hash with high probability and that hash-buckets are of similar size with high probability.
|
| 53 |
+
|
| 54 |
+
We achieve this by employing random projections as follows (see Figure 1). To get $b$ hashes, we first fix a random matrix $R$ of size $[ d _ { k } , b / 2 ]$ . We then define $h ( x ) = \arg \operatorname* { m a x } ( [ x R ; - x R ] )$ where $[ u ; v ]$ denotes the concatenation of two vectors. This method is a known LSH scheme (Andoni et al., 2015) and is easy to implement and apply to batches of vectors.
|
| 55 |
+
|
| 56 |
+
LSH attention. Knowing our LSH scheme and the general idea of hashing attention, we will now formalize the LSH attention we use in this paper. We first rewrite the equation for normal attention, (1), for a single query position $i$ at a time:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
o _ { i } = \sum _ { j \in \mathcal { P } _ { i } } \exp \left( q _ { i } \cdot k _ { j } - z ( i , \mathcal { P } _ { i } ) \right) v _ { j }
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
We introduce the notation $\mathcal { P } _ { i }$ to represent the set that the query at position $i$ attends to, and $z$ to denote the partition function (i.e. the normalizing term in the softmax). For clarity, we also omit scaling by $\sqrt { d _ { k } }$ .
|
| 63 |
+
|
| 64 |
+
For batching purposes we typically perform attention over a larger set $\widetilde { \mathcal { P } } _ { i } = \{ 0 , 1 , \ldots , l \} \supseteq \mathcal { P } _ { i }$ while masking out elements not in $\mathcal { P } _ { i }$ :
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
o _ { i } = \sum _ { j \in \widetilde { \mathcal { P } } _ { i } } \exp \left( q _ { i } \cdot k _ { j } - m ( j , \mathcal { P } _ { i } ) - z ( i , \mathcal { P } _ { i } ) \right) v _ { j } \quad \mathrm { ~ w h e r e ~ } m ( j , \mathcal { P } _ { i } ) = \left\{ \begin{array} { l l } { \infty } & { \mathrm { i f ~ } j \notin \mathcal { P } _ { i } } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
Figure 2: Simplified depiction of LSH Attention showing the hash-bucketing, sorting, and chunking steps and the resulting causal attentions. (a-d) Attention matrices for these varieties of attention.
|
| 72 |
+
|
| 73 |
+
Now we turn to LSH attention, which we can think of in terms of restricting the set $\mathcal { P } _ { i }$ of target items a query position $i$ can attend to, by only allowing attention within a single hash bucket.
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\mathcal { P } _ { i } = \{ j : h ( q _ { i } ) = h ( k _ { j } ) \}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
Figure 2(a-b) shows a schematic comparison of full-attention with a hashed variant. Part (a) depicts that the attention matrix for full attention is typically sparse, but the computation does not take advantage of this sparsity. In (b), the queries and keys have been sorted according to their hash bucket. Since similar items fall in the same bucket with high probability, the full attention pattern can be approximated by only allowing attention within each bucket.
|
| 80 |
+
|
| 81 |
+
Hash buckets in this formulation tend to be uneven in size, which makes it difficult to batch across buckets. Moreover, the number of queries and the number of keys within a bucket may be unequal – in fact, it is possible for a bucket to contain many queries but no keys. To alleviate these issues, we first ensure that h(kj ) = h(qj ) by setting kj = $\begin{array} { r } { k _ { j } = \frac { \dot { q _ { j } } } { | | q _ { j } | | } } \end{array}$ . Next, we sort the queries by bucket number and, within each bucket, by sequence position; this defines a permutation where $i \mapsto s _ { i }$ after sorting. In the sorted attention matrix, pairs from the same bucket will cluster near the diagonal (as depicted in Figure $2 \mathrm { c }$ ). We can follow a batching approach where chunks of $m$ consecutive queries (after sorting) attend to each other, and one chunk back (Figure 2d). Following our earlier notation, this corresponds to setting:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\widetilde { \mathcal { P } } _ { i } = \left\{ j : \left\lfloor { \frac { s _ { i } } { m } } \right\rfloor - 1 \leq \left\lfloor { \frac { s _ { j } } { m } } \right\rfloor \leq \left\lfloor { \frac { s _ { i } } { m } } \right\rfloor \right\}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
If $\operatorname* { m a x } _ { i } \left| \mathcal { P } _ { i } \right| < m$ , then $\mathcal { P } _ { i } \subseteq \widetilde { \mathcal { P } } _ { i }$ . In practice we set $\begin{array} { r } { m = \frac { 2 l } { n _ { b u c k e t s } } } \end{array}$ (where $l$ is the sequence length). The average bucket size is $\frac { l } { n _ { b u c k e t s } }$ , and we assume that the probability of a bucket growing to twice that size is sufficiently low. The overall process of LSH attention is summarized in Figure 2.
|
| 88 |
+
|
| 89 |
+
Multi-round LSH attention. With hashing, there is always a small probability that similar items nevertheless fall in different buckets. This probability can be reduced by doing multiple rounds of hashing with $n _ { r o u n d s }$ distinct hash functions $\{ h ^ { ( 1 ) } , h ^ { \left( 2 \right) } , \ldots \}$ , such that:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
{ \mathcal P } _ { i } = \bigcup _ { r = 1 } ^ { n _ { r o u n d s } } { \mathcal P } _ { i } ^ { ( r ) } \qquad \mathrm { w h e r e } ~ { \mathcal P } _ { i } ^ { ( r ) } = \Big \{ j : h ^ { ( r ) } ( q _ { i } ) = h ^ { ( r ) } ( q _ { j } ) \Big \}
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
The multi-round case essentially involves performing LSH attention $n _ { r o u n d s }$ times in parallel; the details of the procedure are described in in Appendix A.
|
| 96 |
+
|
| 97 |
+
Causal masking for shared-QK attention. In a Transformer decoder, masking (denoted by $m ( j , \mathcal { P } _ { i } )$ in Equation 3) is used to prevent positions from attending into the future. To implement masking in LSH attention, we associate every query/key vector with a position index, re-order the position indices using the same permutations used to sort the query/key vectors, and then use a comparison operation to compute the mask.
|
| 98 |
+
|
| 99 |
+
Table 1: Memory and time complexity of attention variants. We write $l$ for length, $b$ for batch size, $n _ { h }$ for the number of heads, $n _ { c }$ for the number of LSH chunks, $n _ { r }$ for the number of hash repetitions.
|
| 100 |
+
|
| 101 |
+
<table><tr><td>Attention Type</td><td>Memory Complexity</td><td>Time Complexity</td></tr><tr><td>Scaled Dot-Product</td><td>max(bnnldk,bnnl²)</td><td>max(bnnldk,bnnl2)</td></tr><tr><td>Memory-Efficient</td><td>max(bnnldk,bnnl²)</td><td>max(bnhldk,bnnl²)</td></tr><tr><td>LSH Attention</td><td>max(bnnldk,bnnlnr(4l/nc)2)</td><td>max(bnhldk,bnhnrl(4l/nc)²)</td></tr></table>
|
| 102 |
+
|
| 103 |
+
Table 2: Accuracies on the duplication task of a 1-layer Transformer model with full attention and with locality-sensitive hashing attention using different number of parallel hashes.
|
| 104 |
+
|
| 105 |
+
<table><tr><td></td><td rowspan="2">Eval</td><td rowspan="2">Full Attention</td><td rowspan="2">LSH-8</td><td rowspan="2">LSH-4</td><td rowspan="2">LSH-2</td><td rowspan="2">LSH-1</td></tr><tr><td>Train</td></tr><tr><td>Full Attention</td><td></td><td>100%</td><td>94.8%</td><td>92.5%</td><td>76.9%</td><td>52.5%</td></tr><tr><td colspan="2">LSH-4</td><td>0.8%</td><td>100%</td><td>99.9%</td><td>99.4%</td><td>91.9%</td></tr><tr><td colspan="2">LSH-2</td><td>0.8%</td><td>100%</td><td>99.9%</td><td>98.1%</td><td>86.8%</td></tr><tr><td colspan="2">LSH-1</td><td>0.8%</td><td>99.9%</td><td>99.6%</td><td>94.8%</td><td>77.9%</td></tr></table>
|
| 106 |
+
|
| 107 |
+
While attention to the future is not allowed, typical implementations of the Transformer do allow a position to attend to itself. Such behavior is undesirable in a shared-QK formulation because the dot-product of a query vector with itself will almost always be greater than the dot product of a query vector with a vector at another position. We therefore modify the masking to forbid a token from attending to itself, except in situations where a token has no other valid attention targets (e.g. the first token in a sequence).
|
| 108 |
+
|
| 109 |
+
# 2.1 ANALYSIS ON A SYNTHETIC TASK
|
| 110 |
+
|
| 111 |
+
To verify the performance of LSH attention and study its behavior, we start with the following synthetic task: duplicate a sequence of symbols. In this task, each training and testing example has the form $0 w 0 w$ where $w \in \bar { \{ 1 , \ldots , N \} ^ { * } }$ is a sequence of symbols ranging from 1 to $N$ (we use $N = 1 2 7$ in our experiments). An example with the word $w$ of length 3 is given below.
|
| 112 |
+
|
| 113 |
+
<table><tr><td rowspan=1 colspan=1>Example:</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>19</td><td rowspan=1 colspan=1>113</td><td rowspan=1 colspan=1>72</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>19</td><td rowspan=1 colspan=1>113</td><td rowspan=1 colspan=1>72</td></tr></table>
|
| 114 |
+
|
| 115 |
+
To study LSH attention, we train a language model on examples of the above form where each $w$ is of length 511 (so the whole input $0 w 0 w$ is of length 1024). As this is a language modeling task, we always predict the next symbol given all the previous ones, but we mask the loss and accuracy to only consider positions in the second half of the input, i.e., those that can actually be predicted.
|
| 116 |
+
|
| 117 |
+
The above task can be solved perfectly (to accuracy $100 \%$ and loss 0) by a 1-layer Transformer model. Note though, that it requires non-local attention lookups, so it cannot be solved by any model relying on sparse attention with a limited span. To make it easy and fast to train but similar to models used in NLP, we use a 1-layer Transformer with $d _ { m o d e l } = d _ { f f } = 2 5 6$ and 4 heads. We train it for 150K steps in 4 different settings: with full attention, LSH attention with $n _ { r o u n d s } = 1$ , $n _ { r o u n d s } = 2$ and $n _ { r o u n d s } = 4$ .
|
| 118 |
+
|
| 119 |
+
From the results summarized in Table 2 we see that a model trained with full attention can be immediately used with LSH attention, but at some loss of accuracy. When trained from scratch with LSH attention, the model trained with 4 hashes achieves almost perfect accuracy as well. Interestingly, the accuracy becomes perfect when evaluated with 8 hashes. It goes down when evaluated with 2 or 1 hashes. Models trained with less hashes show worse results but even the model trained with just 1 hash performs almost perfectly when evaluated with 8 hashes.
|
| 120 |
+
|
| 121 |
+
# 3 REVERSIBLE TRANSFORMER
|
| 122 |
+
|
| 123 |
+
As the above section shows, the complexity of attention can be reduced from square in length to linear, provided an approximation is acceptable. But it is clear from Table 1 that each field starts with a $b \cdot n _ { h } \cdot l$ term: the $b \cdot n _ { h } \cdot l \cdot d _ { k }$ , or alternatively $b \cdot l \cdot d _ { m o d e l }$ cost cannot be avoided. Indeed, the activations before each layer are already of the size $b \cdot l \cdot d _ { m o d e l }$ , so the memory use of the whole model with $n _ { l }$ layers is at least $b \cdot l \cdot d _ { m o d e l } \cdot n _ { l }$ . Even worse: inside the feed-forward layers of Transformer this goes up to $\boldsymbol { b } \cdot \boldsymbol { l } \cdot d _ { f f } \cdot n _ { l }$ . In a big Transformer it is usual to set $d _ { f f } = 4 K$ and $n _ { l } = 1 6$ so with $l = 6 4 K$ this again would use an impractical $1 6 G B$ of memory
|
| 124 |
+
|
| 125 |
+
In this section, we show how to reduce this cost by first dealing with the $n _ { l }$ part of the term using reversible layers and then showing how chunking can allow us to handle the $d _ { f f }$ problem. The effects of each of these approaches on memory and time complexity are summarized in Table 3.
|
| 126 |
+
|
| 127 |
+
RevNets. Reversible residual networks were introduced by Gomez et al. (2017) where it was shown that they can replace ResNets for image classification. The main idea is to allow the activations at any given layer to be recovered from the activations at the following layer, using only the model parameters. Rather than having to checkpoint intermediate values for use in the backward pass, layers can be reversed one-by-one as back-propagation proceeds from the output of the network to its input. Whereas a normal residual layer performs a function $x \mapsto y$ that operates on a single input and produces a single output and has the form $y = x + F ( x )$ , a reversible layer works on pairs of inputs/outputs: $( x _ { 1 } , x _ { 2 } ) \mapsto ( y _ { 1 } , y _ { 2 } )$ , and follows the equations:
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
y _ { 1 } = x _ { 1 } + F ( x _ { 2 } ) y _ { 2 } = x _ { 2 } + G ( y _ { 1 } )
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
A layer can be reversed by subtracting (rather than adding) the residuals:
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
x _ { 2 } = y _ { 2 } - G ( y _ { 1 } ) x _ { 1 } = y _ { 1 } - F ( x _ { 2 } )
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
Reversible Transformer. We apply the RevNet idea to the Transformer by combining the attention and feed-forward layers inside the revnet block. In the notation above, F becomes an attention layer while $\mathbf { G }$ becomes the feed-forward layer. Note that Layer Normalization (Ba et al., 2016) is moved inside the residual blocks.
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
Y _ { 1 } = X _ { 1 } + \mathrm { A t t e n t i o n } ( X _ { 2 } ) \qquad Y _ { 2 } = X _ { 2 } + \mathrm { F e e d F o r w a r d } ( Y _ { 1 } )
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
The reversible Transformer does not need to store activations in each layer and so gets rid of the $n _ { l }$ term. In Section 5 we show that it performs the same as the normal Transformer when using the same number of parameters; we achieve this by having both $x _ { 1 }$ and $x _ { 2 }$ have size $d _ { m o d e l }$ .
|
| 146 |
+
|
| 147 |
+
Chunking. While reversibility covers the $n _ { l }$ term, the thicker layers can still use a lot of memory. The feed-forward layer in particular can use intermediate vectors of dimensionality $d _ { f f } = 4 K$ or higher. However, computations in feed-forward layers are completely independent across positions in a sequence, so the computation can be split into $c$ chunks:
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
Y _ { 2 } = \left[ Y _ { 2 } ^ { ( 1 ) } ; \ldots ; Y _ { 2 } ^ { ( c ) } \right] = \left[ X _ { 2 } ^ { ( 1 ) } + { \mathrm { F e e d F o r w a r d } } ( Y _ { 1 } ^ { ( 1 ) } ) ; \ldots ; X _ { 2 } ^ { ( c ) } + { \mathrm { F e e d F o r w a r d } } ( Y _ { 1 } ^ { ( c ) } ) \right]
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
This layer is typically batched by performing operations for all positions in parallel, but operating on one chunk at a time can reduce memory. The reverse computation in (8) and the backward pass are also chunked. In addition to the feed-forward layers, for models with large vocabulary (more than $d _ { m o d e l }$ word types) we also chunk the log-probabilities at the output and calculate the loss for sections of the sequence at a time.
|
| 154 |
+
|
| 155 |
+
Chunking, large batches and parameter reuse. With chunking and reversible layers the memory we use for activations in the whole network is independent of the number of layers. The same is not true for parameters though as their number grows with the number of layers. This problem is remedied though because we can swap layer parameters to and from CPU memory when this layer is not computing. In a standard Transformer this would be inefficient because memory transfer to CPU is slow. The batch size multiplied by length in Reformer is much larger though and therefore the amount of compute done with the parameters amortizes the cost of their transfer.
|
| 156 |
+
|
| 157 |
+
Table 3: Memory and time complexity of Transformer variants. We write $d _ { m o d e l }$ and $d _ { f f }$ for model depth and assume $d _ { f f } \geq d _ { m o d e l }$ ; $b$ stands for batch size, $l$ for length, $n _ { l }$ for the number of layers. We assume $n _ { c } = l / 3 2$ so $4 l / n _ { c } = 1 2 8$ and we write $c = 1 2 8 ^ { 2 }$ .
|
| 158 |
+
|
| 159 |
+
<table><tr><td>Model Type</td><td>Memory Complexity</td><td>Time Complexity</td></tr><tr><td>Transformer</td><td>max(bldff,bnnl²)nt</td><td>(bldff+bnnl²)nt</td></tr><tr><td>Reversible Transformer</td><td>max(bldff,bnhl²)</td><td>(bnhldff+bnnl2)nl</td></tr><tr><td>Chunked Reversible Transformer</td><td>max(bldmodet, bnnl2)</td><td>(bnnldff+bnnl²)nl</td></tr><tr><td>LSHTransformer</td><td>max(bldff,bnnlnrc)ni</td><td>(bldff+bnhnrlc)ni</td></tr><tr><td>Reformer</td><td>max(bldmodel,bnhlnrc)</td><td>(bldff+bnhnrlc)ni</td></tr></table>
|
| 160 |
+
|
| 161 |
+
# 4 RELATED WORK
|
| 162 |
+
|
| 163 |
+
The Transformer model introduced in (Vaswani et al., 2017) has been used widely in natural language tasks and further extended to model diverse data such as music scores (Huang et al., 2018), and images (Parmar et al., 2018; Ramachandran et al., 2019). Most notably, this model class has been applied successfully in the self-supervised training of extremely large language models (Devlin et al., 2018; Radford et al., 2019).
|
| 164 |
+
|
| 165 |
+
Given the enormous computational requirements of state of the art sequence models, there has been increasing interest in finding methods to reduce the memory footprint and computational requirements of Transformer models. In addition to standard methods such as precision reduction and gradient checkpointing (Sohoni et al., 2019), more efficient versions of the Transformer model’s self-attention mechanism (Sukhbaatar et al., 2019a;b) have also recently been explored.
|
| 166 |
+
|
| 167 |
+
In particular, leveraging sparsity in the attention layers has proved fruitful. OpenAI introduced the sparse Transformer (Child et al., 2019) which exploits a factorized sparse representation of attention. Using product-key attention to increase the key space has also been used to reduce memory requirements in the feed-forward layers with no loss in performance (Lample et al., 2019).
|
| 168 |
+
|
| 169 |
+
Locality-sensitive hashing (LSH) has, to our knowledge, not been directly applied to Transformer attention layers before. But previous work using external memory with neural networks has dealt with memories of large sizes. The original implementation of memory networks (Weston et al., 2014) and later work on scaling it (Bordes et al., 2015; Chandar et al., 2016) used memory with size in the millions. The cost of doing so is that the memory must be fixed prior to training. Moreover, since during the beginning of training the model is unlikely to query the memory correctly, strong supervision is used to encourage the model to query memory locations that are useful. These hints are either given as additional supervising information by the task or determined heuristically as in Hill et al. (2015). The requirement that the memory be fixed before has been removed in Santoro et al. (2016) at the cost of memory size and later alleviated by Rae et al. (2016). The last paper considered memory lookups with approximate nearest neighbors including both LSH and random kd-trees, but only for lookups in external memory.
|
| 170 |
+
|
| 171 |
+
# 5 EXPERIMENTS
|
| 172 |
+
|
| 173 |
+
In this section we present experimental results demonstrating the techniques described above. We analyze the techniques one-by-one to make clear which combinations have impact on performance. We start by showing that reversible layers and shared query-key spaces do not impact performance, then proceed to analyze hashing attention and finally the full Reformer model.
|
| 174 |
+
|
| 175 |
+
We ran our experiments on the imagenet64 and enwik8-64K tasks, where the latter is a variant of enwik8 that is chunked into subsequences of $2 ^ { 1 6 } \ : = \ : 6 4 K$ tokens. We use 3-layer models for our ablations so as to make it tractable to compare with the regular Transformer, which has high memory usage and performs full $O ( l ^ { 2 } )$ attention. All experiments have $d _ { m o d e l } = 1 0 2 4$ , $d _ { f f } = 4 0 9 6$ , $n _ { h e a d s } ~ = ~ 8$ , and a total batch size of 8 sequences. We used the Adafactor optimizer (Shazeer & Stern, 2018) for training these models. We also evaluate on the WMT 2014 English-to-German translation task, following the hyperparameters of Vaswani et al. (2017). Training for all experiments was parallelized across 8 devices (8 GPUs or 8 TPU v3 cores). Code for training our models is made publicly available.2
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 3: Effect of shared query-key space (left) and reversibility (right) on performance on enwik8 and imagenet64 training. The curves show bits per dim on held-out data.
|
| 179 |
+
|
| 180 |
+
Table 4: BLEU scores on newstest2014 for WMT English-German (En–De). We additionally report detokenized BLEU scores as computed by sacreBLEU (Post, 2018).
|
| 181 |
+
|
| 182 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">sacreBLEU</td></tr><tr><td>BLEU</td><td>Uncased3</td><td>Cased4</td></tr><tr><td>Vaswani etal. (2017),base model</td><td>27.3</td><td></td><td></td></tr><tr><td>Vaswani et al. (2017), big</td><td>28.4</td><td></td><td></td></tr><tr><td>Ott et al. (2018), big</td><td>29.3</td><td></td><td></td></tr><tr><td>Reversible Transformer (base,10oK steps)</td><td>27.6</td><td>27.4</td><td>26.9</td></tr><tr><td>Reversible Transformer (base,5OoK steps,no weight sharing)</td><td>28.0</td><td>27.9</td><td>27.4</td></tr><tr><td>Reversible Transformer (big,3OOK steps,no weight sharing)</td><td>29.1</td><td>28.9</td><td>28.4</td></tr></table>
|
| 183 |
+
|
| 184 |
+
Effect of sharing QK. We first consider the effect of shared-QK attention on a regular Transformer model. Shared-QK attention sets $\begin{array} { r } { k _ { j } ~ = ~ \frac { q _ { j } } { \parallel q _ { j } \parallel } } \end{array}$ and prevents tokens from attending to themselves (except when no other context is available). In the left part of Figure 3, we plot perplexity curves for both regular and shared-QK attention. A shared query-key space does not perform worse than regular attention; in fact, for enwik8 it appears to train slightly faster. In other words, we are not sacrificing accuracy by switching to shared-QK attention.
|
| 185 |
+
|
| 186 |
+
Effect of reversible layers. In the two plots on the right in Figure 3, we compare a regular Transformer per Vaswani et al. (2017) with the reversible one describe in Section 3. The two models have identical parameter counts, and the learning curves likewise appear to be nearly the same. These results show that the memory savings in the reversible Transformer do not come at the expense of accuracy.
|
| 187 |
+
|
| 188 |
+
Reversible layers in machine translation. We also evaluate reversible layers in the context of an encoder-decoder Transformer model for machine translation from English to German. We start by making both the encoder and the decoder fully reversible in the Transformer-base architecture, and see that the resulting model performs comparably to Vaswani et al. (2017) when trained for 100K steps. We also evaluate training for a greater number of steps and with a larger model. Reformer models are very memory-efficient, so for the latter two experiments we do not need to save memory by sharing embedding and output projection weight matrices throughout the model. Results are shown in Table 4. We do not apply LSH attention in this setting because examples are single sentences, and sentences tend to be relatively short. Our typical LSH attention configuration uses chunks of 128 tokens after hashing and sorting, whereas the examples in the WMT14 test set are all shorter than 128 tokens.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 4: LSH attention performance as a function of hashing rounds on imagenet64.
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Figure 5: Left: LSH attention performance as a function of number of layers on enwik8. Right: Speed of attention evaluation as a function of input length for full- and LSH- attention.
|
| 195 |
+
|
| 196 |
+
LSH attention in Transformer. LSH attention is an approximation for full attention that, as evidenced in Figure 4, becomes more accurate as the number of hashes increases. At $n _ { r o u n d s } = 8$ , it already almost matches full attention. The computational cost of a model grows with the number of hashes, so this hyperparameter can be adjusted depending on the available compute budget. Additionally, as in Table 2, the number of hashes can be increased at evaluation time to produce more accurate results. On the right half of Figure 5, we plot the speed of different attention types vs. the sequence length, while holding the total number of tokens fixed. We see that while regular attention becomes slower at longer sequence length, LSH attention speed remains flat.
|
| 197 |
+
|
| 198 |
+
Large Reformer models. To verify that the Reformer can indeed fit large models on a single core and train fast on long sequences, we train up to 20-layer big Reformers on enwik8 and imagenet64. As can be seen in Figure 5, these models fit into memory and train. We were not able to train Transformer baselines in this case as they are too slow and memory-hungry, but we see clear improvement with the number of layers. A 12-layer model on enwik8 trained for 20K steps with a dropout rate of 0.1 achieves 1.19 bits/dim on the test set. We also trained a 12-layer Reformer model for longer with further tuning and improvements and we reached 1.05 bits/dim on the enwiki8 test set.
|
| 199 |
+
|
| 200 |
+
# 6 CONCLUSION
|
| 201 |
+
|
| 202 |
+
Reformer combines the modeling capacity of a Transformer with an architecture that can be executed efficiently on long sequences and with small memory use even for models with a large number of layers. We believe that this will help large, richly-parameterized Transformer models become more widespread and accessible. Also, the ability to handle long sequences opens the way for the use of the Reformer on many generative tasks. In addition to generating very long coherent text, the Reformer can bring the power of Transformer models to other domains like time-series forecasting, music, image and video generation.
|
| 203 |
+
|
| 204 |
+
# REFERENCES
|
| 205 |
+
|
| 206 |
+
Rami Al-Rfou, Dokook Choe, Noah Constant, Mandy Guo, and Llion Jones. Character-level language modeling with deeper self-attention. CoRR, abs/1808.04444, 2018. URL http: //arxiv.org/abs/1808.04444.
|
| 207 |
+
Alexandr Andoni, Piotr Indyk, Thijs Laarhoven, Ilya P. Razenshteyn, and Ludwig Schmidt. Practical and optimal LSH for angular distance. CoRR, abs/1509.02897, 2015. URL http://arxiv. org/abs/1509.02897.
|
| 208 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. URL http://arxiv.org/abs/1607.06450.
|
| 209 |
+
Antoine Bordes, Nicolas Usunier, Sumit Chopra, and Jason Weston. Large-scale simple question answering with memory networks. CoRR, abs/1506.02075, 2015. URL http://arxiv.org/ abs/1506.02075.
|
| 210 |
+
Sarath Chandar, Sungjin Ahn, Hugo Larochelle, Pascal Vincent, Gerald Tesauro, and Yoshua Bengio. Hierarchical memory networks. arXiv preprint arXiv:1605.07427, 2016.
|
| 211 |
+
Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. URL https://openai.com/blog/sparse-transformers, 2019.
|
| 212 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. CoRR, abs/1810.04805, 2018. URL http://arxiv.org/abs/1810.04805.
|
| 213 |
+
Aidan N Gomez, Mengye Ren, Raquel Urtasun, and Roger B Grosse. The reversible residual network: Backpropagation without storing activations. In Advances in neural information processing systems, pp. 2214–2224, 2017.
|
| 214 |
+
Felix Hill, Antoine Bordes, Sumit Chopra, and Jason Weston. The goldilocks principle: Reading children’s books with explicit memory representations. CoRR, abs/1511.02301, 2015. URL http://arxiv.org/abs/1511.02301.
|
| 215 |
+
Cheng-Zhi Anna Huang, Ashish Vaswani, Jakob Uszkoreit, Noam Shazeer, Curtis Hawthorne, Andrew M Dai, Matthew D Hoffman, and Douglas Eck. Music transformer: Generating music with long-term structure. arXiv preprint arXiv:1809.04281, 2018.
|
| 216 |
+
Guillaume Lample, Alexandre Sablayrolles, Marc’Aurelio Ranzato, Ludovic Denoyer, and Herve´ Jegou. Large memory layers with product keys. ´ CoRR, abs/1907.05242, 2019. URL http: //arxiv.org/abs/1907.05242.
|
| 217 |
+
Peter J. Liu, Mohammad Saleh, Etienne Pot, Ben Goodrich, Ryan Sepassi, Lukasz Kaiser, and Noam Shazeer. Generating wikipedia by summarizing long sequences. CoRR, abs/1801.10198, 2018. URL http://arxiv.org/abs/1801.10198.
|
| 218 |
+
Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. Scaling neural machine translation. In Proceedings of the Third Conference on Machine Translation: Research Papers, pp. 1–9, Brussels, Belgium, October 2018. Association for Computational Linguistics. doi: 10.18653/v1/W18-6301. URL https://www.aclweb.org/anthology/W18-6301.
|
| 219 |
+
|
| 220 |
+
Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, and Alexander Ku. Image transformer. CoRR, abs/1802.05751, 2018. URL http://arxiv.org/abs/1802. 05751.
|
| 221 |
+
|
| 222 |
+
Matt Post. A call for clarity in reporting BLEU scores. In Proceedings of the Third Conference on Machine Translation: Research Papers, pp. 186–191, Belgium, Brussels, October 2018. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/ W18-6319.
|
| 223 |
+
|
| 224 |
+
Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. 2019.
|
| 225 |
+
|
| 226 |
+
Jack W Rae, Jonathan J Hunt, Tim Harley, Ivo Danihelka, Andrew Senior, Greg Wayne, Alex Graves, and Timothy P Lillicrap. Scaling memory-augmented neural networks with sparse reads and writes. In Advances in Neural Information Processing Systems, (NIPS), 2016.
|
| 227 |
+
|
| 228 |
+
Prajit Ramachandran, Niki Parmar, Ashish Vaswani, Irwan Bello, Anselm Levskaya, and Jonathon Shlens. Stand-alone self-attention in vision models. CoRR, abs/1906.05909, 2019. URL http: //arxiv.org/abs/1906.05909.
|
| 229 |
+
|
| 230 |
+
Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy P. Lillicrap. Oneshot learning with memory-augmented neural networks. CoRR, abs/1605.06065, 2016. URL http://arxiv.org/abs/1605.06065.
|
| 231 |
+
|
| 232 |
+
Noam Shazeer and Mitchell Stern. Adafactor: Adaptive learning rates with sublinear memory cost. CoRR, abs/1804.04235, 2018. URL http://arxiv.org/abs/1804.04235.
|
| 233 |
+
|
| 234 |
+
Noam Shazeer, Youlong Cheng, Niki Parmar, Dustin Tran, Ashish Vaswani, Penporn Koanantakool, Peter Hawkins, HyoukJoong Lee, Mingsheng Hong, Cliff Young, Ryan Sepassi, and Blake Hechtman. Mesh-tensorflow: Deep learning for supercomputers. CoRR, abs/1811.02084, 2018. URL http://arxiv.org/abs/1811.02084.
|
| 235 |
+
|
| 236 |
+
Nimit Sharad Sohoni, Christopher Richard Aberger, Megan Leszczynski, Jian Zhang, and Christopher Re. Low-memory neural network training: A technical report. ´ CoRR, abs/1904.10631, 2019. URL http://arxiv.org/abs/1904.10631.
|
| 237 |
+
|
| 238 |
+
Sainbayar Sukhbaatar, Edouard Grave, Piotr Bojanowski, and Armand Joulin. Adaptive attention span in transformers. CoRR, abs/1905.07799, 2019a. URL http://arxiv.org/abs/ 1905.07799.
|
| 239 |
+
|
| 240 |
+
Sainbayar Sukhbaatar, Edouard Grave, Guillaume Lample, Herve J ´ egou, and Armand Joulin. Aug- ´ menting self-attention with persistent memory. CoRR, abs/1907.01470, 2019b. URL http: //arxiv.org/abs/1907.01470.
|
| 241 |
+
|
| 242 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. CoRR, 2017. URL http: //arxiv.org/abs/1706.03762.
|
| 243 |
+
|
| 244 |
+
Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. CoRR, abs/1410.3916, 2014. URL http://arxiv.org/abs/1410.3916.
|
| 245 |
+
|
| 246 |
+
# A MULTI-ROUND LSH ATTENTION
|
| 247 |
+
|
| 248 |
+
In this section we describe in more detail the multi-hash version of our LSH attention mechanism. We first repeat Equation (3) from the main text, which describes a general formulation of attention with sparsity:
|
| 249 |
+
|
| 250 |
+
$$
|
| 251 |
+
o _ { i } = \sum _ { j \in \widetilde { \mathcal { P } } _ { i } } \exp \left( q _ { i } \cdot k _ { j } - m ( j , \mathcal { P } _ { i } ) - z ( i , \mathcal { P } _ { i } ) \right) v _ { j } \quad \mathrm { ~ w h e r e ~ } m ( j , \mathcal { P } _ { i } ) = \left\{ \begin{array} { l l } { \infty } & { \mathrm { i f ~ } j \notin \mathcal { P } _ { i } } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 252 |
+
$$
|
| 253 |
+
|
| 254 |
+
In the multi-round case, a query position $i$ can attend to key positions $\mathcal { P } _ { i }$ as defined in (6), which we also repeat here:
|
| 255 |
+
|
| 256 |
+
$$
|
| 257 |
+
{ \mathcal P } _ { i } = \bigcup _ { r = 1 } ^ { n _ { r o u n d s } } { \mathcal P } _ { i } ^ { ( r ) } \qquad \mathrm { w h e r e } ~ { \mathcal P } _ { i } ^ { ( r ) } = \Big \{ j : h ^ { ( r ) } ( q _ { i } ) = h ^ { ( r ) } ( q _ { j } ) \Big \}
|
| 258 |
+
$$
|
| 259 |
+
|
| 260 |
+
For batching purposes, attention is performed on chunks of sorted queries/keys:
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
\widetilde { \mathcal { P } } _ { i } ^ { ( r ) } = \left\{ j : \left\lfloor \frac { s _ { i } ^ { ( r ) } } { m } \right\rfloor - 1 \leq \left\lfloor \frac { s _ { j } ^ { ( r ) } } { m } \right\rfloor \leq \left\lfloor \frac { s _ { i } ^ { ( r ) } } { m } \right\rfloor \right\}
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
Combining (3) and (6) gives:
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\begin{array} { r l r } { { \alpha _ { i } = \sum _ { j \in \Gamma } \exp ( q _ { i } \cdot k _ { j } - m ( j , \mathcal { P } _ { i } ) - z ( i , \mathcal { P } _ { j } ) ) \times } } \\ & { } & { \beta _ { i } \leq \frac { 1 } { \beta \epsilon _ { i } ^ { p ( \cdot ) } } , } \\ & { } & { \gamma = \sum _ { s = 1 } ^ { N _ { t } } \exp ( z ( i , \mathcal { P } _ { i } ^ { ( r ) } ) - z ( i , \mathcal { P } _ { j } ) ) \sum _ { j \in \Gamma } \frac { 1 } { N _ { t } } \frac { 1 } { N _ { t } } \exp ( q _ { i } \cdot k _ { i } - m ( j , \mathcal { P } _ { i } ^ { ( r ) } ) - z ( i , \mathcal { P } _ { j } ^ { ( r ) } ) ) \times } \\ & { } & { \exp ( z ( i , \mathcal { P } _ { i } ^ { ( r ) } ) - z ( i , \mathcal { P } _ { j } ^ { ( r ) } ) ) , } \\ & { } & { ( 1 3 , \exp ( z ( i , \mathcal { P } _ { i } ^ { ( r ) } ) - z ( i , \mathcal { P } _ { j } ) ) \alpha _ { i } ^ { ( r ) } } \\ & { } & { \exp ( z ( i , \mathcal { P } _ { i } ^ { ( r ) } ) - z ( i , \mathcal { P } _ { j } ^ { ( r ) } ) ) \exp ( z ( i , \mathcal { P } _ { i } ^ { ( r ) } ) ) \exp ( \mathrm { ~ \it 1 4 ~ } } \\ & { } & { \exp ( \phi ( i , k _ { j } - m ( i _ { j } ^ { ( r ) } ) - z ( i , \mathcal { P } _ { j } ^ { ( r ) } ) ) ) \exp _ { j } } \\ & { } & { \beta _ { i } \leq \mathrm { \it ~ \it ~ \it ~ \alpha ~ } _ { j } \leq \mathrm { \it ~ \it ~ \alpha ~ } _ { i } \leq \mathrm { \it ~ \it ~ \alpha ~ } _ { j } } \\ & { } & \exp ( N _ { t } \exp N _ { i , j } + | \{ \begin{array} { l l } { \Gamma _ { j } ^ { ( r ) } \cdot \xi _ { j } \in \mathcal { P } _ { j } ^ { ( r ) } } \\ { \Gamma _ { j } ^ { ( r ) } \cdot \xi _ { j } \in \mathcal { P } _ { j } ^ { ( r ) } } \end{array} \} \mathrm { ~ a n d ~ } m _ { i j } ^ ( \end{array}
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
Each round of LSH attention produces a vector $o _ { i } ^ { ( r ) }$ that can be computed independently from other rounds, except for the inclusion of a term $N _ { i , j }$ to avoid double-counting elements when constructing the union of $\mathcal { P } _ { i } ^ { ( r ) }$ sets. In our implementation we fold the $N _ { i , j }$ factor into the masking term $m _ { i , j } ^ { ( r ) }$ .
|
| 273 |
+
|
| 274 |
+
We also modify $m _ { i , j _ { . } } ^ { ( r ) }$ to introduce a special case for $i = j$ . This case is added because causal masking in a standard Transformer allows position to attend to itself, which is not desirable in a shared-QK formulation. We set the mask to a large but finite value to disallow attention-in-place, except in the situation where a token has no other valid attention targets. For example, the first token in a sequence attends only to itself, because no prior context is available.
|
md/train/vQzcqQWIS0q/vQzcqQWIS0q.md
ADDED
|
@@ -0,0 +1,387 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNABLE EMBEDDING SIZES FOR RECOMMENDER SYSTEMS
|
| 2 |
+
|
| 3 |
+
Siyi Liu1, Chen $\mathbf { G a o } ^ { 2 } ;$ ∗, Yihong Chen3, Depeng $\mathbf { J i n } ^ { 2 }$ , Yong $\mathbf { L i } ^ { 2 }$
|
| 4 |
+
|
| 5 |
+
1University of Electronic Science and Technology of China, Chengdu, China 2Beijing National Research Center for Information Science and Technology, Department of Electronic Engineering, Tsinghua University, Beijing 100084, China 3University College London, London, United Kingdom ssui.liu1022@gmail.com, gc16@mails.tsinghua.edu.cn, yihong-chen@outlook.com, {jindp,liyong07}@tsinghua.edu.cn
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
The embedding-based representation learning is commonly used in deep learning recommendation models to map the raw sparse features to dense vectors. The traditional embedding manner that assigns a uniform size to all features has two issues. First, the numerous features inevitably lead to a gigantic embedding table that causes a high memory usage cost. Second, it is likely to cause the over-fitting problem for those features that do not require too large representation capacity. Existing works that try to address the problem always cause a significant drop in recommendation performance or suffer from the limitation of unaffordable training time cost. In this paper, we propose a novel approach, named $\mathrm { P E P ^ { 1 } }$ (short for Plug-in Embedding Pruning), to reduce the size of the embedding table while avoiding the drop of recommendation accuracy. PEP prunes embedding parameter where the pruning threshold(s) can be adaptively learned from data. Therefore we can automatically obtain a mixed-dimension embedding-scheme by pruning redundant parameters for each feature. PEP is a general framework that can plug in various base recommendation models. Extensive experiments demonstrate it can efficiently cut down embedding parameters and boost the base model’s performance. Specifically, it achieves strong recommendation performance while reducing $9 7 - 9 9 \%$ parameters. As for the computation cost, PEP only brings an additional $20 \%$ time cost compared with base models.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
The success of deep learning-based recommendation models (Zhang et al., 2019) demonstrates their advantage in learning feature representations, especially for the most widely-used categorical features. These models utilize the embedding technique to map these sparse categorical features into real-valued dense vectors to extract users’ preferences and items’ characteristics. The learned vectors are then fed into prediction models, such as the inner product in FM (Rendle, 2010), selfattention networks in AutoInt (Song et al., 2019), to obtain the prediction results. The embedding table could contain a large number of parameters and cost huge amounts of memory since there are always a large number of raw features. Therefore, the embedding table takes the most storage cost.
|
| 14 |
+
|
| 15 |
+
A good case in point is the YouTube Recommendation Systems (Covington et al., 2016). It demands tens of millions of parameters for embeddings of the YouTube video IDs. Considering the increasing demand for instant recommendations in today’s service providers, the scale of embedding tables becomes the efficiency bottleneck of deep learning recommendation models. On the other hand, features with uniform embedding size may hard to handle the heterogeneity among different features. For example, some features are more sparse, and assigning too large embedding sizes is likely to result in over-fitting issues. Consequently, recommendation models tend to be sub-optimal when embedding sizes are uniform for all features.
|
| 16 |
+
|
| 17 |
+
The existing works towards this problem can be divided into two categories. Some works (Zhang et al., 2020; Shi et al., 2020; Kang et al., 2020) proposed that some closely-related features can share parts of embeddings, reducing the whole cost. Some other works (Joglekar et al., 2020; Zhao et al., 2020b;a; Cheng et al., 2020) proposed to assign embeddings with flexible sizes to different features relying on human-designed rules (Ginart et al., 2019) or neural architecture search (Joglekar et al., 2020; Zhao et al., 2020b;a; Cheng et al., 2020). Despite a reduced embedding size table, these methods still cannot perform well on the two most concerned aspects, recommendation performance and computation cost. Specifically, these methods either obtain poor recommendation performance or spend a lot of time and efforts in getting proper embedding sizes.
|
| 18 |
+
|
| 19 |
+
In this paper, to address the limitations of existing works, we proposed a simple yet effective pruning-based framework, named Plug-in Embedding Pruning (PEP), which can plug in various embedding-based recommendation models. Our method adopts a direct manner–pruning those unnecessary embedding parameters in one shot–to reduce parameter number.
|
| 20 |
+
|
| 21 |
+
Specifically, we introduce the learnable threshold(s) that can be jointly trained with embedding parameters via gradient descent. Note that the threshold is utilized to determine the importance of each parameter automatically. Then the elements in the embedding vector that are smaller than the threshold will be pruned. Then the whole embedding table is pruned to make sure each feature has a suitable embedding size. That is, the embedding sizes are flexible. After getting the pruned embedding table, we retrain the recommendation model with the inspiration of the Lottery Ticket Hypothesis (LTH) (Frankle & Carbin, 2018), which demonstrates that a subnetwork can reach higher accuracy compared with the original network. Based on flexible embedding sizes and the LTH, our PEP can cuts down embedding parameters while maintaining and even boosting the model’s recommendation performance. Finally, while there is always a trade-off between recommendation performance and parameter number, our PEP can obtain multiple pruned embedding tables by running only once. In other words, our PEP can generate several memory-efficient embedding matrices once-for-all, which can well handle the various demands for performance or memory-efficiency in real-world applications. We conduct extensive experiments on three public benchmark datasets: Criteo, Avazu, and MovieLens-1M. The results demonstrate that our PEP can not only achieve the best performance compared with state-of-the-art baselines but also reduces $9 7 \%$ to $9 9 \%$ parameter usage. Further studies show that our PEP is quite computationally-efficient, requiring a few additional time for embedding-size learning. Furthermore, visualization and interpretability analysis on learned embedding confirm that our PEP can capture features’ intrinsic properties, which provides insights for future researches.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
Existing works try to reduce the embedding table size of recommendation models from two perspectives, embedding parameter sharing and embedding size selection.
|
| 26 |
+
|
| 27 |
+
# 2.1 EMBEDDING PARAMETER SHARING
|
| 28 |
+
|
| 29 |
+
The core idea of these methods is to make different features re-use embeddings via parameter sharing. Kang et al. (2020) proposed MGQE that retrieves embedding fragments from a small size of shared centroid embeddings and then generates final embedding by concatenating those fragments. Zhang et al. (2020) used the double-hash trick to make low-frequency features share a small embedding-table while reducing the likelihood of a hash collision. Shi et al. (2020) tried to yield a unique embedding vector for each feature category from a small embedding table by combining multiple smaller embedding (called embedding fragments). The combination is usually through concatenation, add, or element-wise multiplication among embedding fragments.
|
| 30 |
+
|
| 31 |
+
However, those methods suffer from two limitations. First, engineers are required to carefully design the parameter-sharing ratio to balance accuracy and memory costs. Second, these rough embeddingsharing strategies cannot find the redundant parts in the embedding tables, and thus it always causes a drop in recommendation performance.
|
| 32 |
+
|
| 33 |
+
Table 1: Comparison of our PEP and existing works (AutoInt is a base recommendation model and others are embedding-parameter-reduction methods.)
|
| 34 |
+
|
| 35 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Performance</td><td rowspan=1 colspan=2>ParameterNumber</td><td rowspan=1 colspan=1>Computation Cost</td></tr><tr><td rowspan=1 colspan=1>AutoInt (Song et al., 2019)</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=2>×</td><td rowspan=1 colspan=1>√</td></tr><tr><td rowspan=1 colspan=1>MDE (Ginart et al.,2019)</td><td rowspan=1 colspan=1>×</td><td rowspan=1 colspan=2>√</td><td rowspan=1 colspan=1>×</td></tr><tr><td rowspan=1 colspan=1>NIS (Joglekar et al., 2020)</td><td rowspan=1 colspan=1>×</td><td rowspan=1 colspan=2>√</td><td rowspan=1 colspan=1>×</td></tr><tr><td rowspan=1 colspan=1>DartsEmb (Zhao et al.,2020b)</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=2>√</td><td rowspan=1 colspan=1>×</td></tr><tr><td rowspan=1 colspan=1>DNIS (Cheng et al., 2020)</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=2>√</td><td rowspan=1 colspan=1>×</td></tr><tr><td rowspan=1 colspan=1>Our PEP</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>√</td></tr></table>
|
| 36 |
+
|
| 37 |
+
In this work, our method automatically chooses suitable embedding usages by learning from data. Therefore, engineers can be free from massive efforts for designing sharing strategy, and the model performance can be boosted via removing redundant parameters and alleviating the over-fitting issue.
|
| 38 |
+
|
| 39 |
+
# 2.2 EMEBDDING SIZE SELECTION
|
| 40 |
+
|
| 41 |
+
The embedding-sharing methods assign uniform embedding sizes to every feature, which may still fail to deal with the heterogeneity among different features. Recently, several methods proposed a new paradigm of mixed-dimension embedding table. Specifically, different from assigning all features with uniformed embedding size, different features can have different embedding sizes. MDE (Ginart et al., 2019) proposed a human-defined rule that the embedding size of a feature is proportional to its popularity. However, this rule-based method is too rough and cannot handle those important features with low frequency. Additionally, there are plenty of hyper-parameters in MDE requiring a lot of truning efforts. Some other works (Joglekar et al., 2020; Zhao et al., 2020b;a; Cheng et al., 2020) assigned adaptive embedding sizes to different features, relying on the advances in Neural Architecture Search (NAS) (Elsken et al., 2019), a significant research direction of Automated Machine Learning (AutoML) (Hutter et al., 2019). NIS (Joglekar et al., 2020) used a reinforcement learning-based algorithm to search embedding size from a candidate set predefined by human experts. A controller is adopted to generate the probability distribution of size for specific feature embeddings. This was further extended by DartsEmb (Zhao et al., 2020b) by replacing the reinforcement learning searching algorithm with differentiable search (Liu et al., 2018). AutoDim (Zhao et al., 2020a) allocated different embedding sizes for different feature fields, rather than individual features, in a same way as DartsEmb. DNIS (Cheng et al., 2020) made the candidate embedding size to be continuous without predefined candidate dimensions. However, all these NAS-based methods require extremely high computation costs in the searching procedure. Even for methods that adopt differential architecture search algorithms, the searching cost is still not affordable. Moreover, these methods also require a great effort in designing proper search spaces.
|
| 42 |
+
|
| 43 |
+
Different from these works, our pruning-based method can be trained quite efficiently and does not require any human efforts in determining the embedding-size candidates.
|
| 44 |
+
|
| 45 |
+
# 3 PROBLEM FORMULATION
|
| 46 |
+
|
| 47 |
+
Feature-based recommender system2 is commonly used in today’s information services. In general, deep learning recommendation models take various raw features, including users’ profiles and items’ attributes, as input and predict the probability that a user like an item. Specifically, models take the combination of user’s profiles and item’s attributes, denoted by $\mathbf { x }$ , as its’ input vector, where $\mathbf { x }$ is the concatenation of all fields that could defined as follows:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\mathbf { x } = \left[ \mathbf { x } _ { 1 } ; \mathbf { x } _ { 2 } ; \ldots ; \mathbf { x _ { M } } \right] ,
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $\mathbf { M }$ denotes the number of total feature fields, and $\mathbf { x _ { i } }$ is the feature representation (one-hot vector in usual) of the $i$ -th field. Then for $\mathbf { x _ { i } }$ , the embedding-based recommendation models generate corresponding embedding vector $\mathbf { v _ { i } }$ via following formulation:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\mathbf { v _ { i } } = \mathbf { V _ { i } } \mathbf { x _ { i } } ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\begin{array} { r l } & { \underset { \mathbf { V } _ { 1 } } { \overset { d _ { 1 } } { \sum } } [ \underset { ( \mathbf { a } , 1 ) [ \mathbf { a } , [ \mathbf { a } , \mathbf { \tilde { z } } ] [ \mathbf { a } , \mathbf { i } ] ] , \mathbf { a } , \mathbf { i } } ] } \\ & { \underset { \mathbf { V } _ { 2 } } { \overset { d _ { 1 } } { \sum } } [ \underset { ( \mathbf { a } , 1 ) [ \mathbf { a } , \mathbf { i } ] [ \mathbf { a } , \mathbf { i } ] [ \mathbf { a } , \mathbf { i } ] [ \mathbf { a } , \mathbf { i } ] ] } } \\ & { \underset { \mathbf { V } _ { 3 } } { \overset { d _ { 3 } } { \sum } } [ \underset { ( \mathbf { a } , 1 ) [ \mathbf { a } , \mathbf { i } ] [ \mathbf { a } , \mathbf { i } ] [ \mathbf { a } , \mathbf { i } ] [ \mathbf { a } , \mathbf { i } ] ] } ] } \\ & { \underset { \mathbf { V } _ { 4 } } { \overset { d _ { 1 } } { \sum } } [ \underset { ( \mathbf { a } , \mathbf { i } ) [ \mathbf { a } , \mathbf { i } ] [ \mathbf { a } , \mathbf { i } ] } { \overset { d _ { 1 } } { \sum } } ] \underset { ( \boldsymbol { g } ( \mathbf { s } ) = 0 . 1 5 ) } { \overset { P \mathrm { r u n i n g } } { \sum } } \underset { \mathbf { V } _ { 3 } } { \overset { d _ { 3 } } { \sum } } [ \underset { ( \mathbf { a } , \mathbf { i } ) [ \mathbf { a } , \mathbf { i } ] [ \mathbf { a } , \mathbf { i } ] [ \mathbf { a } ] \longrightarrow ] } [ \underset { \mathbf { F } } { \overset { d _ { 3 } } { \sum } } ] \underset { ( \mathbf { b } , \mathbf { i } ) [ \mathbf { a } , \mathbf { i } ] [ \mathbf { a } , \mathbf { i } ] [ \mathbf { a } , \mathbf { i } ] \atop \vdots } \longrightarrow \hat { \boldsymbol { V } } } \\ & \underset { \mathbf { V } _ { 1 } [ \mathbf { a } , \mathbf { i } ] [ \mathbf { a } , \mathbf { i } ] [ \mathbf { a } , \mathbf { i } ] [ \mathbf { a } , \mathbf { i } ] } \overset d _ \end{array}
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
Figure 1: The basic idea of PEP.
|
| 64 |
+
|
| 65 |
+
where $\mathbf { V _ { i } } \in \mathrm { R } ^ { n _ { i } \times d }$ is an embedding matrix of $i$ -th field, $n _ { i }$ denotes the number of features in the $i$ -th field, and $d$ denotes the size of embedding vectors. The model’s embedding matrices $\mathbf { V }$ for all fields of features can be formulated as follows,
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\mathbf { V } = \{ \mathbf { V _ { 1 } } , \mathbf { V _ { 2 } } , \dots , \mathbf { V _ { M } } \} ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
The prediction score could be calculated with $\mathbf { V }$ and model’s other parameters (mainly refer to the parameters in prediction model) $\Theta$ as follows,
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r } { \hat { y } = \phi ( \mathbf { x } | \mathbf { V } , \Theta ) , } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $\hat { y }$ is the predicted probability and $\phi$ represent the prediction model, such as FM (Rendle, 2010) or AutoInt (Song et al., 2019). As for model training, to learn the models parameters, the optimizer minimizes the training loss as follows,
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\operatorname* { m i n } \mathcal { L } ( \mathbf { V } , \boldsymbol { \Theta } , \mathcal { D } ) ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $\mathcal { D } = \{ \mathbf { x } , y \}$ represents the data fed into the model, $\mathbf { x }$ denotes the input feature, $y$ denotes the ground truth label, and $\mathcal { L }$ is the loss function. The Logloss is the most widely-used loss function in recommendation tasks (Rendle, 2010; Guo et al., 2017; Song et al., 2019) and calculated as follows,
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mathcal { L } = - \frac { 1 } { | \mathcal { D } | } \sum _ { j = 1 } ^ { | \mathcal { D } | } \left( y _ { j } \log \left( \hat { y } _ { j } \right) + \left( 1 - y _ { j } \right) \log \left( 1 - \hat { y } _ { j } \right) \right) ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $| \mathcal D |$ is the total number of training samples and regularization terms are omitted for simplification.
|
| 90 |
+
|
| 91 |
+
# 4 METHODOLOGY
|
| 92 |
+
|
| 93 |
+
# 4.1 LEARNABLE EMBEDDING SIZES THROUGH PRUNING
|
| 94 |
+
|
| 95 |
+
As mentioned above, a feasible solution for memory-efficient embedding learning is to automatically assign different embedding sizes $\tilde { d } _ { i }$ for different features embeddings $\mathbf { v } _ { i }$ , which is our goal. However, to learn $\tilde { d } _ { i }$ directly is infeasible due to its discreteness and extremely-large optimization space. To address it, we propose a novel idea that enforce column-wise sparsity on $\mathbf { V }$ , which equivalently shrinks the embedding size. For example, as it shown in Figure 1, the first value in embedding $\mathbf { v } _ { 1 }$ is pruned and set to zero, leading to a $\tilde { d } _ { 1 } = d _ { 1 } - 1$ embedding size in effect. Furthermore, some unimportant feature embeddings, like $\mathbf { v } _ { 3 }$ , are dropped by set all values to zero3. Thus our method can significantly cut down embedding parameters. Note that the technique of sparse matrix storage help us to significantly save memory usage (Virtanen et al., 2020).
|
| 96 |
+
|
| 97 |
+
In such a way, we recast the problem of embedding-size selection into learning column-wise sparsity for the embedding matrix $\mathbf { V }$ . To achieve that, we design a sparsity constraint on $\mathbf { V }$ as follows,
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\operatorname* { m i n } \mathcal { L } , s . t . \| \mathbf { V } \| _ { 0 } \leq k ,
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $| | \cdot | | _ { 0 }$ denotes the $L _ { 0 }$ -norm, i.e. the number of non-zeros and $k$ is the parameter budget, which is, the constraint on the total number of embedding parameters.
|
| 104 |
+
|
| 105 |
+
However, direct optimization of Equation (7) is NP-hard due to the non-convexity of the $L _ { 0 }$ -norm constraint. To solve this problem, the convex relaxation of $L _ { 0 }$ -norm, called $L _ { 1 }$ -norm, has been studied for a long time (Taheri & Vorobyov, 2011; Beck & Teboulle, 2009; Jain et al., 2014). For example, the Projected Gradient Descent (PGD) (Jain et al., 2014) in particular has been proposed to project parameters to $L _ { 1 }$ ball to make the gradient computable in almost closed form. Note that the $L _ { 1 }$ ball projection is also known as Soft Thresholding (Kusupati et al., 2020). Nevertheless, such methods are still faced with two major issues. First, the process of projecting the optimization values onto $L _ { 1 }$ ball requires too much computation cost, especially when the recommendation model has millions of parameters. Second, the parameter budget $k$ requires human experts to manually set at a global level. Considering that features have various importance for recommendation, such operation is obviously sub-optimal. To tackle those two challenges, inspired by Soft Threshold Reparameterization (Kusupati et al., 2020), we directly optimize the projection of $\mathbf { V }$ and adaptively pruning the $\mathbf { V }$ via learnable threshold(s) which can be updated by gradient descent. The re-parameterization of $\mathbf { V }$ can be formulated as follows,
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\hat { \mathbf { V } } = S ( \mathbf { V } , s ) = s i g n ( \mathbf { V } ) \mathrm { R e L U } ( | \mathbf { V } | - g ( s ) ) ,
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
where $\hat { \mathbf { V } } \in \mathcal { R } ^ { N \times d }$ denotes the re-parameterized embedding matrix, and $g ( s )$ serves as a pruning threshold value, of which sigmoid function is a simple yet effective solution.4 We set the initial value of trainable parameter $s \in \mathcal R$ (called $s _ { \mathrm { i n i t } } , \dot { }$ ) to make sure that the threshold(s) $g$ start close to zero. The $s i g n ( \cdot )$ function converts positive input value to 1 and negative input value to $^ { - 1 }$ , and zero input will keep unchanged.
|
| 112 |
+
|
| 113 |
+
As $ { \boldsymbol { S } } ( { \mathbf { V } } , s )$ is applied to each element of $\mathbf { V }$ , and thus the optimization problem in Equation (5) could be redefined as follows,
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\operatorname* { m i n } \mathcal { L } ( S ( \mathbf { V } , s ) , \Theta , \mathcal { D } ) .
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
Then the trainable pruning parameter $s$ could be jointly optimized with parameters of the recommendation models $\phi$ , through the standard back-propagation. Specifically, the gradient descent update equation for $\mathbf { V }$ at $t$ -th step is formulated as follows,
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\mathbf { V } ^ { ( t + 1 ) } \mathbf { V } ^ { ( t ) } - \eta _ { t } \nabla _ { S ( \mathbf { V } , s ) } \mathcal { L } ( S ( \mathbf { V } ^ { ( t ) } , s ) , \mathcal { D } ) \odot \nabla _ { \mathbf { V } } S ( \mathbf { V } , s ) ,
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
where $\eta _ { t }$ is $t$ -th step learning rate and $\odot$ denotes the Hadamard product. To solve the nondifferentiablilty of $\bar { \mathcal { S } ( \cdot ) }$ , we use sub-gradient to reformat the update equation as follows,
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\mathbf { V } ^ { ( t + 1 ) } \mathbf { V } ^ { ( t ) } - \eta _ { t } \nabla _ { S ( \mathbf { V } , s ) } \mathcal { L } ( S ( \mathbf { V } ^ { ( t ) } , s ) , \mathcal { D } ) \odot \mathbf { 1 } \{ S ( \mathbf { V } ^ { ( t ) } , s ) \neq 0 \} ,
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
where $\mathbf { 1 } \{ \cdot \}$ denotes the indicator function. Then, as long as we choose a continuous function $g$ in $\boldsymbol { \mathcal { S } } ( \cdot )$ , then the loss function $\mathcal { L } \left( { \cal S } ( { \bf V } ^ { ( t ) } , s ) , \mathcal { D } \right)$ would be continuous for $s$ . Moreover, the sub-gradient of $\mathcal { L }$ with respect to $s$ can be used of gradient descent on $s$ as well.
|
| 132 |
+
|
| 133 |
+
Thanks to the automatic differentiation framework like TensorFlow (Abadi et al., 2016) and PyTorch (Paszke et al., 2019), we are free from above complex gradient computation process. Our PEP code can be found in Figure 7 of Appendix A.2. As we can see, it is quite simple to incorporate with existing recommendation models, and there is no need for us to manually design the backpropagation process.
|
| 134 |
+
|
| 135 |
+
# 4.2 RETRAIN WITH LOTTERY TICKET HYPOTHESIS
|
| 136 |
+
|
| 137 |
+
After pruning the embedding matrix $\mathbf { V }$ to the target parameter budget $\mathcal { P }$ , we could create a binary pruning mask $m \in \{ 0 , 1 \} ^ { \tilde { \mathbf { v } } }$ that determines which parameter should remain or drop. Then we retrain the base model with a pruned embedding table. The Lottery Ticket Hypothesis (Frankle & Carbin, 2018) illustrates that a sub-network in a randomly-initialized dense network can match the original network, when trained in isolation in the same number of iterations. This sub-network is called the winning ticket. Hence, instead of randomly re-initializing the weight, we retrain the base model while re-initializing the weights back to their original (but masked now) weights $m \odot \mathbf { V } _ { 0 }$ . This initiation strategy can make the training process faster and stable, keeping the performance consistent, which is shown in Appendix A.6.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 2: AUC-# Parameter curve on MovieLens-1M with three base models.
|
| 141 |
+
|
| 142 |
+
# 4.3 PRUNING WITH FINER GRANULARITY
|
| 143 |
+
|
| 144 |
+
Threshold parameter $s$ in Equation (8) is set to a scalar that values of every dimension will have the same threshold value. We name this version as global wise pruning. However, different dimensions in the embedding vector $\mathbf { v } _ { i }$ may have various importance, and different fields of features may also have highly various importance. Thus, values in the embedding matrix require different sparsity budgets, and pruning with a global threshold may not be optimal. To better handle the heterogeneity among different features/dimensions in $\mathbf { V }$ , we design following different threshold tactic with different granularities. (1) Dimension Wise: The threshold parameter $s$ is set as a vector $\mathbf { s } \in \mathcal { R } ^ { d }$ . Each value in an embedding will be pruned individually. (2) Feature Wise: The threshold parameter $s$ is defined as a vector $\mathbf { s } \in \mathcal { R } ^ { N }$ . Pruning on each features’ embedding could be done in separate ways. (3) Feature-Dimension Wise: this variant combines the above genre of threshold to obtain the finest granularity pruning. Specifically, thresholds are set as a matrix s ∈ RN×d.
|
| 145 |
+
|
| 146 |
+
# 5 EXPERIMENTS
|
| 147 |
+
|
| 148 |
+
Dataset. We use three benchmark datasets: MovieLens-1M, Criteo, and Avazu, in our experiments.
|
| 149 |
+
|
| 150 |
+
Metric. We adopt AUC (Area Under the ROC Curve) and Logloss to measure the performance of models.
|
| 151 |
+
|
| 152 |
+
Baselines and Base Recommendation Models. We compared our PEP with traditional UE (short for Uniform Embedding). We also compare with the recent advances in flexible embedding sizes: MGQE (Kang et al., 2020), MDE (Ginart et al., 2019), and DartsEmb (Zhao et al., 2020b)5. We deploy PEP and all baseline methods to three representative feature-based recommendation models: FM (Rendle, 2010), DeepFM (Guo et al., 2017), and AutoInt (Song et al., 2019), to compare their performance6.
|
| 153 |
+
|
| 154 |
+
# 5.1 RECOMMENDATION ACCURACY AND PARAMETER NUMBER
|
| 155 |
+
|
| 156 |
+
We present the curve of recommendation performance and parameter number in Figure 2, 3 and 4, including our method and state-of-the-art baseline methods. Since there is a trade-off between recommendation performance and parameter number, the curves are made of points that have different sparsity demands7.
|
| 157 |
+
|
| 158 |
+
• Our method reduces the number of parameters significantly. Our PEP achieves the highest reduce-ratio of parameter number in all experiments, especially in relatively large datasets (Criteo and Avazu). Specifically, in Criteo and Avazu datasets, our PEP-0 can reduce $9 9 . 9 0 \%$ parameter usage compared with the best baseline (from the $1 0 ^ { 6 }$ level to the $1 0 ^ { 3 }$ level, which is very significant.). Embedding matrix with such low parameter usage means that only hundreds of embeddings are non-zero. By setting less-important features’ embedding to zero, our PEP can break the limitation in existing methods that minimum embedding size is one rather than zero. We conduct more analysis on the MovieLens dataset in Section 5.3 and 5.4 to help us understand why our method can achieve such an effective parameter decreasing.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 3: AUC-# Parameter curve on Criteo with three base models.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 4: AUC-# Parameter curve on Avazu with three base models.
|
| 165 |
+
|
| 166 |
+
• Our method achieves strong recommendation performance. Our method consistently outperforms the uniform embedding based model and achieves better accuracy than other methods in most cases. Specifically, for the FM model on the Criteo dataset, the relative performance improvement of PEP over UE is $0 . 5 9 \%$ and over DartsEmb is $0 . 2 4 \%$ in terms of AUC. Please note that the improvement of AUC or Logloss at such level is still considerable for feature-based recommendation tasks (Cheng et al., 2016; Guo et al., 2017), especially considering that we have reduced a lot of parameters. A similar improvement can also be observed from the experiments on other datasets and other recommendation models. It is worth noting that our method could keep a strong AUC performance under extreme sparsity-regime. For example, when the number of parameters is only in the $1 0 ^ { 3 }$ level (a really small one), the recommendation performance still remarkably outperforms the Linear Regression model (more details can be found in Appendix A.5).
|
| 167 |
+
|
| 168 |
+
To summarize it, with the effectiveness of recommendation accuracy and parameter-size reduction, the PEP forms a frontier curve encompassing all the baselines at all the levels of parameters. This verifies the superiority that our method can handle different parameter-size budgets well.
|
| 169 |
+
|
| 170 |
+
# 5.2 EFFICIENCY ANALYSIS OF OUR METHOD
|
| 171 |
+
|
| 172 |
+
As is shown in Section 5.1, learning a suitable parameter budget can yield a higher-accuracy model while reducing the model’s parameter number. Nevertheless, it will induce additional time to find apposite sizes for different features. In this section, we study the computational cost and compare the runtime of each training epoch between PEP and DartsEmb on the Criteo dataset. We implement both models with the same batch size and test them on the same platform.
|
| 173 |
+
|
| 174 |
+
The training time of each epoch on three different models is given in Table 2. We can observe that our PEP’s additional computation-cost is only $20 \%$ to $30 \%$ , which is acceptable compared with the base model. DartsEmb, however, requires nearly double computation time to search a good embedding size in its bi-level optimization process. Furthermore, DartsEmb needs to search multiple times to fit different memory budgets, since each one requires a complete re-running. Different from DartsEmb, our PEP can obtain several embedding schemes, which can be applied in different application scenarios, in only a single running. As a result, our PEP’s time cost on embedding size search can be further reduced in real-world systems.
|
| 175 |
+
|
| 176 |
+
Table 2: Runtime of each training epoch on Criteo between base model, DartsEmb, and our PEP.
|
| 177 |
+
|
| 178 |
+
<table><tr><td rowspan=1 colspan=1>Runtime (Second)</td><td rowspan=1 colspan=1>FM</td><td rowspan=1 colspan=1>DeepFM</td><td rowspan=1 colspan=1>AutoInt</td><td rowspan=1 colspan=1>Avg.time increase</td></tr><tr><td rowspan=1 colspan=1>Base Model</td><td rowspan=1 colspan=1>1,039</td><td rowspan=1 colspan=1>1,222</td><td rowspan=1 colspan=1>1,642</td><td rowspan=1 colspan=1>0</td></tr><tr><td rowspan=1 colspan=1>DartsEmb</td><td rowspan=1 colspan=1>2,239</td><td rowspan=1 colspan=1>2,285</td><td rowspan=1 colspan=1>3,154</td><td rowspan=1 colspan=1>98.02%</td></tr><tr><td rowspan=1 colspan=1>PEP</td><td rowspan=1 colspan=1>1,341</td><td rowspan=1 colspan=1>1,525</td><td rowspan=1 colspan=1>1,963</td><td rowspan=1 colspan=1>24.47%</td></tr></table>
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
Figure 5: Interpretable analysis on MovieLens-1M dataset.
|
| 184 |
+
Figure 6: Correlation between Sparsity and Frequency.
|
| 185 |
+
|
| 186 |
+
# 5.3 INTERPRETABLE ANALYSIS ON PRUNED EMBEDDINGS
|
| 187 |
+
|
| 188 |
+
The feature-based recommendation models usually apply the embedding technique to capture two or high order feature interactions. But how does our method work on features interactions? Does our method improve model performance by reducing noisy feature interactions? In this section, we conduct an interpretable analysis by visualizing the feature interaction matrix, calculated by $\mathbf { V V } ^ { \top }$ . Each value in the matrix is the normalized average of the absolute value of those two field features’ dot product result, of which the higher indicates those two fields have a stronger correlation.
|
| 189 |
+
|
| 190 |
+
Figure 5 (a) and 5 (b) illustrate the interaction matrix without and with pruning respectively, and 5 (c) shows the variation of matrix values. We can see that our PEP can reduce the parameter number between unimportant field interaction while keeping the significance of those meaningful field features’ interactions. By denoising those less important feature interactions, the PEP can reduce embedding parameters while maintaining or improving accuracy.
|
| 191 |
+
|
| 192 |
+
# 5.4 CORRELATION BETWEEN SPARSITY AND FREQUENCY
|
| 193 |
+
|
| 194 |
+
As is shown in Figure 6 (a), feature frequencies among different features are highly diversified. Thus, using embeddings with uniform size may not handle their heterogeneity, and this property play an important role in embedding size selection. Hence, some recent works (Zhao et al., 2020b; Ginart et al., 2019; Cheng et al., 2020; Kang et al., 2020; Zhang et al., 2020; Joglekar et al., 2020) explicitly utilize the feature frequencies. Different from them, our PEP shrinks the parameter in an end-to-end automatic way, thus circumvents the complex human manipulation. Nevertheless, the frequency of features is one of the factors that determines whether one feature is important or not. Thus, we study whether our method can detect the influence of frequencies and whether the learned embedding sizes are relevant to the frequency.
|
| 195 |
+
|
| 196 |
+
We first analyze the sparsity8 trajectory during training, which is shown in Figure 6 (b), where different colors indicate different groups of features divided according to their popularity. For each group, we first calculate each feature’s sparsity, then compute the average on all features. Shades in pictures represent the variance within a group. We can observe that PEP tends to assign high-frequency features larger sizes to make sure there is enough representation capacity. For low-frequency features, the trends are on the contrary. These results are accord to the postulation that high-frequency features deserve more embedding parameters while a few parameters are enough for low-frequency feature embeddings.
|
| 197 |
+
|
| 198 |
+
Then we probe the relationship between the sparsity of pruned embedding and frequencies of each feature. From Figure 6 (c), we can observe that the general relationship is concord with the above analysis. However, as we can see, some low-frequency features are assigned rich parameters, and some features with larger popularity are assigned small embedding size. This illustrates that simply allocating more parameters to high-frequency features, as most previous works do, can not handle the complex connection between features and their popularities. Our method performs pruning based on data, which can reflect the feature intrinsic proprieties, and thus can cut down parameters in a more elegant and efficient way.
|
| 199 |
+
|
| 200 |
+
# 6 CONCLUSION
|
| 201 |
+
|
| 202 |
+
In this paper, we approach the common problem of fixed-size embedding table in today’s featurebased recommender systems. We propose a general plug-in framework to learn the suitable embedding sizes for different features adaptively. The proposed PEP method is efficient can be easily applied to various recommendation models. Experiments on three state-of-the-art recommendation models and three benchmark datasets verify that PEP can achieve strong recommendation performance while significantly reducing the parameter number and can be trained efficiently.
|
| 203 |
+
|
| 204 |
+
# 7 ACKNOWLEDGEMENTS
|
| 205 |
+
|
| 206 |
+
This work was supported in part by The National Key Research and Development Program of China under grant 2020AAA0106000, the National Natural Science Foundation of China under U1936217, 61971267, 61972223, 61941117, 61861136003.
|
| 207 |
+
|
| 208 |
+
# REFERENCES
|
| 209 |
+
|
| 210 |
+
Mart´ın Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, and Xiaoqiang Zhang. Tensorflow: A system for large-scale machine learning. 2016.
|
| 211 |
+
|
| 212 |
+
Amir Beck and Marc Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. Siam Journal on Imaging Sciences, 2(1):183–202, 2009.
|
| 213 |
+
|
| 214 |
+
Heng Tze Cheng, Levent Koc, Jeremiah Harmsen, Tal Shaked, Tushar Chandra, Hrishi Aradhye, Glen Anderson, Greg Corrado, Wei Chai, and Mustafa Ispir. Wide & deep learning for recommender systems. 2016.
|
| 215 |
+
|
| 216 |
+
Weiyu Cheng, Yanyan Shen, and Linpeng Huang. Differentiable neural input search for recommender systems. arXiv preprint arXiv:2006.04466, 2020.
|
| 217 |
+
|
| 218 |
+
Paul Covington, Jay Adams, and Emre Sargin. Deep neural networks for youtube recommendations. In Proceedings of the 10th ACM conference on recommender systems, pp. 191–198, 2016.
|
| 219 |
+
|
| 220 |
+
Thomas Elsken, Jan Hendrik Metzen, Frank Hutter, et al. Neural architecture search: A survey. J. Mach. Learn. Res., 20(55):1–21, 2019.
|
| 221 |
+
|
| 222 |
+
Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In International Conference on Learning Representations, 2018.
|
| 223 |
+
|
| 224 |
+
Antonio Ginart, Maxim Naumov, Dheevatsa Mudigere, Jiyan Yang, and James Zou. Mixed dimension embeddings with application to memory-efficient recommendation systems. arXiv preprint arXiv:1909.11810, 2019.
|
| 225 |
+
|
| 226 |
+
Huifeng Guo, Ruiming Tang, Yunming Ye, Zhenguo Li, and Xiuqiang He. Deepfm: a factorizationmachine based neural network for ctr prediction. In Proceedings of the 26th International Joint Conference on Artificial Intelligence, pp. 1725–1731, 2017.
|
| 227 |
+
|
| 228 |
+
Frank Hutter, Lars Kotthoff, and Joaquin Vanschoren. Automated machine learning: methods, systems, challenges. Springer Nature, 2019.
|
| 229 |
+
|
| 230 |
+
Prateek Jain, Ambuj Tewari, and Purushottam Kar. On iterative hard thresholding methods for highdimensional m-estimation. 2014.
|
| 231 |
+
|
| 232 |
+
Manas R Joglekar, Cong Li, Mei Chen, Taibai Xu, Xiaoming Wang, Jay K Adams, Pranav Khaitan, Jiahui Liu, and Quoc V Le. Neural input search for large scale recommendation models. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 2387–2397, 2020.
|
| 233 |
+
|
| 234 |
+
Wang-Cheng Kang, Derek Zhiyuan Cheng, Ting Chen, Xinyang Yi, Dong Lin, Lichan Hong, and Ed H Chi. Learning multi-granular quantized embeddings for large-vocab categorical features in recommender systems. In Companion Proceedings of the Web Conference 2020, pp. 562–566, 2020.
|
| 235 |
+
|
| 236 |
+
Aditya Kusupati, Vivek Ramanujan, Raghav Somani, Mitchell Wortsman, Prateek Jain, Sham Kakade, and Ali Farhadi. Soft threshold weight reparameterization for learnable sparsity. In Proceedings of the 37th International Conference on Machine Learning, 2020.
|
| 237 |
+
|
| 238 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. In International Conference on Learning Representations, 2018.
|
| 239 |
+
|
| 240 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, highperformance deep learning library. In Advances in neural information processing systems, pp. 8026–8037, 2019.
|
| 241 |
+
|
| 242 |
+
Steffen Rendle. Factorization machines. In 2010 IEEE International Conference on Data Mining, pp. 995–1000. IEEE, 2010.
|
| 243 |
+
|
| 244 |
+
Hao-Jun Michael Shi, Dheevatsa Mudigere, Maxim Naumov, and Jiyan Yang. Compositional embeddings using complementary partitions for memory-efficient recommendation systems. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 165–175, 2020.
|
| 245 |
+
|
| 246 |
+
Weiping Song, Chence Shi, Zhiping Xiao, Zhijian Duan, Yewen Xu, Ming Zhang, and Jian Tang. Autoint: Automatic feature interaction learning via self-attentive neural networks. In Proceedings of the 28th ACM International Conference on Information and Knowledge Management, pp. 1161–1170, 2019.
|
| 247 |
+
|
| 248 |
+
Omid Taheri and Sergiy A. Vorobyov. Sparse channel estimation with lp-norm and reweighted l1-norm penalized least mean squares. In IEEE International Conference on Acoustics, 2011.
|
| 249 |
+
|
| 250 |
+
Pauli Virtanen, Ralf Gommers, Travis E Oliphant, Matt Haberland, and Paul Van Mulbregt. Author correction: Scipy 1.0: fundamental algorithms for scientific computing in python. Nature Methods, 17(Suppl. 1):1–12, 2020.
|
| 251 |
+
|
| 252 |
+
Caojin Zhang, Yicun Liu, Yuanpu Xie, Sofia Ira Ktena, Alykhan Tejani, Akshay Gupta, Pranay Kumar Myana, Deepak Dilipkumar, Suvadip Paul, Ikuhiro Ihara, et al. Model size reduction using frequency based double hashing for recommender systems. In Fourteenth ACM Conference on Recommender Systems, pp. 521–526, 2020.
|
| 253 |
+
|
| 254 |
+
Shuai Zhang, Lina Yao, Aixin Sun, and Yi Tay. Deep learning based recommender system: A survey and new perspectives. ACM Computing Surveys (CSUR), 52(1):1–38, 2019.
|
| 255 |
+
|
| 256 |
+
Xiangyu Zhao, Haochen Liu, Hui Liu, Jiliang Tang, Weiwei Guo, Jun Shi, Sida Wang, Huiji Gao, and Bo Long. Memory-efficient embedding for recommendations. arXiv preprint arXiv:2006.14827, 2020a.
|
| 257 |
+
|
| 258 |
+
Xiangyu Zhao, Chong Wang, Ming Chen, Xudong Zheng, Xiaobing Liu, and Jiliang Tang. Autoemb: Automated embedding dimensionality search in streaming recommendations. arXiv preprint arXiv:2002.11252, 2020b.
|
| 259 |
+
|
| 260 |
+
# A APPENDIX
|
| 261 |
+
|
| 262 |
+
A.1 DESCRIPTION OF $g ( s )$
|
| 263 |
+
|
| 264 |
+
Following Kusupati et al. (2020), a proper threshold function $g ( s )$ should have following three properties:
|
| 265 |
+
|
| 266 |
+
1. $g ( s ) > 0 , \operatorname* { l i m } _ { s \to - \infty } g ( s ) = 0 , \operatorname { a n d } _ { s \to \infty } g ( s ) = \infty .$
|
| 267 |
+
2. $\exists G \in \mathbb { R } _ { + + } \ni 0 < g ^ { \prime } ( s ) \leq G \forall s \in \mathbb { R } .$
|
| 268 |
+
3. $g ^ { \prime } \left( s _ { \mathrm { i n i t } } \right) < 1$ which reduce the updating speed of $s$ at the initial pruning.
|
| 269 |
+
|
| 270 |
+
# A.2 PYTORCH CODE OF PEP
|
| 271 |
+
|
| 272 |
+
We present the main codes of PEP here since it is really easy-to-use and can plug in various embedding-based recommendation models.
|
| 273 |
+
|
| 274 |
+
import torch import torch.nn as nn import torch.nn.functional as F
|
| 275 |
+
|
| 276 |
+

|
| 277 |
+
Figure 7: PyTorch code of PEP.
|
| 278 |
+
|
| 279 |
+
# A.3 WHOLE PROCESS OF PEP
|
| 280 |
+
|
| 281 |
+
We summarizes the pruning and retrain process by Algorithm 1.
|
| 282 |
+
|
| 283 |
+
Input: Initial embedding $\mathbf { V } ^ { ( 0 ) }$ , base model $\phi$ , and target parameter $\mathcal { P }$
|
| 284 |
+
|
| 285 |
+
Output: Well trained sparsity embedding $\mathbf { V }$
|
| 286 |
+
|
| 287 |
+
1: while do not reach $\mathcal { P }$ do
|
| 288 |
+
2: Pruning $\mathbf { V }$ through Equation 9.
|
| 289 |
+
3: end while
|
| 290 |
+
4: Obtain binary pruning mask $m = \mathbf { 1 } \{ \mathbf { V } ^ { ( t ) } \}$ .
|
| 291 |
+
5: Reset the remaining embedding parameter to initial values.
|
| 292 |
+
6: while do not coverage do
|
| 293 |
+
7: Minimize the training loss $\mathcal { L } ( \mathbf { V } ^ { ( 0 ) } \odot m , \mathcal { D } )$ with SGD.
|
| 294 |
+
8: end while
|
| 295 |
+
|
| 296 |
+
Table 3: Statistics of three utilized benchmark datasets.
|
| 297 |
+
|
| 298 |
+
<table><tr><td>Dataset</td><td>#Samples</td><td>#Fields</td><td>#Features</td></tr><tr><td>MovieLens-1M</td><td>739,015</td><td>7</td><td>3,864</td></tr><tr><td>Criteo</td><td>45,840,617</td><td>39</td><td>1,086,810</td></tr><tr><td>Avazu</td><td>40,400,000</td><td>22</td><td>645,394</td></tr></table>
|
| 299 |
+
|
| 300 |
+
# A.4 EXPERIMENTAL SETUP
|
| 301 |
+
|
| 302 |
+
# A.4.1 DATASETS
|
| 303 |
+
|
| 304 |
+
We experiment with three public benchmark datasets: MovieLens-1M, Criteo, and Avazu. Table 3 summarizes the statistics of datasets.
|
| 305 |
+
|
| 306 |
+
• MovieLens- $\mathbf { \nabla } ^ { 1 \mathbf { M } ^ { 9 } }$ . It is a widely-used benchmark dataset and contains timestamped user-movie ratings ranging from 1 to 5. Following AutoInt (Song et al., 2019), we treat samples with a rating $1 , 2$ as negative samples and samples with a rating 4, 5 as positive samples. Other samples will be treat as neutral samples and removed.
|
| 307 |
+
|
| 308 |
+
• Criteo10. This is a benchmark dataset for feature-based recommendation task, which contains 26 categorical feature fields and 13 numerical feature fields. It has about 45 million users’ clicking records on displayed ads.
|
| 309 |
+
|
| 310 |
+
• Avazu11. Avazu dataset contains 11 days’ user clicking behaviors which are released for the Kaggle challenge, There are 22 categorical feature fields in the dataset, and parts of the fields are anonymous.
|
| 311 |
+
|
| 312 |
+
Preprocessing Following the general preprocessing steps (Guo et al., 2017; Song et al., 2019), for numerical feature fields in Criteo, we employ the log transformation of $l o g ^ { 2 } ( x )$ if $x > 2$ proposed by the winner of Criteo Competition12 to normalize the numerical features. Besides, we consider features of which the frequency is less than ten as unknown and treat them as a single feature “unknown” for Criteo and Avazu datasets. For each dataset, all the samples are randomly divided into training, validation, and testing set based on the proportion of $8 0 \%$ , $\bar { 1 } 0 \%$ , and $1 0 \%$ .
|
| 313 |
+
|
| 314 |
+
# A.4.2 PERFORMANCE MEASURES
|
| 315 |
+
|
| 316 |
+
We evaluate the performance of PEP with the following two metrics:
|
| 317 |
+
|
| 318 |
+
• AUC. The area under the Receiver Operating Characteristic or ROC curve (AUC) means the probability to rank a randomly chosen positive sample higher than a randomly chosen negative sample. A model with higher AUC indicates the better performance of the model.
|
| 319 |
+
|
| 320 |
+
• Logloss. As a loss function widely used in the feature-based recommendation, Logloss on test data can straight way evaluate the model’s performance. The lower the model’s Logloss, the better the model’s performance.
|
| 321 |
+
|
| 322 |
+
# A.4.3 BASELINES
|
| 323 |
+
|
| 324 |
+
We compared our proposed method with the following state-of-the-art methods:
|
| 325 |
+
|
| 326 |
+
• UE (short for Uniform Embedding). The uniform-embedding manner is commonly accepted in existing recommender systems, of which all features have uniform embedding sizes.
|
| 327 |
+
|
| 328 |
+
• MGQE (Kang et al., 2020). This method retrieves embedding fragments from a small size of shared centroid embeddings, and then generates final embedding by concatenating those fragments. MGQE learns embeddings with different capacities for different items. This method is the most strongest baseline among embedding-parameter-sharing methods.
|
| 329 |
+
|
| 330 |
+
• MDE (short for Mixed Dimension Embedding (Ginart et al., 2019)). This method is based on human-crafted rule, and the embedding size of a specific feature is proportional to its popularity. Higher-frequency features will be assigned larger embedding sizes. This is the state-of-the-art human-rule-based method.
|
| 331 |
+
|
| 332 |
+
• DartsEmb (Zhao et al., 2020b). This is the state-of-the-art neural architecture search-based based method which allows features to automatically search for the embedding sizes in a given space.
|
| 333 |
+
|
| 334 |
+
# A.4.4 IMPLEMENTATION DETAILS
|
| 335 |
+
|
| 336 |
+
Following AutoInt (Song et al., 2019) and DeepFM (Guo et al., 2017), we employ Adam optimizer with the learning rate of 0.001 to optimize model parameters in both the pruning and re-training stage. For $g ( s )$ , we apply $\begin{array} { r } { g ( s ) = \frac { \bar { 1 } } { 1 + e ^ { - s } } } \end{array}$ in all experiments and initialize the $s$ to $- 1 5$ , $- 1 5 0$ and $- 1 5 0$ in MovieLens-1M, Criteo and Avazu datasets respectively. Moreover, the granularity of PEP is set as Dimension-wise for PEP-2, PEP-3, and PEP-4 on Criteo and Avazu datasets. And others are set as Feature Dimension-wise. The base embedding dimension $d$ is set to 64 for all the models before pruning. We deploy our method and other baseline methods to three state-of-the-art models: FM (Rendle, 2010), DeepFM (Guo et al., 2017), and AutoInt (Song et al., 2019), to compare their performance. Besides, in the retrain stage, we exploit the early-stopping technique according to the loss of validation dataset during training. We use PyTorch (Paszke et al., 2019) to implement our method and train it with mini-batch size 1024 on a single 12G-Memory NVIDIA TITAN V GPU.
|
| 337 |
+
|
| 338 |
+
Implementation of Baseline For Uniform Embedding, we test the embedding size varying from [8, 16, 32, 64], for the MovieLens-1M dataset. For Criteo and Avazu dataset, we vary the embedding size from [4, 8, 16] because performance starts to drop when $d > 1 6$ .
|
| 339 |
+
|
| 340 |
+
For other baseline methods, we first turn the hyper-parameters to make models have the highest recommendation performance or highest parameter reduction rate. Then we tune those methods that can balance those two aspects. We provide the experimental details of our implementation for these baseline methods as below, following the settings of the original papers. For the grid search space of MDE, we search the baseline dimension $d$ from [4, 8, 16, 32], the number of blocks $K$ from [8, 16], and $\alpha$ from [0.1, 0.2, 0.3]. For MGQE, we search the baseline dimension $d$ from [8, 16, 32], the number of subspace $D$ from [4, 8, 16], and the number of centroids $K$ from [64, 128, 256, 512]. For DartsEmb, we choose three different candidate embedding spaces to meet the different memory budgets: $\{ 1 , 2 , 8 \} , \{ 2 , 4 , 1 6 \}$ and $\{ 4 , 8 , 3 2 \}$ .
|
| 341 |
+
|
| 342 |
+
# A.5 COMPARISON BETWEEN PEP-0 AND LINEAR REGRESSION
|
| 343 |
+
|
| 344 |
+
The Linear Regression (LR) model is an embedding-free model that only makes predictions based on the linear combination of raw features. Thence, it is worth comparing our method on the extremelysparse level (PEP-0) with LR.
|
| 345 |
+
|
| 346 |
+
Table 4 shows that our PEP-0 significantly outperforms the LR in all cases. This result verity that our PEP-0 does not depend on the LR part in FM and DeepFM to remain a strong recommendation performance. Therefore, even at an extremely-sparse level, our PEP still has high application value in the real-world scenarios.
|
| 347 |
+
|
| 348 |
+
Table 4: Performance comparison between PEP-0 and Linear Regression.
|
| 349 |
+
|
| 350 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="2">MovieLens-1M</td><td colspan="2">Criteo</td><td colspan="2">Avazu</td></tr><tr><td>AUC</td><td># Param</td><td>AUC</td><td># Param</td><td>AUC</td><td>#Param</td></tr><tr><td>LR</td><td>0.7717</td><td>0</td><td>0.7881</td><td>0</td><td>0.7499</td><td>0</td></tr><tr><td>PEP-0 (FM)</td><td>0.8368</td><td>6,541</td><td>0.7941</td><td>1,067</td><td>0.7598</td><td>1,479</td></tr><tr><td>PEP-0 (DeepFM)</td><td>0.8491</td><td>8.604</td><td>0.7986</td><td>1,227</td><td>0.7622</td><td>2,215</td></tr><tr><td>PEP-0 (AutoInt)</td><td>0.8530</td><td>9,281</td><td>0.7922</td><td>3,116</td><td>0.7607</td><td>2.805</td></tr><tr><td>PEP-0 (AutoInt+LR)</td><td>-</td><td>-</td><td>0.7980</td><td>1,117</td><td>0.7620</td><td>2,225</td></tr></table>
|
| 351 |
+
|
| 352 |
+
It is worth noting that the AutoInt model does not contain the LR component, so the PEP-0 in AutoInt on Criteo and Avazu dataset lead to a large performance drop. We try to include LR in PEP-0 in AutoInt and test the performance13. As we can see, the accuracy on Criteo and Avazu outperforms the AutoInt without LR; It can be explained that LR helps our PEP-0 acquire a more stable performance.
|
| 353 |
+
|
| 354 |
+
# A.6 THE LOTTERY TICKET HYPOTHESIS
|
| 355 |
+
|
| 356 |
+
In the retraining stage in Section 4.2, we rely on the Lottery Ticket Hypothesis to reinitialize the pruned embeddings table (called winning ticket) into their original initial values. Here we conduct experiments to verify the effectiveness of this operation in our PEP. We compare our method with its variation that uses random re-initialization for retraining to examine the influence of initialization. We also compare the standard PEP with the original base recommendation model to verify the influence of embedding pruning. To evaluate the importance of retraining, we further test the performance of PEP with the pruning stage only. We choose FM as the base recommendation model and use the same settings as the above experiments.
|
| 357 |
+
|
| 358 |
+
We present the results in Figure 8 and 9. We can observe that the winning ticket with original initialization parameters can make the training procedure faster and obtain higher recommendation accuracy compared with random re-initialization. This demonstrates the effectiveness of our design of retraining. Moreover, the randomly reinitialize winning ticket still outperforms the unpruned model. By reducing the less-important features’ embedding parameters, model performance could benefit from denoising those over-parametered embeddings. This can be explained that it is likely to get over-fitted for those over-parameterized embeddings when embedding sizes are uniform.
|
| 359 |
+
|
| 360 |
+
Moreover, it is clear that the performance of PEP without retraining gets a little bit downgrade, but it still outperforms the original models. And the margin between without retrain and the original model is larger than the margin between with and without retraining. These results demonstrate that the PEP chiefly benefits from the suitable embedding size selection. We conjecture the benefit of retraining: during the search stage, less-important elements in embedding matrices are pruned gradually until the training procedure reaches a convergence. However, in earlier training epochs when these elements have not been pruned, they may have negative effects on the gradient updates for those important elements. This may make the learning of those important elements suboptimal. Thus, a retraining step can eliminate such effects and improve performance.
|
| 361 |
+
|
| 362 |
+
# A.7 PRUNING WITH FINER GRANULARITY
|
| 363 |
+
|
| 364 |
+
In this section, we analyze the four different thresholds with different granularity mentioned in Section 4.3. The experiments are conducted on the MovieLens-1M dataset with base model FM. Figure 10 (a) and (b) demonstrates the varying of embedding parameters and test AUC evolving with training epoch. As we can see, the Feature-Dimension granularity can reduce much more embedding parameters than others. Meanwhile, it achieves the highest performance at the retrain stage compared with other granularities. With the minimum granularity, the Feature-Dimension wise pruning can effectively determine the importance of embedding values. Besides, the Dimension-wise pruning can achieve comparable AUC with fewer training epochs. Hence we adopt this granularity on PEP-2, PEP-3, and PEP-4 in large datasets to save time spent on training.
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 8: Logloss and AUC as training proceeds on Criteo dataset (choosing FM as the base model).
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 9: Logloss and AUC as training proceeds on Avazu dataset (choosing FM as the base model).
|
| 371 |
+
|
| 372 |
+
# A.8 ABOUT LEARNABLE $g ( s )$
|
| 373 |
+
|
| 374 |
+
Pruning threshold(s) $g ( s )$ can be learned from training data to reduce parameter usage in the embedding matrix. However, why can our PEP learn suitable $g ( s )$ with training data? We deduce that the increase of $s$ in $g ( s )$ can decrease the training loss. In other words, our PEP tries to update $s$ in the optimization process to achieve lower training loss.
|
| 375 |
+
|
| 376 |
+
In Figure 11, we plot the FM’s training curves with/without PEP on MovieLens-1M and Criteo datasets to confirm our assumption. Our PEP can achieve much lower training loss when pruning. Besides, it verifies that our PEP could learn embedding sizes in a stable form.
|
| 377 |
+
|
| 378 |
+
The stability shown in Figure 11 can be explained that our PEP obtains a relatively stable embedding parameter number at later stage of pruning (e.g., when epoch is larger than 30 in MovieLens dataset) as shown in Figure 11. And embedding parameters are well-trained. Thus, the training loss curve looks relatively stable. Note that the figure shows a sequence of changing thresholds. The point when we get the embedding table for some sparsity level is not a converged point for this exact level, which instead requires retraining with a fixed threshold.
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
(a) Numbers of embedding parameters evolving (b) Test AUC evolving with training epoch inwith training epoch increase crease at retrain stage
|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
Figure 10: Influence of different granularity on MovieLens-1M dataset (Choose FM as base model)
|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
Figure 11: Training loss of FM with/without PEP
|
md/train/wS0UFjsNYjn/wS0UFjsNYjn.md
ADDED
|
@@ -0,0 +1,336 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# META-GMVAE: MIXTURE OF GAUSSIAN VAES FOR UNSUPERVISED META-LEARNING
|
| 2 |
+
|
| 3 |
+
Dong Bok Lee1, Dongchan ${ { \bf { M } } { \bf { i n } } ^ { 1 } }$ , Seanie Lee1, and Sung Ju Hwang1,2 KAIST1, AITRICS2, South Korea {markhi,alsehdcks95,lsnfamily02,sjhwang82}@kaist.ac.kr
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Unsupervised learning aims to learn meaningful representations from unlabeled data which can capture its intrinsic structure, that can be transferred to downstream tasks. Meta-learning, whose objective is to learn to generalize across tasks such that the learned model can rapidly adapt to a novel task, shares the spirit of unsupervised learning in that the both seek to learn more effective and efficient learning procedure than learning from scratch. The fundamental difference of the two is that the most meta-learning approaches are supervised, assuming full access to the labels. However, acquiring labeled dataset for meta-training not only is costly as it requires human efforts in labeling but also limits its applications to pre-defined task distributions. In this paper, we propose a principled unsupervised meta-learning model, namely Meta-GMVAE, based on Variational Autoencoder (VAE) and set-level variational inference. Moreover, we introduce a mixture of Gaussian (GMM) prior, assuming that each modality represents each class-concept in a randomly sampled episode, which we optimize with Expectation-Maximization (EM). Then, the learned model can be used for downstream few-shot classification tasks, where we obtain task-specific parameters by performing semi-supervised EM on the latent representations of the support and query set, and predict labels of the query set by computing aggregated posteriors. We validate our model on Omniglot and Mini-ImageNet datasets by evaluating its performance on downstream few-shot classification tasks. The results show that our model obtains impressive performance gains over existing unsupervised metalearning baselines, even outperforming supervised MAML on a certain setting.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Unsupervised learning is one of the most fundamental and challenging problems in machine learning, due to the absence of target labels to guide the learning process. Thanks to the enormous research efforts, there now exist many unsupervised learning methods that have shown promising results on real-world domains, including image recognition (Le, 2013) and natural language understanding (Ramachandran et al., 2017). The essential goal of unsupervised learning is obtaining meaningful feature representations that best characterize the data, which can be later utilized to improve the performance of the downstream tasks, by training a supervised task-specific model on the top of the learned representations (Reed et al., 2014; Cheung et al., 2015; Chen et al., 2016) or fine-tuning the entire pre-trained models (Erhan et al., 2010).
|
| 12 |
+
|
| 13 |
+
Meta-learning, whose objective is to learn general knowledge across diverse tasks, such that the learned model can rapidly adapt to novel tasks, shares the spirit of unsupervised learning in that both seek more efficient and effective learning procedure over learning from scratch. However, the essential difference between the two is that most meta-learning approaches have been built on the supervised learning scheme, and require human-crafted task distributions to be applied in fewshot classification. Acquiring labeled dataset for meta-training may require a massive amount of human efforts, and more importantly, meta-learning limits its applications to the pre-defined task distributions (e.g. classification of specific set of classes).
|
| 14 |
+
|
| 15 |
+
Two recent works have proposed unsupervised meta-learning that can bridge the gap between unsupervised learning and meta-learning by focusing on constructing supervised tasks with pseudo-labels from the unlabeled data. To do so, CACTUs (Hsu et al., 2019) clusters data in the embedding space learned with several unsupervised learning methods, while UMTRA (Khodadadeh et al., 2019) assumed that each randomly drawn sample represents a different class and augmented each pseudoclass with data augmentation (Cubuk et al., 2018). After constructing the meta-training dataset with such heuristics, they simply apply supervised meta-learning algorithms as usual. Despite the success of the existing unsupervised meta-learning methods, they are fundamentally limited, since 1) they only consider unsupervised learning for heuristic pseudo-labeling of unlabeled data, and 2) the two-stage approach makes it impossible to recover from incorrect pseudo-class assignment when learning the unsupervised representation space.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: During meta-training, Meta-GMVAE learns multi-modal latent space that can best explain the unlabeled data using EM algorithm. At meta-test time, we use semi-supervised EM to map both the support (labeled data) and queries (unlabeled data) to each mode learned during meta-training.
|
| 19 |
+
|
| 20 |
+
In this paper, we propose a principled unsupervised meta-learning model based on Variational Autoencoder (VAE) (Kingma & Welling, 2014) and set-level variational inference using self-attention (Vaswani et al., 2017). Moreover, we introduce multi-modal prior distributions, a mixture of Gaussians (GMM), assuming that each modality represents each class-concept in any given tasks. Then the parameter of GMM is optimized by running Expectation-Maximization (EM) on the observations sampled from the set-dependent variational posterior. In this framework, however, there is no guarantee that each modality obtained from EM algorithm corresponds to a label. To realize modality as label, we deploy semi-supervised EM at meta-test time, considering the support set and query set as labeled and unlabeled observations, respectively. We refer to our method as Meta-Gaussian Mixture Variational Autoencoders (Meta-GMVAE) (See Figure 1 for high-level concept). While our method can be used as a full generative model for generating the samples (images), the ability to generalize to generate samples may not be necessary for capturing the meta-knowledge for non-generative downstream tasks. Thus, we propose another version of Meta-GMVAE that reconstructs high-level features learned by unsupervised representation learning approaches (e.g. Chen et al. (2020)).
|
| 21 |
+
|
| 22 |
+
To investigate the effectiveness of our framework, we run experiments on two benchmark fewshot image classification datasets, namely Omiglot (Lake et al., 2011) and Mini-Imagenet (Ravi & Larochelle, 2017). The experimental results show that our Meta-GMVAE obtains impressive performance gains over the relevant unsupervised meta-learning baselines on both datasets, obtaining even better accuracy than fully supervised MAML (Finn et al., 2017) while utilizing as small as $0 . 1 \%$ of the labeled data on one-shot settings in Omniglot dataset. Moreover, our model can generalize to classification tasks with different number of ways (classes) without loss of accuracy. Our contribution is threefold:
|
| 23 |
+
|
| 24 |
+
• We propose a novel unsupervised meta-learning model, namely Meta-GMVAE, which metalearns the set-conditioned prior and posterior network for a VAE. Our Meta-GMVAE is a principled unsupervised meta-learning method, unlike existing methods on unsupervised meta-learning that combines heuristic pseudo-labeling with supervised meta-learning.
|
| 25 |
+
• We propose to learn the multi-modal structure of a given dataset with the Gaussian mixture prior, such that it can adapt to a novel dataset via the EM algorithm. This flexible adaptation to a new task, is not possible with existing methods that propose VAEs with Gaussian mixture priors for single task learning.
|
| 26 |
+
We show that Meta-GMVAE largely outperforms relevant unsupervised meta-learning baselines on two benchmark datasets, while obtaining even better performance than a supervised metalearning model under a specific setting. We further show that Meta-GMVAE can generalize to classification tasks with different number of ways (classes).
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
Unsupervised learning Many prior unsupervised learning methods have developed proxy objectives which is either based on reconstruction (Vincent et al., 2010; Higgins et al., 2017), adversarially obtained image fidelity (Radford et al., 2016; Salimans et al., 2016; Donahue et al., 2017; Dumoulin et al., 2017), disentanglement (Bengio et al., 2013; Reed et al., 2014; Cheung et al., 2015; Chen et al., 2016; Mathieu et al., 2016; Denton & Birodkar, 2017; Kim & Mnih, 2018; Ding et al., 2020), clustering (Coates & Ng, 2012; Krahenb ¨ uhl et al., 2016; Bojanowski & Joulin, 2017; Caron ¨ et al., 2018), or contrastive learning (Chen et al., 2020). In the unsupervised learning literature, the most relevant work to ours are methods that use Gaussian Mixture priors for variational autoencoders. Dilokthanakul et al. (2016); Jiang et al. (2017) consider single task learning and therefore, the learned prior parameter is fixed after training, and thus cannot adapt to new tasks. CURL (Rao et al., 2019) learns a network that outputs Gaussian mixture priors over a sequence of tasks for unsupervised continual learning. However CURL cannot adapt to a new task without training on it, while our framework can generalize to a new task without any training, via amortized inference with a dataset (task) encoder. Also, our model does not learn Gaussian mixture priors but rather obtain them on the fly using the expectation-maximization algorithm.
|
| 31 |
+
|
| 32 |
+
Meta-learning Meta-learning (Thrun & Pratt, 1998) shares the intuition of unsupervised learning in that it aims to improve the model performance on an unseen task by leveraging prior knowledge, rather than learning from scratch. While the literature on meta-learning is vast, we only discuss relevant existing works for few-shot image classification. Metric-based meta-learning (Koch et al., 2015; Vinyals et al., 2016; Snell et al., 2017; Oreshkin et al., 2018; Mishra et al., 2018) is one of the most popular approaches, where it learns to embed the data instances of the same class to be closer in the shared embedding space. One can measure the distance in the embedding space by cosine similarity (Vinyals et al., 2016), or Euclidean distance (Snell et al., 2017). On the other hand, gradient-based meta-learning (Finn et al., 2017; 2018; Li et al., 2017; Lee & Choi, 2018; Ravi & Beatson, 2019; Flennerhag et al., 2020) aims at learning a global initialization of parameters, which can rapidly adapt to a novel task with only a few gradient steps. Moreover, some previous works (Hewitt et al., 2018; Edwards & Storkey, 2017; Garnelo et al., 2018) tackle meta-learning by modeling the set-dependent variational posterior with a single global latent variable, however, we model the variational posterior conditioned on each data instances. Moreover, while all of these works assume supervised learning scenarios where one has access to full labels in meta-training stage, we focus on unsupervised setting in this paper.
|
| 33 |
+
|
| 34 |
+
Unsupervised meta-learning One of the main limitations of conventional meta-learning methods is that their application is strictly limited to the tasks from a pre-defined task distribution. A few works (Hsu et al., 2019; Khodadadeh et al., 2019) have been proposed to resolve this issue by combining unsupervised learning with meta-learning. The main idea is to construct meta-training dataset in an unsupervised manner by leveraging existing supervised meta-learning models. CACTUs (Hsu et al., 2019) deploy several deep metric learning (Berthelot et al., 2019; Donahue et al., 2017; Caron et al., 2018; Chen et al., 2016) to episodically cluster the unlabeled dataset, and then train MAML (Finn et al., 2017) and Prototypical Networks (Snell et al., 2017) on the constructed data. UMTRA (Khodadadeh et al., 2019) assumes that each randomly drawn sample is from a different class from others, and use data augmentation (Cubuk et al., 2018) to construct synthetic task distribution for meta-training. Instead of only deploying unsupervised learning for constructing meta-training task distributions, we propose an unsupervised meta-learning model that meta-learns set-level variational posterior by matching the multi-modal prior distribution representing latent classes.
|
| 35 |
+
|
| 36 |
+
# 3 UNSUPERVISED META-LEARNING WITH META-GMVAES
|
| 37 |
+
|
| 38 |
+
In this section, we describe our problem setting with respect to unsupervised meta-learning, and demonstrate our approach. The graphical illustration of our model for unsupervised meta-training and supervised meta-test is depicted in Figure 2.
|
| 39 |
+
|
| 40 |
+
# 3.1 PROBLEM STATEMENT
|
| 41 |
+
|
| 42 |
+
Our goal is to learn unsupervised feature representations which can be transferred to wide range of downstream few-shot classification tasks. As suggested by Hsu et al. (2019); Khodadadeh et al.
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 2: The graphical illustration of Meta-GMVAE. The dotted lines denote either variational inference or Expectation Maximization. (a): We introduce the multimodal distribution $p _ { \psi } ( \mathbf { z } )$ into prior distribution, and its optimal task-specific parameter $\psi _ { i } ^ { * }$ is obtained by EM in an episodic manner. (b): For meta-test, we obtain task-specific parameter $\psi _ { i } ^ { * }$ by semi-supervised EM using $\mathbf { x } _ { s } , \mathbf { y } _ { s }$ , and $\mathbf { x } _ { q }$ .
|
| 46 |
+
|
| 47 |
+
(2019), we only assume an unlabeled dataset toward applying the knowledge learned durin $\mathcal { D } _ { u } = \{ \mathbf { x } _ { u } \} _ { u = 1 } ^ { U }$ in the meta-training stage. We aimmeta-training stage to novel tasks in meta-test stage, which comes with a modest amount of labeled data (or as few as a single example per class) for each task. As with most meta-learning methods, we further assume that the labeled data are drawn from the same distribution as that of the unlabeled data, with a different set of classes. Specifically, the goal of a $K$ -way $S$ -shot classification task $\tau$ is to correctly predict the labels of query data pclass, where nts is r $\mathcal { Q } = \{ \mathbf { x } _ { q } \} _ { q = 1 } ^ { Q }$ , using (i.e. bet $S$ support data points and labels een 1 and 50). $\mathbf { \mathcal { S } } = \{ ( \mathbf { x } _ { s } , \mathbf { y } _ { s } ) \} _ { s = 1 } ^ { S }$ per $S$
|
| 48 |
+
|
| 49 |
+
# 3.2 META-LEVEL GAUSSIAN MIXTURE VAE
|
| 50 |
+
|
| 51 |
+
Unsupervised meta-training We now describe the meta-learning framework for learning unsupervised latent representations that can be transferred to human-designed few-shot image-classification tasks. In particular, we aim toward learning multi-modal latent spaces for Variational Autoencoder (VAE) in an episodic manner. We use the Gaussian mixture for the prior distribution $\begin{array} { r } { p _ { \psi } ( \mathbf { z } ) = \sum _ { k = 1 } ^ { K } p _ { \psi } ( \mathbf { \bar { y } } ^ { \mathbf { \bar { \psi } } } = k ) p _ { \psi } ( \mathbf { z } | \mathbf { y } = k ) } \end{array}$ , where $\psi$ is the parameter of the prior network. Then the generative process can be described as follows:
|
| 52 |
+
|
| 53 |
+
• $\mathbf { y } \sim p _ { \psi } ( \mathbf { y } )$ , where y corresponds to the categorical L.V. for a single mode.
|
| 54 |
+
• $\mathbf { z } \sim p _ { \psi } ( \mathbf { z } | \mathbf { y } )$ , where $\mathbf { z }$ corresponds to the Gaussian L.V. responsible for data generation.
|
| 55 |
+
• $\mathbf { x } \sim p _ { \theta } ( \mathbf { x } | \mathbf { z } )$ , where $\theta$ is the parameter of the generative model.
|
| 56 |
+
|
| 57 |
+
The above generative process is similar to those from the previous works (Dilokthanakul et al., 2016; Jiang et al., 2017) on modeling the VAE prior with Gaussian mixtures. However, they target single-task learning and the parameter of the prior network is fixed after training such as equation 1c in Dilokthanakul et al. (2016) and equation 5 in Jiang et al. (2017), which is suboptimal since a meta-learning model should be able to adapt and generalize to a novel task.
|
| 58 |
+
|
| 59 |
+
To learn the set-dependent multi-modalities, we further assume that there exists a parameter $\psi _ { i }$ for each episodic dataset we derive the variatio $\mathcal { D } _ { i } = \{ \mathbf { x } _ { j } \} _ { j = 1 } ^ { M }$ , which is randomly drawn from the d for the marginal log-likelihood of abeled dataset as follows: $\mathcal { D } _ { u }$ . Then $\mathcal { D } _ { i }$
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { l } { { \displaystyle \log p _ { \theta } ( \boldsymbol { D } _ { i } ) = \sum _ { j = 1 } ^ { M } \log p _ { \theta } ( { \bf x } _ { j } ) = \sum _ { j = 1 } ^ { M } \log \int p _ { \theta } ( { \bf x } _ { j } | { \bf z } _ { j } ) p _ { \psi _ { i } } ( { \bf z } _ { j } ) \frac { q _ { \phi } ( { \bf z } _ { j } | { \bf x } _ { j } , \mathcal { D } _ { i } ) } { q _ { \phi } ( { \bf z } _ { j } | { \bf x } _ { j } , \mathcal { D } _ { i } ) } d { \bf z } _ { j } } \ ~ } \\ { { \displaystyle \ ~ \geq \sum _ { j = 1 } ^ { M } \left[ \mathbb { E } _ { { \bf z } _ { j } \sim q _ { \phi } ( { \bf z } _ { j } | { \bf x } _ { j } , \mathcal { D } _ { i } ) } \left[ \log p _ { \theta } ( { \bf x } _ { j } | { \bf z } _ { j } ) + \log p _ { \psi _ { i } } ( { \bf z } _ { j } ) - \log q _ { \phi } ( { \bf z } _ { j } | { \bf x } _ { j } , \mathcal { D } _ { i } ) ) \right] \right] } } \\ { { \displaystyle ~ \approx \sum _ { j = 1 } ^ { M } \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \left[ \log p _ { \theta } ( { \bf x } _ { j } | { \bf z } _ { j } ^ { ( n ) } ) + \log p _ { \psi _ { i } } ( { \bf z } _ { j } ^ { ( n ) } ) - \log q _ { \phi } ( { \bf z } _ { j } ^ { ( n ) } | { \bf x } _ { j } , \mathcal { D } _ { i } ) \right] } } \\ { { \displaystyle ~ = : \mathcal { L } ( \theta , \phi , \psi _ { i } , \mathcal { D } _ { i } ) , ~ { \bf z } _ { j } ^ { ( n ) } \triangleq q _ { \phi } ( { \bf z } _ { j } | { \bf x } _ { j } , \mathcal { D } _ { i } ) } . } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Here the lower bound for each datapoint is approximated by Monte Carlo estimation with the sample size $N$ . Following the convention of the VAE literature, we assume that the variational posterior $q _ { \phi } ( \mathbf { z } _ { j } | \mathbf { x } _ { j } , \mathcal { D } _ { i } )$ follows an isotropic Gaussian distribution.
|
| 66 |
+
|
| 67 |
+
<table><tr><td colspan="2">Algorithm1Meta-training</td><td>Algorithm2 Meta-test for an episode</td></tr><tr><td colspan="2">Require: An unlabeled dataset Du</td><td>Require: A test task T= SU Q</td></tr><tr><td colspan="2">1: Initialize parameters 0,Φ</td><td></td></tr><tr><td colspan="2">2: while not done do Sample B episode datasets {Di}=1 from Du</td><td>2:Draw n MC samples from q(zj|xj,D)</td></tr><tr><td colspan="2">3: 4: for all i∈[1,B] do</td><td>1 v(n) 3:Initialize μk = ys k and σ²=I</td></tr><tr><td colspan="2">5: Draw n MC samples from q(zj|xj,Di) Initialize πk as1/K and randomly choose K</td><td>n=1 11(n)=k ys</td></tr><tr><td colspan="2">6: different points for μk·</td><td>4: Compute optimal parameter &* using Eq 10 5: Compute p(yq|xq,D) using Eq 11</td></tr></table>
|
| 68 |
+
|
| 69 |
+
Set-dependent variational posterior Our derivation of the evidence lower bound in $\mathrm { E q } 4$ is similar to that of the hierarchical VAE framework, such as equation 3 in Edwards & Storkey (2017) and equation 4 in Hewitt et al. (2018), in that we use the i.i.d assumption that the log likelihood of a dataset equals the sum over the log-likelihoods of each individual data point. Yet, previous works assume that each input set consists of data instances from a single concept (e.g. a class), therefore, they encode the dataset into a single global latent variable (e.g. $q _ { \phi } ( \mathbf { z } | \mathcal { D } ) )$ . This is not appropriate for unsupervised meta-learning where labels are unavailable. Thus we learn a set-conditioned variational posterior $q _ { \phi } ( \mathbf { z } _ { j } | \mathbf { x } _ { j } , \mathcal { D } _ { i } )$ , which models a latent variable to encode each data $\mathbf { x } _ { j }$ within the given dataset $\mathcal { D } _ { i }$ into the latent space. Specifically, we model the variational posterior $\bar { q _ { \phi } } ( \mathbf { z } _ { j } | \mathbf { x } _ { j } , \mathcal { D } _ { i } )$ using the self-attention mechanism (Vaswani et al., 2017) as follows:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\begin{array} { c } { { H = \mathrm { T r a n s f o r m e r E n c o d e r } ( f ( \mathcal { D } _ { i } ) ) } } \\ { { { \pmb \mu } _ { j } = W _ { \pmb \mu } H _ { j } + { \bf b } _ { \pmb \mu } , \quad { \pmb \sigma } _ { j } ^ { 2 } = e x p ( W _ { \pmb \sigma ^ { 2 } } H _ { j } + { \bf b } _ { \pmb \sigma ^ { 2 } } ) } } \\ { { q _ { \phi } ( { \bf z } _ { j } | { \bf x } _ { j } , \mathcal { D } _ { i } ) = \mathcal { N } ( { \bf z } _ { j } ; { \pmb \mu } _ { j } , { \pmb \sigma } _ { j } ^ { 2 } ) } } \end{array}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
Here we deploy TransformerEncoder $\cdot ( \cdot )$ , a neural network based on the multi-head self-attention mechanism proposed by Vaswani et al. (2017), to model the dependency between data instances, and $f$ is a convolutional neural network (or an identity function for the Mini-ImageNet) which takes each data in $\mathcal { D } _ { i }$ as an input. Moreover, we use the reparameterization trick (Kingma & Welling, 2014) to train the model with backpropagation since the stochastic sampling process z(nj ${ \mathbf z } _ { j } ^ { ( n ) } \overset { i . i . d } { \sim } q _ { \phi } ( { \mathbf z } _ { j } | { \mathbf x } _ { j } , { D } _ { i } )$ is non-differentiable.
|
| 76 |
+
|
| 77 |
+
Expectation Maximization As discussed before, we assume that the parameter $\psi _ { i }$ of the prior Gaussian Mixture is task-specific and characterizes the given dataset $\mathcal { D } _ { i }$ . To obtain the task-specific parameter that optimally explain the given dataset, we propose to locally maximize the lower bound in Eq 4 with respect to the prior parameter $\psi _ { i }$ . We can obtain the optimal parameter $\psi _ { i } ^ { * }$ by solving the following optimization problem:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\psi _ { i } ^ { * } = \underset { \psi _ { i } } { \arg \operatorname* { m a x } } \mathcal { L } ( \theta , \phi , \psi _ { i } , \mathcal { D } _ { i } ) = \underset { \psi _ { i } } { \arg \operatorname* { m a x } } \sum _ { j , n = 1 } ^ { M , N } \log p _ { \psi } ( \mathbf { z } _ { j } ^ { ( n ) } ) , \quad \mathbf { z } _ { j } ^ { ( n ) } \overset { i , i . i . d } { \sim } q _ { \phi } ( \mathbf { z } _ { j } | \mathbf { x } _ { j } , \mathcal { D } _ { i } ) ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where we only consider the term related to the task-specific parameter $\psi _ { i }$ , and eliminate the normalization term $\textstyle { \frac { 1 } { N } }$ since it does not change the solution of the optimization problem. The above formula implies that the optimal parameter maximizes the log-likelihood of observations which can be drawn from the variational posterior distribution. However, we do not have an analytic solution for Maximum Likelihood Estimation (MLE) of a GMM.
|
| 84 |
+
|
| 85 |
+
The most prevalent approach for estimating the parameters for the mixture of Gaussian is solving it with Expectation Maximization (EM) algorithm. To this end, we propose to optimize the taskspecific parameter of GMM prior distribution using EM algorithm as follows:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\begin{array} { r l } & { \mathrm { ( E \mathrm { - } s t e p ) } \quad Q _ { j , n } ( k ) : = p ( \mathbf { y } _ { j } ^ { ( n ) } = k | \mathbf { z } _ { j } ^ { ( n ) } ) = \frac { \pi _ { k } \mathcal { N } ( \mathbf { z } _ { j } ^ { ( n ) } ; \mu _ { k } , I ) } { \sum _ { k } \pi _ { k } \mathcal { N } ( \mathbf { z } _ { j } ^ { ( n ) } ; \mu _ { k } , I ) } } \\ & { \mathrm { ( M \mathrm { - } s t e p ) } \quad \mu _ { k } : = \frac { \sum _ { j , n = 1 } ^ { M , N } Q _ { j , n } ( k ) \mathbf { z } _ { j } ^ { ( n ) } } { \sum _ { j , n = 1 } ^ { M , N } Q _ { j , n } ( k ) } , \quad \pi _ { k } : = \frac { \sum _ { j , n = 1 } ^ { M , N } Q _ { j , n } ( k ) } { \sum _ { k = 1 } ^ { K } \sum _ { j , n = 1 } ^ { M , N } Q _ { j , n } ( k ) } } \\ & { \qquad \psi _ { i } : = \{ ( \mu _ { k } , I , \pi _ { k } ) \} _ { k = 1 } ^ { K } , } \end{array}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $\pi _ { k } , \mu _ { k }$ , and $\mathcal { N } ( \cdot )$ denote the mixing probability of $k$ -th component, mean parameter, and normal distribution, respectively. We assume that the covariance matrix of Gaussian distribution is fixed with the identity matrix $\pmb { I }$ , following the assumption of original VAE on the prior distribution. We initialize $\{ \pi _ { k } \} _ { k = 1 } ^ { K }$ and $\{ \mu _ { k } \} _ { k = 1 } ^ { K }$ as $\begin{array} { r } { \frac { 1 } { K } } \end{array}$ and randomly drawn $K$ different points, respectively. We can obtain MLE solution for the parameters of GMM, by iteratively performing E-step and M-step until the log-likelihood converges. We found that using a fixed number of iterations for the EM algorithm does not degrade the performance, and consider it as a hyperparameter of our framework.
|
| 92 |
+
|
| 93 |
+
Training objective Note that we want to maximize the variational lower bound of the marginal loglikelihood over all the episode datasets $\mathcal { D } _ { i }$ that can be sampled from $\mathcal { D } _ { u }$ . We use stochastic gradient ascent with respect to the variational parameter $\phi$ and the generative parameter $\theta$ , to maximize the following objective:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\begin{array} { r l r } { { \mathcal { L } ( \theta , \phi , \{ \mathcal { D } _ { i } \} _ { i = 1 } ^ { B } ) : = \frac { 1 } { B } \sum _ { i = 1 } ^ { B } [ \operatorname* { m a x } _ { \psi _ { i } } \mathcal { L } ( \theta , \phi , \psi _ { i } , \mathcal { D } _ { i } ) ] } } \\ & { } & { = \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \sum _ { j = 1 } ^ { M } \frac { 1 } { N } \sum _ { n = 1 } ^ { N } [ \log p _ { \theta } ( \mathbf { x } _ { j } | \mathbf { z } _ { j } ^ { ( n ) } ) + \log p _ { \psi _ { i } ^ { * } } ( \mathbf { z } _ { j } ^ { ( n ) } ) - \log q _ { \phi } ( \mathbf { z } _ { j } ^ { ( n ) } | \mathbf { x } _ { j } , \mathcal { D } _ { i } ) ] . } \end{array}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
Here we use $B$ mini-batch of episode datasets, where each dataset consists of $M$ datapoints. The task-specific parameter $\psi _ { i } ^ { * }$ for each episode dataset $\mathcal { D } _ { i }$ is obtained by EM algorithm in Eq 7.
|
| 100 |
+
|
| 101 |
+
Supervised meta-test By introducing the multi-modal prior distribution into a generative learning framework, our model learns pseudo-class concepts by clustering latent features with EM algorithm. However, there is no guarantee that each modality obtained by EM algorithm corresponds to the label we are interested in at the meta-test stage. To realize modality as label in downstream fewshot image classification tasks, we deploy semi-supervised EM algorithm instead. Given a task $\tau$ consisting of support set $\mathcal { S } = \{ ( \mathbf { x } _ { s } , \mathbf { y } _ { s } ) \} _ { s = 1 } ^ { S }$ and query set $\mathcal { Q } = \{ \bar { \mathbf { x } } _ { q } \} _ { q = 1 } ^ { Q }$ , we use both the support set and query set as an episode dataset $\mathcal { D } = \{ \mathbf { x } _ { s } \} _ { s = 1 } ^ { S } \cup \{ \mathbf { x } _ { q } \} _ { q = 1 } ^ { Q }$ and draw latent variables from the variational posterior $q _ { \phi } ( \mathbf { z } _ { j } | \mathbf { x } _ { j } , \mathcal { D } )$ . Note that we abbreviate the index $i$ since we consider a single task for now. We then perform semi-supervised EM algorithm as follows:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\begin{array} { r l } & { ( \mathrm { E } { \mathrm { - } } \ s \mathrm { t e p } ) \quad Q _ { q , n } ( k ) : = p ( \mathsf { y } _ { q } ^ { ( n ) } = k | \mathbf { z } _ { q } ^ { ( n ) } ) = \frac { \mathcal { N } ( { \mathbf { z } } _ { q } ^ { ( n ) } ; \mu _ { k } , \sigma _ { k } ^ { 2 } ) } { \sum _ { k } \mathcal { N } ( { \mathbf { z } } _ { q } ^ { ( n ) } ; \mu _ { k } , \sigma _ { k } ^ { 2 } ) } } \\ & { \mu _ { k } : = \frac { \sum _ { s , n = 1 } ^ { S , N } { \mathbf { 1 } } _ { \mathbf { y } _ { \mathrm { s } } ^ { ( \mathrm { a } ) } = \mathbf { k } } ^ { \mathbf { z } _ { s } ^ { ( n ) } } + \sum _ { q , n = 1 } ^ { Q , N } Q _ { q , n } ( k ) \mathbf { z } _ { q } ^ { ( n ) } } { \sum _ { s , n = 1 } ^ { S , N } { \mathbf { 1 } } _ { \mathbf { y } _ { \mathrm { s } } ^ { ( \mathrm { a } ) } = \mathbf { k } } + \sum _ { q , n = 1 } ^ { Q , N } Q _ { q , n } ( k ) } , } \\ & { \sigma _ { k } ^ { 2 } : = \frac { \sum _ { s , n = 1 } ^ { S , N } { \mathbf { 1 } } _ { \mathbf { y } _ { \mathrm { a } } ^ { ( \mathrm { a } ) } = \mathbf { k } } ( { \mathbf { z } } _ { n } ^ { ( \mathrm { s } ) } - \mu _ { k } ) ^ { 2 } + \sum _ { q , n = 1 } ^ { Q , N } Q _ { q , n } ( k ) ( \mathbf { z } _ { q } ^ { ( n ) } - \mu _ { k } ) ^ { 2 } } { \sum _ { s , n = 1 } ^ { S , N } { \mathbf { 1 } } _ { \mathbf { y } _ { \mathrm { s } } ^ { ( \mathrm { a } ) } = \mathbf { k } } + \sum _ { q , n = 1 } ^ { Q , N } Q _ { q , n } ( k ) } } \\ & { \quad \quad \quad \psi : = \{ ( \mu _ { k } , \sigma _ { k } ^ { 2 } , \frac { 1 } { K } ) { \mathbb { I } } _ { k = 1 } ^ { K } , } \end{array}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where 1 denotes an indicator function. We fix the mixing probability as $\textstyle { \frac { 1 } { K } }$ since the labels in each task $\tau$ are uniformly distributed. Moreover, we utilize diagonal covariance $\sigma _ { k } ^ { 2 }$ to obtain more accurate statistics for the inference. We initialize $\mu _ { k }$ and $\sigma _ { k } ^ { 2 }$ as the average value of support latent representations and the identity matrix $\pmb { I }$ , respectively. Similar to the meta-training stage, we obtain the MLE solution for the parameters of GMM, by performing E-step and M-step for a fixed number of iterations. Finally, we compute the conditional probability of $p ( \mathbf { y } _ { q } | \mathbf { x } _ { q } , \mathcal { D } )$ using the obtained parameters $\psi ^ { * }$ as follows:
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
p ( \mathbf { y } _ { q } | \mathbf { x } _ { q } , \mathcal { D } ) = \mathbb { E } _ { q _ { \phi } ( \mathbf { z } _ { q } | \mathbf { x } _ { q } , \mathcal { D } ) } \left[ p _ { \psi ^ { * } } ( \mathbf { y } _ { q } | \mathbf { z } _ { q } ) \right] \approx \frac { 1 } { N } \sum _ { n = 1 } ^ { N } p _ { \psi ^ { * } } ( \mathbf { y } _ { q } | \mathbf { z } _ { q } ^ { ( n ) } ) , \quad \mathbf { z } _ { q } ^ { ( n ) } \overset { i , i . d } { \sim } q _ { \phi } ( \mathbf { z } _ { q } | \mathbf { x } _ { q } , \mathcal { D } ) .
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
Here we compute $p _ { \psi ^ { * } } ( \mathbf { y } _ { q } | \mathbf { z } _ { q } ^ { ( n ) } )$ with Bayes rule, and we reuse $N$ different Monte Carlo samples that is drawn for $\mathrm { E q ~ } 1 0 $ , where the prediction of query $\hat { \mathbf { y } _ { q } } = \mathop { \arg \operatorname* { m a x } } _ { k } p ( \mathbf { y } _ { q } = k | \mathbf { x } _ { q } , \mathcal { D } )$ . We present the pseudo-code of the algorithm for training and inference of Meta-GMVAE in the Algorithm 1 and 2.
|
| 114 |
+
|
| 115 |
+
Visual feature reconstruction While our method is a generative model that can generate samples from output distribution, the ability to generate samples may not be necessary for discriminative downstream tasks (Chen et al., 2020). Moreover, we found that VAEs almost fail to learn in MiniImageNet dataset with the architecturally limited constraints of the meta-learning literature. Thus, we propose a high-level feature reconstruction objective instead for Mini-ImageNet dataset. We experimentally find that the recently proposed constrastive learning framework, namely SimCLR (Chen et al., 2020), is the most effective for our settings. Specifically, SimCLR learns high-level representation by performing a constrastive prediction task on pairs of augmented examples derived from a minibatch. We train SimCLR on the unsupervised dataset $\mathcal { D } _ { u } = \{ \mathbf { \bar { x } } _ { u } \} _ { u = 1 } ^ { U }$ , and use high-level features extracted by SimCLR as an input for our framework.
|
| 116 |
+
|
| 117 |
+
# 4 EXPERIMENT
|
| 118 |
+
|
| 119 |
+
In this section, we now validate the effectiveness of our Meta-GMVAE on several downstream fewshot classification tasks. The source codes are available at https://github.com/db-Lee/ Meta-GMVAE.
|
| 120 |
+
|
| 121 |
+
# 4.1 EXPERIMENTAL SETUPS
|
| 122 |
+
|
| 123 |
+
Baselines and ours We now describe two supervised meta-learning approaches which we consider as “oracles”, unsupervised meta-learning baselines, and the proposed Meta-GMVAE. 1) MAML (oracle): Model Agnostic Meta Learning by Finn et al. (2017). We compare against its performance reported in Hsu et al. (2019). 2) ProtoNets (oracle): Euclidean distance-based meta-learning approach by Snell et al. (2017). We also compare against it using its performance reported in Hsu et al. (2019). 3) CACTUs: Clustering to Automatically Construct Tasks for Unsupervised meta-learning by Hsu et al. (2019). It automatically constructs tasks by clustering the unsupervised dataset in embedding space learned by ACAI (Berthelot et al., 2019), BiGAN (Donahue et al., 2017), and DeepCluster (Caron et al., 2018). Then they train either MAML or ProtoNets using the cluster indices as pseudo-labels. 4) UMTRA: Unsupervised Meta-learning with Tasks constructed by Random sampling and Augmentation by Khodadadeh et al. (2019). For constructing a K-way 1-shot task, it randomly samples K-way datapoints from unsupervised dataset and augments each datapoint. Then MAML is trained on the constructed tasks. 5) Meta-GMVAE: Our proposed Meta-level Gaussian Mixture VAE. It learns a latent representation by matching set-level amortized variational posterior and task-specific multimodal prior optimized by EM algorithm.
|
| 124 |
+
|
| 125 |
+
Datasets We validate all the models on two benchmark datasets for few-shot classification. 1) Omniglot: This is a collection of $2 8 \times 2 8$ gray-scale hand-written characters that describe 1623 different alphabets, each of which contains 20 instances. Following the experimental setup of Hsu et al. (2019), we use 1200 classes for unsupervised meta-training, 100 classes for meta-validation and the remaining 323 classes for meta-test. We further augment each class by rotating the images 90, 180, and 270 degrees, such that the total number of classes is $1 6 2 3 \times 4$ , following the convention. 2) Mini-ImageNet: This is a subset of ILSVRC-2012 (Deng et al., 2009) introduced by Ravi & Larochelle (2017), consisting of 100 classes that comes with 600 images of size $8 4 \times 8 4$ that describe different instances. We use 64 classes for unsupervised meta-training, 16 classes for meta-validation, and the remaining 20 classes for meta-test, following the standard protocol.
|
| 126 |
+
|
| 127 |
+
Implementation details We now introduce the specific implementation details of Meta-GMVAE on the two benchmark datasets. 1) Variational posterior network $q _ { \phi } ( \mathbf { z } | \mathbf { x } , \mathcal { D } _ { i } )$ : we use the standard Conv4 architecture on Omniglot dataset for a fair comparison against relevant baselines. On top of the Conv4 architecture, we stack two TransformerEncoder layers and an affine transformation layer to predict the mean and log-variance of Gaussian distribution. For Mini-ImageNet dataset, we only utilize two TransformerEncoder layers and an affine transformation layer since the input used for Mini-ImageNet is already a high-level visual representation extracted from the Conv5 architecture trained with SimCLR. For both datasets, we set the dimensionality of the latent variable to 64. 2) Generative network $p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { z } )$ : For Omniglot dataset, the architecture of generative network is symmetric to the Conv4 architecture of variational posterior network. The last layer outputs the parameter of output Bernoulli distribution. For Mini-ImageNet dataset, we use 3-layer MLP with ReLU activation to predict the mean of output Gaussian distribution. 3) Other details: we utilize Adam optimizer (Kingma & Ba, 2015) with a constant learning rate of 0.001 and 0.0001 for Omniglot and MiniImageNet experiments, respectively. We set the number of iterations for EM algorithm as 10 for all the experiments. For the more details, please see the Appendix.
|
| 128 |
+
|
| 129 |
+
<table><tr><td></td><td colspan="5">Omniglot (way, shot)</td><td colspan="4">Mini-ImagNet (way, shot)</td></tr><tr><td>Method</td><td>Clustering</td><td>(5,1)</td><td>(5,5)</td><td>(20,1)</td><td>(20,5)</td><td>(5,1)</td><td>(5,5)</td><td>(5,20)</td><td>(5,50)</td></tr><tr><td>Training from Scratch</td><td>N/A</td><td>52.50</td><td>74.78</td><td>24.91</td><td>47.62</td><td>27.59</td><td>38.48</td><td>51.53</td><td>59.63</td></tr><tr><td>CACTUs-MAML</td><td>BiGAN</td><td>58.18</td><td>78.66</td><td>35.56</td><td>58.62</td><td>36.24</td><td>51.28</td><td>61.33</td><td>66.91</td></tr><tr><td>CACTUs-ProtoNets</td><td>BiGAN</td><td>54.74</td><td>71.69</td><td>33.40</td><td>50.62</td><td>36.62</td><td>50.16</td><td>59.56</td><td>63.27</td></tr><tr><td>CACTUs-MAML</td><td>ACAI/DC</td><td>68.84</td><td>87.78</td><td>48.09</td><td>73.36</td><td>39.90</td><td>53.97</td><td>63.84</td><td>69.64</td></tr><tr><td>CACTUs-ProtoNets</td><td>ACAI/DC</td><td>68.12</td><td>83.58</td><td>47.75</td><td>66.27</td><td>39.18</td><td>53.36</td><td>61.54</td><td>63.55</td></tr><tr><td>UMTRA</td><td>N/A</td><td>83.80</td><td>95.43</td><td>74.25</td><td>92.12</td><td>39.93</td><td>50.73</td><td>61.11</td><td>67.15</td></tr><tr><td>Meta-GMVAE (ours)</td><td>N/A</td><td>94.92</td><td>97.09</td><td>82.21</td><td>90.61</td><td>42.82</td><td>55.73</td><td>63.14</td><td>68.26</td></tr><tr><td>MAML (oracle)</td><td>N/A</td><td>94.46</td><td>98.83</td><td>84.60</td><td>96.29</td><td>46.81</td><td>62.13</td><td>71.03</td><td>75.54</td></tr><tr><td>ProtoNets (oracle)</td><td>N/A</td><td>98.35</td><td>99.58</td><td>95.31</td><td>98.81</td><td>46.56</td><td>62.29</td><td>70.05</td><td>72.04</td></tr></table>
|
| 130 |
+
|
| 131 |
+
Table 1: The few-shot classification results (way, shot) on the Omniglot and Mini-ImageNet datasets. DC denotes DeepCluster. We report the average of accuracies evaluated over 1000 episodes. All the values are based on the reported performance in Hsu et al. (2019) and Khodadadeh et al. (2019), except for ours.
|
| 132 |
+
|
| 133 |
+

|
| 134 |
+
Figure 3: The samples obtained and generated for each mode at unsupervised meta-training and supervised meta-test step of Meta-GMVAE. Samples in each row are in the same modality obtained by EM.
|
| 135 |
+
|
| 136 |
+
# 4.2 EXPERIMENTAL RESULTS
|
| 137 |
+
|
| 138 |
+
Few-shot classification Table 1 shows the few-shot classification results obtained by supervised meta-learning baselines (oracle), the two unsupervised meta-learning baselines, and our MetaGMVAE. For the Omniglot dataset, the Meta-GMVAE outperforms all the baselines that only utilize unsupervised-learning for constructing meta-training tasks, except for the UMTRA on the 20-shot 5-shot classification. Meta-GMVAE also outperforms baselines on Mini-ImageNet 1-shot, and 5- shot settings which are the most widely used settings, while it matches the performance of baselines in 20-shot, and 50-shot settings. This shows that meta-learning the posterior network can capture the multi-modal distribution of any given tasks with Meta-GMVAE, is indeed more effective over unsupervised meta-learning baselines which simply trains supervised meta-learning models with pseudo-labels obtained from unlabeled data. Moreover, our Meta-GMVAE obtains better performance than supervised MAML on Omniglot 5-way 1-shot classification, while utilizing as small as $0 . 1 \%$ of the labeled data. This matches the observation in Chen et al. (2020) that well-calibrated unsupervised learning approaches with a modest amount of labels can obtain a performance comparable to or even better than supervised approaches.
|
| 139 |
+
|
| 140 |
+
Visualization To better understand how our Meta-GMVAE learns and realizes class-concepts in fewshot classification tasks, we visualize the actual samples in an episode classified by Meta-GMVAE and ones generated by generative network $p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { z } )$ , during unsupervised meta-training and supervised meta-testing. We visualize the actual samples and generated ones that have a same modality in a same row. In Figure 3-a, b, we can observe that our Meta-GMVAE captures the similar visual structure in each modality during meta-training, but the modalities are not the class-concepts. However, as shown Figure 3-c, d, our Meta-GMVAE easily realizes each modality as each class-concept at meta-test time.
|
| 141 |
+
|
| 142 |
+
Ablation study Furthermore, we compare the performance of our model variants by eliminating each of the most important components for our model. We describe the each variant as follows: 1) LR (SimCLR): This performs the logistic regression using support set on top of features pretrained by SimCLR. 2) Vanilla VAE: We train Vanilla VAE on $\mathcal { D } _ { u }$ and predict labels using semi-supervised EM with fixed identity covariance I. 3) Vanilla VAE (SimCLR): This is same as 2) Vanilla VAE except that it is trained on features pretrained by SimCLR. 4) Ep: Meta-GMVAE with an episodic training with task specific parameter $\psi _ { i } ^ { * }$ obtained by EM. 5) Set: Meta-GMM whether having setlevel variational posterior (i.e. $q _ { \phi } ( \mathbf { z } | \mathbf { x } , \mathcal { D } _ { i } ) )$ or not (i.e. $q _ { \phi } ( { \bf z } | { \bf x } ) )$ . 6) $\sigma ^ { 2 }$ : Meta-GMM performs semi-supervised EM algorithm whether using diagonal covariance matrix or fixing it with identity matrix $\pmb { I }$ . Table 2-Left shows that all the components we consider are critical for the performance on the few-shot classification tasks as expected. The best performance gain comes from Ep, which supports our proposal on meta-learning the set-level variational posterior by matching it with the multi-modal prior, where the task-specific parameter is obtained with EM.
|
| 143 |
+
|
| 144 |
+
<table><tr><td>Method</td><td>Ep Set</td><td>9²</td><td>0</td><td>M</td></tr><tr><td>Training From Scratch</td><td></td><td></td><td>24.91</td><td>27.59</td></tr><tr><td>LR (SimCLR)</td><td></td><td></td><td>N/A</td><td>40.11</td></tr><tr><td>Vanilla VAE</td><td></td><td></td><td>69.68</td><td>N/A</td></tr><tr><td>Vanilla VAE (SimCLR)</td><td></td><td></td><td>N/A</td><td>38.40</td></tr><tr><td rowspan="4">Meta-GMVAE</td><td>>>></td><td></td><td>78.64</td><td>40.51</td></tr><tr><td></td><td>√</td><td>81.65</td><td>41.13</td></tr><tr><td></td><td>√</td><td>80.94</td><td>40.92</td></tr><tr><td><</td><td>√ √</td><td>82.21</td><td>42.82</td></tr><tr><td>MAML (oracle)</td><td>√</td><td></td><td>84.60</td><td>46.81</td></tr><tr><td>ProtoNets (oracle)</td><td>√</td><td></td><td>95.31</td><td>46.56</td></tr></table>
|
| 145 |
+
|
| 146 |
+
Table 2: Left: The results of the ablation study on Meta-GMVAE (O: 20-way 1-shot classification on Omniglot, M: 5-way 1-shot classification on Mini-ImageNet). Right: The results of cross-way 1-shot experiments on Omniglot. The values in the parenthesis indicate that a model is trained based on the (way, shot) setting.
|
| 147 |
+
|
| 148 |
+
<table><tr><td></td><td>Training ( g(way,shot)</td></tr><tr><td>Test way</td><td>(5,1) (5,5) (20,1) (20,5)</td></tr><tr><td>2-way</td><td>98.26 98.00 98.36 98.23</td></tr><tr><td>5-way</td><td>94.92 94.57 93.93 94.01</td></tr><tr><td>10-way</td><td>89.87 89.99 89.10 89.30</td></tr><tr><td>15-way</td><td>85.11 85.12 85.36 85.33</td></tr><tr><td>20-way 81.38</td><td>81.11 82.21 81.98</td></tr><tr><td>30-way 77.80</td><td>77.42 78.40 77.24</td></tr><tr><td>40-way 73.76</td><td>73.15 74.03 73.56</td></tr><tr><td>50-way 70.92</td><td>70.85 69.86 70.02</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Cross-way classification We then experiment our Meta-GMVAE by varying the number of way (between 2 and 50) and fixing the number of shot as 1. In particular, we set the number of component $k$ as the Test way for the meta-test and perform semi-supervised EM algorithm in Eq 10. Table 2-Right shows that the difference in the number of way used for training and test does not significantly affect the performance, which demonstrates the robustness of Meta-GMVAE on varying number of way. We
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 4: The visualization of the latent space for the cross-shot generalization experiment.
|
| 154 |
+
|
| 155 |
+
also visualize the latent space for the cross-shot experiment using t-SNE (Rauber et al., 2016), in Figure 4, which shows that Meta-GMVAE trained with 20-way can cluster 5-way meta-test task.
|
| 156 |
+
|
| 157 |
+
# 5 CONCLUSION
|
| 158 |
+
|
| 159 |
+
We proposed a novel unsupervised meta-learning model, namely Meta-GMVAE, which can generate a task-dependent posterior for a given unseen task with multi-modal Gaussian Mixture priors. Given a random episode that consists of samples from diverse classes, we optimize the task-specific parameter of the mixture of Gaussian prior with Expectation-Maximization algorithm, such that each mode can capture intrinsic groupings in the given data. We meta-train the variational posterior network over such data-driven prior obtained over large number of episodes. Then, at the metatest step, we realize each modality with a label by deploying semi-supervised EM algorithm with both the support and the query set. We validate our method on two few-shot image classification benchmark datasets, and show that Meta-GMVAE largely outperforms the relevant unsupervised meta-learning baselines, even achieving better performance than supervised MAML on Omniglot 5-way 1-shot experiments.
|
| 160 |
+
|
| 161 |
+
Acknowledgements This work was supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No.2019- 0-00075, Artificial Intelligence Graduate School Program (KAIST)), Samsung Research Funding Center of Samsung Electronics (No. SRFC-IT1502-51), Samsung Electronics (IO201214-08145- 01), and the Engineering Research Center Program through the National Research Foundation of Korea (NRF) funded by the Korean Government MSIT (NRF-2018R1A5A1059921). We sincerely thank the anonymous reviewers for their constructive comments which helped us significantly improve our paper during the rebuttal period. We also appreciate D. Khue Lˆ e-Huu for the valuable ˆ discussion on Rao et al. (2019).
|
| 162 |
+
|
| 163 |
+
# REFERENCES
|
| 164 |
+
|
| 165 |
+
Yoshua Bengio, Aaron C. Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE Trans. Pattern Anal. Mach. Intell., 35(8):1798–1828, 2013.
|
| 166 |
+
|
| 167 |
+
David Berthelot, Colin Raffel, Aurko Roy, and Ian J. Goodfellow. Understanding and improving interpolation in autoencoders via an adversarial regularizer. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019.
|
| 168 |
+
|
| 169 |
+
Piotr Bojanowski and Armand Joulin. Unsupervised learning by predicting noise. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, volume 70 of Proceedings of Machine Learning Research, pp. 517–526. PMLR, 2017.
|
| 170 |
+
|
| 171 |
+
Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss (eds.), Computer Vision - ECCV 2018 - 15th European Conference, Munich, Germany, September 8-14, 2018, Proceedings, Part XIV, volume 11218 of Lecture Notes in Computer Science, pp. 139–156. Springer, 2018.
|
| 172 |
+
|
| 173 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. A simple framework for contrastive learning of visual representations. CoRR, abs/2002.05709, 2020.
|
| 174 |
+
|
| 175 |
+
Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In Daniel D. Lee, Masashi Sugiyama, Ulrike von Luxburg, Isabelle Guyon, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 2172–2180, 2016.
|
| 176 |
+
|
| 177 |
+
Brian Cheung, Jesse A. Livezey, Arjun K. Bansal, and Bruno A. Olshausen. Discovering hidden factors of variation in deep networks. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Workshop Track Proceedings, 2015.
|
| 178 |
+
|
| 179 |
+
Adam Coates and Andrew Y. Ng. Learning feature representations with k-means. In Gregoire Mon- ´ tavon, Genevieve B. Orr, and Klaus-Robert Muller (eds.), ¨ Neural Networks: Tricks of the Trade - Second Edition, volume 7700 of Lecture Notes in Computer Science, pp. 561–580. Springer, 2012.
|
| 180 |
+
|
| 181 |
+
Ekin Dogus Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V. Le. Autoaugment:´ Learning augmentation policies from data. CoRR, abs/1805.09501, 2018.
|
| 182 |
+
|
| 183 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Fei-Fei Li. Imagenet: A large-scale hierarchical image database. In 2009 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR 2009), 20-25 June 2009, Miami, Florida, USA, pp. 248–255. IEEE Computer Society, 2009.
|
| 184 |
+
|
| 185 |
+
Emily L. Denton and Vighnesh Birodkar. Unsupervised learning of disentangled representations from video. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pp. 4414–4423, 2017.
|
| 186 |
+
|
| 187 |
+
Nat Dilokthanakul, Pedro A. M. Mediano, Marta Garnelo, Matthew C. H. Lee, Hugh Salimbeni, Kai Arulkumaran, and Murray Shanahan. Deep unsupervised clustering with gaussian mixture variational autoencoders. CoRR, abs/1611.02648, 2016.
|
| 188 |
+
|
| 189 |
+
Zheng Ding, Yifan Xu, Weijian Xu, Gaurav Parmar, Yang Yang, Max Welling, and Zhuowen Tu. Guided variational autoencoder for disentanglement learning. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pp. 7917–7926. IEEE, 2020.
|
| 190 |
+
|
| 191 |
+
Jeff Donahue, Philipp Krahenb ¨ uhl, and Trevor Darrell. Adversarial feature learning. In ¨ 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017.
|
| 192 |
+
|
| 193 |
+
Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Alex Lamb, Mart´ın Arjovsky, Olivier Mastropietro, and Aaron C. Courville. Adversarially learned inference. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017.
|
| 194 |
+
|
| 195 |
+
Harrison Edwards and Amos J. Storkey. Towards a neural statistician. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017.
|
| 196 |
+
|
| 197 |
+
Dumitru Erhan, Yoshua Bengio, Aaron C. Courville, Pierre-Antoine Manzagol, Pascal Vincent, and Samy Bengio. Why does unsupervised pre-training help deep learning? J. Mach. Learn. Res., 11: 625–660, 2010.
|
| 198 |
+
|
| 199 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, volume 70 of Proceedings of Machine Learning Research, pp. 1126–1135. PMLR, 2017.
|
| 200 |
+
|
| 201 |
+
Chelsea Finn, Kelvin Xu, and Sergey Levine. Probabilistic model-agnostic meta-learning. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolo Cesa-Bianchi, and Ro- \` man Garnett (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, 3-8 December 2018, Montreal, ´ Canada, pp. 9537–9548, 2018.
|
| 202 |
+
|
| 203 |
+
Sebastian Flennerhag, Andrei A. Rusu, Razvan Pascanu, Francesco Visin, Hujun Yin, and Raia Hadsell. Meta-learning with warped gradient descent. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 204 |
+
|
| 205 |
+
Marta Garnelo, Jonathan Schwarz, Dan Rosenbaum, Fabio Viola, Danilo J. Rezende, S. M. Ali Eslami, and Yee Whye Teh. Neural processes. CoRR, abs/1807.01622, 2018.
|
| 206 |
+
|
| 207 |
+
Luke B. Hewitt, Maxwell I. Nye, Andreea Gane, Tommi S. Jaakkola, and Joshua B. Tenenbaum. The variational homoencoder: Learning to learn high capacity generative models from few examples. In Amir Globerson and Ricardo Silva (eds.), Proceedings of the Thirty-Fourth Conference on Uncertainty in Artificial Intelligence, UAI 2018, Monterey, California, USA, August 6-10, 2018, pp. 988–997. AUAI Press, 2018.
|
| 208 |
+
|
| 209 |
+
Irina Higgins, Lo¨ıc Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017.
|
| 210 |
+
|
| 211 |
+
Kyle Hsu, Sergey Levine, and Chelsea Finn. Unsupervised learning via meta-learning. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019.
|
| 212 |
+
|
| 213 |
+
Zhuxi Jiang, Yin Zheng, Huachun Tan, Bangsheng Tang, and Hanning Zhou. Variational deep embedding: An unsupervised and generative approach to clustering. In Carles Sierra (ed.), Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, IJCAI 2017, Melbourne, Australia, August 19-25, 2017, pp. 1965–1972, 2017.
|
| 214 |
+
|
| 215 |
+
Siavash Khodadadeh, Ladislau Bol¨ oni, and Mubarak Shah. Unsupervised meta-learning for few- ¨ shot image classification. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d’Alche-Buc, Emily B. Fox, and Roman Garnett (eds.), ´ Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, 8-14 December 2019, Vancouver, BC, Canada, pp. 10132–10142, 2019.
|
| 216 |
+
|
| 217 |
+
Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In Jennifer G. Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmassan, Stockholm, Sweden, July 10-15, 2018 ¨ , volume 80 of Proceedings of Machine Learning Research, pp. 2654–2663. PMLR, 2018.
|
| 218 |
+
|
| 219 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015.
|
| 220 |
+
|
| 221 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In Yoshua Bengio and Yann LeCun (eds.), 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014.
|
| 222 |
+
|
| 223 |
+
Gregory Koch, Richard Zemel, and Ruslan Salakhutdinov. Siamese neural networks for one-shot image recognition. In Proceedings of the 32th International Conference on Machine Learning, ICML 2015, 2015.
|
| 224 |
+
|
| 225 |
+
Philipp Krahenb ¨ uhl, Carl Doersch, Jeff Donahue, and Trevor Darrell. Data-dependent initializations ¨ of convolutional neural networks. In Yoshua Bengio and Yann LeCun (eds.), 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016.
|
| 226 |
+
|
| 227 |
+
Brenden M. Lake, Ruslan Salakhutdinov, Jason Gross, and Joshua B. Tenenbaum. One shot learning of simple visual concepts. In Laura A. Carlson, Christoph Holscher, and Thomas F. Shipley (eds.), ¨ Proceedings of the 33th Annual Meeting of the Cognitive Science Society, CogSci 2011, Boston, Massachusetts, USA, July 20-23, 2011. cognitivesciencesociety.org, 2011.
|
| 228 |
+
|
| 229 |
+
Quoc V. Le. Building high-level features using large scale unsupervised learning. In IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP 2013, Vancouver, BC, Canada, May 26-31, 2013, pp. 8595–8598. IEEE, 2013.
|
| 230 |
+
|
| 231 |
+
Yoonho Lee and Seungjin Choi. Gradient-based meta-learning with learned layerwise metric and subspace. In Jennifer G. Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmassan, Stockholm, Sweden, July 10- ¨ 15, 2018, volume 80 of Proceedings of Machine Learning Research, pp. 2933–2942. PMLR, 2018.
|
| 232 |
+
|
| 233 |
+
Zhenguo Li, Fengwei Zhou, Fei Chen, and Hang Li. Meta-sgd: Learning to learn quickly for few shot learning. CoRR, abs/1707.09835, 2017.
|
| 234 |
+
|
| 235 |
+
Michael Mathieu, Junbo Jake Zhao, Pablo Sprechmann, Aditya Ramesh, and Yann LeCun. Disen- ¨ tangling factors of variation in deep representation using adversarial training. In Daniel D. Lee, Masashi Sugiyama, Ulrike von Luxburg, Isabelle Guyon, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 5041–5049, 2016.
|
| 236 |
+
|
| 237 |
+
Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. A simple neural attentive metalearner. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018.
|
| 238 |
+
|
| 239 |
+
Boris N. Oreshkin, Pau Rodr´ıguez Lopez, and Alexandre Lacoste. TADAM: task dependent adaptive ´ metric for improved few-shot learning. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolo Cesa-Bianchi, and Roman Garnett (eds.), \` Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, 3-8 December 2018, Montreal, Canada ´ , pp. 719–729, 2018.
|
| 240 |
+
|
| 241 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In Yoshua Bengio and Yann LeCun (eds.), 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016.
|
| 242 |
+
|
| 243 |
+
Prajit Ramachandran, Peter J. Liu, and Quoc V. Le. Unsupervised pretraining for sequence to sequence learning. In Martha Palmer, Rebecca Hwa, and Sebastian Riedel (eds.), Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, EMNLP 2017, Copenhagen, Denmark, September 9-11, 2017, pp. 383–391. Association for Computational Linguistics, 2017.
|
| 244 |
+
|
| 245 |
+
Dushyant Rao, Francesco Visin, Andrei A. Rusu, Razvan Pascanu, Yee Whye Teh, and Raia Hadsell. Continual unsupervised representation learning. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d’Alche-Buc, Emily B. Fox, and Roman Garnett (eds.), ´ Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 7645–7655, 2019.
|
| 246 |
+
|
| 247 |
+
Paulo E. Rauber, Alexandre X. Falcao, and Alexandru C. Telea. Visualizing time-dependent data ˜ using dynamic t-sne. In Enrico Bertini, Niklas Elmqvist, and Thomas Wischgoll (eds.), 18th Eurographics Conference on Visualization, EuroVis 2016 - Short Papers, Groningen, The Netherlands, June 6-10, 2016, pp. 73–77. Eurographics Association, 2016.
|
| 248 |
+
|
| 249 |
+
Sachin Ravi and Alex Beatson. Amortized bayesian meta-learning. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019.
|
| 250 |
+
|
| 251 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017.
|
| 252 |
+
|
| 253 |
+
Scott E. Reed, Kihyuk Sohn, Yuting Zhang, and Honglak Lee. Learning to disentangle factors of variation with manifold interaction. In Proceedings of the 31th International Conference on Machine Learning, ICML 2014, Beijing, China, 21-26 June 2014, volume 32 of JMLR Workshop and Conference Proceedings, pp. 1431–1439. JMLR.org, 2014.
|
| 254 |
+
|
| 255 |
+
Oleh Rybkin, Kostas Daniilidis, and Sergey Levine. Simple and effective VAE training with calibrated decoders. CoRR, abs/2006.13202, 2020.
|
| 256 |
+
|
| 257 |
+
Tim Salimans, Ian J. Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Daniel D. Lee, Masashi Sugiyama, Ulrike von Luxburg, Isabelle Guyon, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 2226–2234, 2016.
|
| 258 |
+
|
| 259 |
+
Jake Snell, Kevin Swersky, and Richard S. Zemel. Prototypical networks for few-shot learning. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pp. 4077–4087, 2017.
|
| 260 |
+
|
| 261 |
+
Sebastian Thrun and Lorien Y. Pratt (eds.). Learning to Learn. Springer, 1998.
|
| 262 |
+
|
| 263 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pp. 5998–6008, 2017.
|
| 264 |
+
|
| 265 |
+
Pascal Vincent, Hugo Larochelle, Isabelle Lajoie, Yoshua Bengio, and Pierre-Antoine Manzagol. Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion. J. Mach. Learn. Res., 11:3371–3408, 2010.
|
| 266 |
+
|
| 267 |
+
Oriol Vinyals, Charles Blundell, Tim Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. In Daniel D. Lee, Masashi Sugiyama, Ulrike von Luxburg, Isabelle Guyon, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 3630–3638, 2016.
|
| 268 |
+
|
| 269 |
+
# A OMNIGLOT EXPERIMENTS
|
| 270 |
+
|
| 271 |
+
# A.1 TRAINING PROCEDURE
|
| 272 |
+
|
| 273 |
+
Omniglot is a collection of $2 8 \times 2 8$ gray-scale hand-written characters that describe 1623 different alphabets, each of which contains 20 instances. Following the experimental setup of Hsu et al. (2019), we use 1200 classes for unsupervised meta-training, 100 classes for meta-validation and the remaining 323 classes for meta-test. We further augment each class by rotating the images 90, 180, and 270 degrees, such that the total number of classes is $1 6 2 3 \times 4$ , following the convention. We evaluate the trained model using 1000 randomly selected tasks from test set. During evaluation, $K \times S$ data instances are used as support inputs and $K \times 1 5$ data instances are used as query inputs. We use the Adam (Kingma & Ba, 2015) optimizer with a constant learning rate of 0.001 to train all models. All models are trained for 60,000 iterations. For the 5-way experiments (i.e. $K = 5$ ), we set the mini-batch size, the number of datapoints, and Monte Carlo sample size as 4, 200, and 32, respectively (i.e. $B = 4 , M = 2 0 0 .$ , and $N = 3 2$ ). For the 20-way experiments (i.e. $K = 2 0$ ), we set them as 4, 300, and 32 (i.e. $B = 4 , M = 3 0 0$ , and $N = 3 2$ ). We set the number of EM iterations as 10.
|
| 274 |
+
|
| 275 |
+
# A.2 NETWORK ARCHITECTURE
|
| 276 |
+
|
| 277 |
+
We summarize the network architecture in the following Table 3, and 4. We assume that the output follows Bernoulli distribution, therefore, the output of generative network $p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { z } )$ is the mean parameter.
|
| 278 |
+
|
| 279 |
+
Set-level variational posterior network $q _ { \phi } ( \mathbf { z } | \mathbf { x } , \mathcal { D } _ { i } )$
|
| 280 |
+
|
| 281 |
+
<table><tr><td>Output Size</td><td>Layers</td></tr><tr><td>1× 28× 28</td><td>Input Images</td></tr><tr><td>64 × 14 ×14</td><td>conv2d(3 × 3, stride 1, padding 1), BatchNorm2D,ReLU,Maxpool(2 × 2, stride 2)</td></tr><tr><td>64×7×7</td><td>conv2d(3 × 3,stride 1, padding 1),BatchNorm2D,ReLU,Maxpool(2 × 2, stride 2)</td></tr><tr><td>64×4×4</td><td>conv2d(3 × 3,stride 1, padding 1),BatchNorm2D,ReLU,Maxpool(2 × 2, stride 2)</td></tr><tr><td>64×2×2</td><td>conv2d(3 × 3, stride 1,padding 1),BatchNorm2D,ReLU,Maxpool(2 × 2, stride 2)</td></tr><tr><td>256</td><td>Flatten</td></tr><tr><td>256</td><td>TransformerEncoder(dmodel = 256,dff = 256,h = 4,ELU,LayerNorm=False)</td></tr><tr><td>256</td><td>TransformerEncoder(dmodel = 256,dff = 256,h = 4,ELU,LayerNorm=False)</td></tr><tr><td>64×2</td><td>Linear(256,64 × 2)</td></tr></table>
|
| 282 |
+
|
| 283 |
+
Table 3: Set-level variational posterior network used for Omniglot dataset. We refer the hyperparameter notation of TransformerEncoder to Vaswani et al. (2017).
|
| 284 |
+
Generative network $p _ { \theta } ( \mathbf { x } | \mathbf { z } )$
|
| 285 |
+
Table 4: Generative Network for $p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { z } )$ for Omniglot dataset.
|
| 286 |
+
|
| 287 |
+
<table><tr><td>Output Size</td><td>Layers</td></tr><tr><td>64</td><td>Latent code</td></tr><tr><td>256</td><td>Linear(64,256),ELU</td></tr><tr><td>256</td><td>Linear(256,256),ELU</td></tr><tr><td>256</td><td>Linear(256,256),ELU</td></tr><tr><td>64×2×2</td><td>Unflatten</td></tr><tr><td>64×4×4</td><td>deconv2d(4 × 4, stride 2,padding1),BatchNorm2D,ReLU</td></tr><tr><td>64×7×7</td><td>deconv2d(3 × 3, stride 2,padding1),BatchNorm2D,ReLU</td></tr><tr><td>64×14 × 14</td><td>deconv2d(4 × 4, stride 2, padding 1), BatchNorm2D,ReLU</td></tr><tr><td>1×28×28</td><td>deconv2d(4 × 4,stride 2,padding 1), Sigmoid</td></tr></table>
|
| 288 |
+
|
| 289 |
+
# A.3 $9 5 \%$ CONFIDENCE INTERVAL
|
| 290 |
+
|
| 291 |
+
We provide the standard errors of our model’s performance at $9 5 \%$ confidence interval over 1000 episodes on the Omniglot dataset in Table 5.
|
| 292 |
+
|
| 293 |
+
<table><tr><td>Omniglot</td><td>(5,1)</td><td>(5,5)</td><td>(20,1)</td><td>(20,5)</td></tr><tr><td>Meta-GMVAE</td><td>94.92 ± 0.42</td><td>97.09±0.20</td><td>82.21± 0.44</td><td>90.61± 0.19</td></tr></table>
|
| 294 |
+
|
| 295 |
+
Table 5: The few-shot classification results (way, shot) with $9 5 \%$ confidence interval on the Omniglot.
|
| 296 |
+
|
| 297 |
+
# B MINI-IMAGENET EXPERIMENTS
|
| 298 |
+
|
| 299 |
+
# B.1 TRAINING PROCEDURE
|
| 300 |
+
|
| 301 |
+
Mini-ImageNet is a subset of ILSVRC-2012 (Deng et al., 2009) introduced by Ravi & Larochelle (2017), consisting of 100 classes that comes with 600 images of size $8 4 \times 8 4$ that describe different instances. We first train Conv5 feature extractor using SimCLR objective with temperature term $\tau = 0 . 5$ , on Mini-ImageNet unsupervised meta-training dataset. We train the feature extractor using Adam optimizer with learning rate of 0.0001 for 400 epochs. We use 64 classes for unsupervised meta-training, 16 classes for meta-validation, and the remaining 20 classes for meta-test, following the standard protocol. We evaluate the trained model using 1000 randomly selected tasks from test set. During evaluation, $5 \times S$ data instances are used as support inputs and $5 \times 1 5$ data instances are used as query inputs. For all the experiments, we use the Adam (Kingma & Ba, 2015) optimizer with a constant learning rate of 0.0001, and set the mini-batch size, the number of datapoints, and Monte Carlo sample size as 16, 5, and 256, respectively (i.e. $B = 1 6 , M = 5$ , and $N = 2 5 6$ ) for the 1, 5, and 20-shot experiments. For the 50-shot experiment, we set them 4, 200, and 256, respectively (i.e. $B = , M = 2 0 0$ , and $N = 2 5 6$ ). We train the models for 5K, 10K, 15k, 25K, and 30K for 1, 5, 20, and 50-shot experiments, respectively. We set the number of EM iterations as 10.
|
| 302 |
+
|
| 303 |
+
# B.2 NETWORK ARCHITECTURE
|
| 304 |
+
|
| 305 |
+
We summarize the network architecture in the following Table 6, 7, and 8. We assume that the output follows Gaussian distribution, therefore, the output of generative network $p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { z } )$ is the mean parameter. Moreover, the variance of output Gaussian distribution is obtained as suggested in Rybkin et al. (2020).
|
| 306 |
+
|
| 307 |
+
Feature Extractor for SimCLR
|
| 308 |
+
Table 6: Feature Extractor trained on Mini-ImageNet dataset using SimCLR objective.
|
| 309 |
+
|
| 310 |
+
<table><tr><td>Output Size</td><td>Layers</td></tr><tr><td>3×84×84</td><td>Input Images</td></tr><tr><td>64×42× 42</td><td>conv2d(3 × 3, stride 1, padding1), BatchNorm2D,ReLU,Maxpool(2 × 2, stride 2)</td></tr><tr><td>64× 21× 21</td><td>conv2d(3 × 3,stride 1,padding 1),BatchNorm2D,ReLU,Maxpool(2 × 2,stride 2)</td></tr><tr><td>64×10×10</td><td>conv2d(3 × 3, stride 1,padding1),BatchNorm2D,ReLU,Maxpool(2 × 2, stride 2)</td></tr><tr><td>64×5×5</td><td>conv2d(3 × 3, stride1,padding1), BatchNorm2D,ReLU,Maxpool(2 × 2,stride 2)</td></tr><tr><td>64×2×2</td><td>conv2d(3 × 3, stride 1,padding 1),BatchNorm2D,ReLU,Maxpool(2 × 2, stride 2)</td></tr><tr><td>256</td><td>Flatten</td></tr></table>
|
| 311 |
+
|
| 312 |
+
Set-level variational posterior network $q _ { \phi } ( \mathbf { z } | \mathbf { x } , \mathcal { D } _ { i } )$
|
| 313 |
+
Table 7: Set-level variational posterior network used for Mini-ImageNet dataset. We refer the hyperparameter notation of TransformerEncoder to Vaswani et al. (2017).
|
| 314 |
+
|
| 315 |
+
<table><tr><td>Output Size</td><td>Layers</td></tr><tr><td>256</td><td>Input Features</td></tr><tr><td>256</td><td>TransformerEncoder(dmodel = 256,dff = 256,h = 4,ReLU,LayerNorm=False)</td></tr><tr><td>256</td><td>TransformerEncoder(dmodel = 256,dff = 256,h = 4,ReLU,LayerNorm=False)</td></tr><tr><td>64×2</td><td>Linear(256,64 × 2)</td></tr></table>
|
| 316 |
+
|
| 317 |
+
Generative network $p _ { \theta } ( \mathbf { x } | \mathbf { z } )$
|
| 318 |
+
Table 8: Generative Network for $p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { z } )$ for Mini-ImageNet dataset.
|
| 319 |
+
|
| 320 |
+
<table><tr><td>Output Size</td><td>Layers</td></tr><tr><td>64</td><td>Latent code</td></tr><tr><td>512</td><td>Linear(64, 512), ReLU</td></tr><tr><td>512</td><td>Linear(512,512),ReLU</td></tr><tr><td>256</td><td>Linear(512,256), ReLU</td></tr></table>
|
| 321 |
+
|
| 322 |
+
# B.3 $9 5 \%$ CONFIDENCE INTERVAL
|
| 323 |
+
|
| 324 |
+
We provide the standard errors at $9 5 \%$ confidence interval over 1000 episodes on the Mini-ImageNet dataset in Table 9.
|
| 325 |
+
|
| 326 |
+
<table><tr><td>Mini-ImageNet</td><td>(5,1)</td><td>(5,5)</td><td>(20,1)</td><td>(20,5)</td></tr><tr><td>Meta-GMVAE</td><td>42.82 ± 0.56</td><td>55.73 ±0.48</td><td>63.14 ± 0.47</td><td>68.26 ± 0.42</td></tr></table>
|
| 327 |
+
|
| 328 |
+
Table 9: The few-shot classification results (way, shot) with $9 5 \%$ confidence interval on the Mini-ImageNet.
|
| 329 |
+
|
| 330 |
+
# B.4 ADDITIONAL COMPARISON USING SIMCLR
|
| 331 |
+
|
| 332 |
+
To further understand where the improvement of Meta-GMVAE on the Mini-ImageNet dataset, we ran experiment on baselines with SimCLR pretrained features. For CACTUs, we cluster in the embedding space pretrained by SimCLR. For UMTRA, we follow the exact same procedure to generate training episode, which is proposed by the authors. Moreover, we fix the pretrained SimCLR features as the setting of Meta-GMVAE for the both of baselines. Table 10 shows that Meta-GMVAE outperforms the baselines with SimCLR, which supports the effectiveness of Meta-GMVAE combined with SimCLR pretrained features.
|
| 333 |
+
|
| 334 |
+
<table><tr><td>Mini-ImageNet</td><td>(5,1) (5,5) (20,1) (20,5)</td></tr><tr><td>CACTUs-MAML (SimCLR) 40.39</td><td>52.35 61.09 64.89</td></tr><tr><td>UMTRA (SimCLR) 40.85</td><td>51.47 61.03 67.30</td></tr><tr><td>Meta-GMVAE 42.82</td><td>55.73 63.14 68.26</td></tr></table>
|
| 335 |
+
|
| 336 |
+
Table 10: The comparison on the few-shot classification results (way, shot) using SimCLR.
|